id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
142,900 | deis/deis | deisctl/backend/fleet/unit.go | readTemplate | func readTemplate(component string, templatePaths []string) (out []byte, err error) {
templateName := "deis-" + component + ".service"
var templateFile string
// look in $DEISCTL_UNITS env var, then the local and global root paths
for _, p := range templatePaths {
if p == "" {
continue
}
filename := path.... | go | func readTemplate(component string, templatePaths []string) (out []byte, err error) {
templateName := "deis-" + component + ".service"
var templateFile string
// look in $DEISCTL_UNITS env var, then the local and global root paths
for _, p := range templatePaths {
if p == "" {
continue
}
filename := path.... | [
"func",
"readTemplate",
"(",
"component",
"string",
",",
"templatePaths",
"[",
"]",
"string",
")",
"(",
"out",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"templateName",
":=",
"\"",
"\"",
"+",
"component",
"+",
"\"",
"\"",
"\n",
"var",
"templateF... | // readTemplate returns the contents of a systemd template for the given component | [
"readTemplate",
"returns",
"the",
"contents",
"of",
"a",
"systemd",
"template",
"for",
"the",
"given",
"component"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/unit.go#L122-L146 |
142,901 | deis/deis | deisctl/backend/fleet/unit.go | readDecorator | func readDecorator(component string) (out []byte, err error) {
decoratorName := "deis-" + component + ".service.decorator"
var decoratorFile string
// look in $DEISCTL_UNITS env var, then the local and global root paths
for _, p := range decoratorPaths {
filename := path.Join(p, decoratorName)
if _, err := os.... | go | func readDecorator(component string) (out []byte, err error) {
decoratorName := "deis-" + component + ".service.decorator"
var decoratorFile string
// look in $DEISCTL_UNITS env var, then the local and global root paths
for _, p := range decoratorPaths {
filename := path.Join(p, decoratorName)
if _, err := os.... | [
"func",
"readDecorator",
"(",
"component",
"string",
")",
"(",
"out",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"decoratorName",
":=",
"\"",
"\"",
"+",
"component",
"+",
"\"",
"\"",
"\n",
"var",
"decoratorFile",
"string",
"\n\n",
"// look in $DEISCT... | // readDecorator returns the contents of a file containing a snippet that can
// optionally be grafted on to the end of a corresponding systemd unit to
// achieve isolation of the control plane, data plane, and router mesh | [
"readDecorator",
"returns",
"the",
"contents",
"of",
"a",
"file",
"containing",
"a",
"snippet",
"that",
"can",
"optionally",
"be",
"grafted",
"on",
"to",
"the",
"end",
"of",
"a",
"corresponding",
"systemd",
"unit",
"to",
"achieve",
"isolation",
"of",
"the",
... | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/unit.go#L151-L169 |
142,902 | deis/deis | logger/storage/ringbuffer/adapter.go | NewStorageAdapter | func NewStorageAdapter(bufferSize int) (*adapter, error) {
if bufferSize <= 0 {
return nil, fmt.Errorf("Invalid ringBuffer size: %d", bufferSize)
}
return &adapter{bufferSize: bufferSize, ringBuffers: make(map[string]*ringBuffer)}, nil
} | go | func NewStorageAdapter(bufferSize int) (*adapter, error) {
if bufferSize <= 0 {
return nil, fmt.Errorf("Invalid ringBuffer size: %d", bufferSize)
}
return &adapter{bufferSize: bufferSize, ringBuffers: make(map[string]*ringBuffer)}, nil
} | [
"func",
"NewStorageAdapter",
"(",
"bufferSize",
"int",
")",
"(",
"*",
"adapter",
",",
"error",
")",
"{",
"if",
"bufferSize",
"<=",
"0",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"bufferSize",
")",
"\n",
"}",
"\n",
"return... | // NewStorageAdapter returns a pointer to a new instance of an in-memory storage.Adapter. | [
"NewStorageAdapter",
"returns",
"a",
"pointer",
"to",
"a",
"new",
"instance",
"of",
"an",
"in",
"-",
"memory",
"storage",
".",
"Adapter",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/storage/ringbuffer/adapter.go#L58-L63 |
142,903 | deis/deis | logger/storage/ringbuffer/adapter.go | Write | func (a *adapter) Write(app string, message string) error {
// Check first if we might actually have to add to the map of ringBuffer pointers so we can avoid
// waiting for / obtaining a lock unnecessarily
rb, ok := a.ringBuffers[app]
if !ok {
// Ensure only one goroutine at a time can be adding a ringBuffer to t... | go | func (a *adapter) Write(app string, message string) error {
// Check first if we might actually have to add to the map of ringBuffer pointers so we can avoid
// waiting for / obtaining a lock unnecessarily
rb, ok := a.ringBuffers[app]
if !ok {
// Ensure only one goroutine at a time can be adding a ringBuffer to t... | [
"func",
"(",
"a",
"*",
"adapter",
")",
"Write",
"(",
"app",
"string",
",",
"message",
"string",
")",
"error",
"{",
"// Check first if we might actually have to add to the map of ringBuffer pointers so we can avoid",
"// waiting for / obtaining a lock unnecessarily",
"rb",
",",
... | // Write adds a log message to to an app-specific ringBuffer | [
"Write",
"adds",
"a",
"log",
"message",
"to",
"to",
"an",
"app",
"-",
"specific",
"ringBuffer"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/storage/ringbuffer/adapter.go#L66-L83 |
142,904 | deis/deis | logger/storage/ringbuffer/adapter.go | Read | func (a *adapter) Read(app string, lines int) ([]string, error) {
rb, ok := a.ringBuffers[app]
if ok {
return rb.read(lines), nil
}
return nil, fmt.Errorf("Could not find logs for '%s'", app)
} | go | func (a *adapter) Read(app string, lines int) ([]string, error) {
rb, ok := a.ringBuffers[app]
if ok {
return rb.read(lines), nil
}
return nil, fmt.Errorf("Could not find logs for '%s'", app)
} | [
"func",
"(",
"a",
"*",
"adapter",
")",
"Read",
"(",
"app",
"string",
",",
"lines",
"int",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"rb",
",",
"ok",
":=",
"a",
".",
"ringBuffers",
"[",
"app",
"]",
"\n",
"if",
"ok",
"{",
"return",
... | // Read retrieves a specified number of log lines from an app-specific ringBuffer | [
"Read",
"retrieves",
"a",
"specified",
"number",
"of",
"log",
"lines",
"from",
"an",
"app",
"-",
"specific",
"ringBuffer"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/storage/ringbuffer/adapter.go#L86-L92 |
142,905 | deis/deis | client/parser/config.go | Config | func Config(argv []string) error {
usage := `
Valid commands for config:
config:list list environment variables for an app
config:set set environment variables for an app
config:unset unset environment variables for an app
config:pull extract environment variables to .env
config:push ... | go | func Config(argv []string) error {
usage := `
Valid commands for config:
config:list list environment variables for an app
config:set set environment variables for an app
config:unset unset environment variables for an app
config:pull extract environment variables to .env
config:push ... | [
"func",
"Config",
"(",
"argv",
"[",
"]",
"string",
")",
"error",
"{",
"usage",
":=",
"`\nValid commands for config:\n\nconfig:list list environment variables for an app\nconfig:set set environment variables for an app\nconfig:unset unset environment variables for an app\... | // Config routes config commands to their specific function. | [
"Config",
"routes",
"config",
"commands",
"to",
"their",
"specific",
"function",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/config.go#L9-L46 |
142,906 | deis/deis | Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go | Wait | func (t *Tomb) Wait() error {
t.init()
<-t.dead
t.m.Lock()
reason := t.reason
t.m.Unlock()
return reason
} | go | func (t *Tomb) Wait() error {
t.init()
<-t.dead
t.m.Lock()
reason := t.reason
t.m.Unlock()
return reason
} | [
"func",
"(",
"t",
"*",
"Tomb",
")",
"Wait",
"(",
")",
"error",
"{",
"t",
".",
"init",
"(",
")",
"\n",
"<-",
"t",
".",
"dead",
"\n",
"t",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"reason",
":=",
"t",
".",
"reason",
"\n",
"t",
".",
"m",
".",
... | // Wait blocks until the goroutine is in a dead state and returns the
// reason for its death. | [
"Wait",
"blocks",
"until",
"the",
"goroutine",
"is",
"in",
"a",
"dead",
"state",
"and",
"returns",
"the",
"reason",
"for",
"its",
"death",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go#L111-L118 |
142,907 | deis/deis | Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go | Kill | func (t *Tomb) Kill(reason error) {
t.init()
t.m.Lock()
defer t.m.Unlock()
if reason == ErrDying {
if t.reason == ErrStillAlive {
panic("tomb: Kill with ErrDying while still alive")
}
return
}
if t.reason == nil || t.reason == ErrStillAlive {
t.reason = reason
}
// If the receive on t.dying succeeds,... | go | func (t *Tomb) Kill(reason error) {
t.init()
t.m.Lock()
defer t.m.Unlock()
if reason == ErrDying {
if t.reason == ErrStillAlive {
panic("tomb: Kill with ErrDying while still alive")
}
return
}
if t.reason == nil || t.reason == ErrStillAlive {
t.reason = reason
}
// If the receive on t.dying succeeds,... | [
"func",
"(",
"t",
"*",
"Tomb",
")",
"Kill",
"(",
"reason",
"error",
")",
"{",
"t",
".",
"init",
"(",
")",
"\n",
"t",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"defer",
"t",
".",
"m",
".",
"Unlock",
"(",
")",
"\n",
"if",
"reason",
"==",
"ErrDyi... | // Kill flags the goroutine as dying for the given reason.
// Kill may be called multiple times, but only the first
// non-nil error is recorded as the reason for termination.
//
// If reason is ErrDying, the previous reason isn't replaced
// even if it is nil. It's a runtime error to call Kill with
// ErrDying if t is... | [
"Kill",
"flags",
"the",
"goroutine",
"as",
"dying",
"for",
"the",
"given",
"reason",
".",
"Kill",
"may",
"be",
"called",
"multiple",
"times",
"but",
"only",
"the",
"first",
"non",
"-",
"nil",
"error",
"is",
"recorded",
"as",
"the",
"reason",
"for",
"term... | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go#L137-L158 |
142,908 | deis/deis | Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go | Killf | func (t *Tomb) Killf(f string, a ...interface{}) error {
err := fmt.Errorf(f, a...)
t.Kill(err)
return err
} | go | func (t *Tomb) Killf(f string, a ...interface{}) error {
err := fmt.Errorf(f, a...)
t.Kill(err)
return err
} | [
"func",
"(",
"t",
"*",
"Tomb",
")",
"Killf",
"(",
"f",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"err",
":=",
"fmt",
".",
"Errorf",
"(",
"f",
",",
"a",
"...",
")",
"\n",
"t",
".",
"Kill",
"(",
"err",
")",
"\n",
"r... | // Killf works like Kill, but builds the reason providing the received
// arguments to fmt.Errorf. The generated error is also returned. | [
"Killf",
"works",
"like",
"Kill",
"but",
"builds",
"the",
"reason",
"providing",
"the",
"received",
"arguments",
"to",
"fmt",
".",
"Errorf",
".",
"The",
"generated",
"error",
"is",
"also",
"returned",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go#L162-L166 |
142,909 | deis/deis | Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go | Err | func (t *Tomb) Err() (reason error) {
t.init()
t.m.Lock()
reason = t.reason
t.m.Unlock()
return
} | go | func (t *Tomb) Err() (reason error) {
t.init()
t.m.Lock()
reason = t.reason
t.m.Unlock()
return
} | [
"func",
"(",
"t",
"*",
"Tomb",
")",
"Err",
"(",
")",
"(",
"reason",
"error",
")",
"{",
"t",
".",
"init",
"(",
")",
"\n",
"t",
".",
"m",
".",
"Lock",
"(",
")",
"\n",
"reason",
"=",
"t",
".",
"reason",
"\n",
"t",
".",
"m",
".",
"Unlock",
"(... | // Err returns the reason for the goroutine death provided via Kill
// or Killf, or ErrStillAlive when the goroutine is still alive. | [
"Err",
"returns",
"the",
"reason",
"for",
"the",
"goroutine",
"death",
"provided",
"via",
"Kill",
"or",
"Killf",
"or",
"ErrStillAlive",
"when",
"the",
"goroutine",
"is",
"still",
"alive",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/gopkg.in/tomb.v1/tomb.go#L170-L176 |
142,910 | deis/deis | client/cmd/builds.go | BuildsList | func BuildsList(appID string, results int) error {
c, appID, err := load(appID)
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
builds, count, err := builds.List(c, appID, results)
if err != nil {
return err
}
fmt.Printf("=== %s Builds%s", appID, limitCount(len(... | go | func BuildsList(appID string, results int) error {
c, appID, err := load(appID)
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
builds, count, err := builds.List(c, appID, results)
if err != nil {
return err
}
fmt.Printf("=== %s Builds%s", appID, limitCount(len(... | [
"func",
"BuildsList",
"(",
"appID",
"string",
",",
"results",
"int",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"results",
"=="... | // BuildsList lists an app's builds. | [
"BuildsList",
"lists",
"an",
"app",
"s",
"builds",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/builds.go#L14-L37 |
142,911 | deis/deis | client/cmd/builds.go | BuildsCreate | func BuildsCreate(appID, image, procfile string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
procfileMap := make(map[string]string)
if procfile != "" {
if procfileMap, err = parseProcfile([]byte(procfile)); err != nil {
return err
}
} else if _, err := os.Stat("Procfile"); err ==... | go | func BuildsCreate(appID, image, procfile string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
procfileMap := make(map[string]string)
if procfile != "" {
if procfileMap, err = parseProcfile([]byte(procfile)); err != nil {
return err
}
} else if _, err := os.Stat("Procfile"); err ==... | [
"func",
"BuildsCreate",
"(",
"appID",
",",
"image",
",",
"procfile",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"procfileMap"... | // BuildsCreate creates a build for an app. | [
"BuildsCreate",
"creates",
"a",
"build",
"for",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/builds.go#L40-L77 |
142,912 | deis/deis | client/cmd/apps.go | AppCreate | func AppCreate(id string, buildpack string, remote string, noRemote bool) error {
c, err := client.New()
if err != nil {
return err
}
fmt.Print("Creating Application... ")
quit := progress()
app, err := apps.New(c, id)
quit <- true
<-quit
if err != nil {
return err
}
fmt.Printf("done, created %s\n", ... | go | func AppCreate(id string, buildpack string, remote string, noRemote bool) error {
c, err := client.New()
if err != nil {
return err
}
fmt.Print("Creating Application... ")
quit := progress()
app, err := apps.New(c, id)
quit <- true
<-quit
if err != nil {
return err
}
fmt.Printf("done, created %s\n", ... | [
"func",
"AppCreate",
"(",
"id",
"string",
",",
"buildpack",
"string",
",",
"remote",
"string",
",",
"noRemote",
"bool",
")",
"error",
"{",
"c",
",",
"err",
":=",
"client",
".",
"New",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
... | // AppCreate creates an app. | [
"AppCreate",
"creates",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L21-L64 |
142,913 | deis/deis | client/cmd/apps.go | AppsList | func AppsList(results int) error {
c, err := client.New()
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
apps, count, err := apps.List(c, results)
if err != nil {
return err
}
fmt.Printf("=== Apps%s", limitCount(len(apps), count))
sort.Sort(apps)
for _, app ... | go | func AppsList(results int) error {
c, err := client.New()
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
apps, count, err := apps.List(c, results)
if err != nil {
return err
}
fmt.Printf("=== Apps%s", limitCount(len(apps), count))
sort.Sort(apps)
for _, app ... | [
"func",
"AppsList",
"(",
"results",
"int",
")",
"error",
"{",
"c",
",",
"err",
":=",
"client",
".",
"New",
"(",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"results",
"==",
"defaultLimit",
"{",
"results",
"... | // AppsList lists apps on the Deis controller. | [
"AppsList",
"lists",
"apps",
"on",
"the",
"Deis",
"controller",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L67-L91 |
142,914 | deis/deis | client/cmd/apps.go | AppInfo | func AppInfo(appID string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
app, err := apps.Get(c, appID)
if err != nil {
return err
}
fmt.Printf("=== %s Application\n", app.ID)
fmt.Println("updated: ", app.Updated)
fmt.Println("uuid: ", app.UUID)
fmt.Println("created: ", app.Crea... | go | func AppInfo(appID string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
app, err := apps.Get(c, appID)
if err != nil {
return err
}
fmt.Printf("=== %s Application\n", app.ID)
fmt.Println("updated: ", app.Updated)
fmt.Println("uuid: ", app.UUID)
fmt.Println("created: ", app.Crea... | [
"func",
"AppInfo",
"(",
"appID",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"app",
",",
"err",
":=",
"apps",
".",
"Get",
... | // AppInfo prints info about app. | [
"AppInfo",
"prints",
"info",
"about",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L94-L130 |
142,915 | deis/deis | client/cmd/apps.go | AppOpen | func AppOpen(appID string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
app, err := apps.Get(c, appID)
if err != nil {
return err
}
u := app.URL
if !(strings.HasPrefix(u, "http://") || strings.HasPrefix(u, "https://")) {
u = "http://" + u
}
return webbrowser.Webbrowser(u)
} | go | func AppOpen(appID string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
app, err := apps.Get(c, appID)
if err != nil {
return err
}
u := app.URL
if !(strings.HasPrefix(u, "http://") || strings.HasPrefix(u, "https://")) {
u = "http://" + u
}
return webbrowser.Webbrowser(u)
} | [
"func",
"AppOpen",
"(",
"appID",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"app",
",",
"err",
":=",
"apps",
".",
"Get",
... | // AppOpen opens an app in the default webbrowser. | [
"AppOpen",
"opens",
"an",
"app",
"in",
"the",
"default",
"webbrowser",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L133-L152 |
142,916 | deis/deis | client/cmd/apps.go | AppLogs | func AppLogs(appID string, lines int) error {
c, appID, err := load(appID)
if err != nil {
return err
}
logs, err := apps.Logs(c, appID, lines)
if err != nil {
return err
}
return printLogs(logs)
} | go | func AppLogs(appID string, lines int) error {
c, appID, err := load(appID)
if err != nil {
return err
}
logs, err := apps.Logs(c, appID, lines)
if err != nil {
return err
}
return printLogs(logs)
} | [
"func",
"AppLogs",
"(",
"appID",
"string",
",",
"lines",
"int",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"logs",
",",
"err",
":="... | // AppLogs returns the logs from an app. | [
"AppLogs",
"returns",
"the",
"logs",
"from",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L155-L169 |
142,917 | deis/deis | client/cmd/apps.go | printLogs | func printLogs(logs string) error {
for _, log := range strings.Split(logs, "\n") {
category := "unknown"
parts := strings.Split(strings.Split(log, ": ")[0], " ")
if len(parts) >= 2 {
category = parts[1]
}
colorVars := map[string]string{
"Color": chooseColor(category),
"Log": log,
}
fmt.Printl... | go | func printLogs(logs string) error {
for _, log := range strings.Split(logs, "\n") {
category := "unknown"
parts := strings.Split(strings.Split(log, ": ")[0], " ")
if len(parts) >= 2 {
category = parts[1]
}
colorVars := map[string]string{
"Color": chooseColor(category),
"Log": log,
}
fmt.Printl... | [
"func",
"printLogs",
"(",
"logs",
"string",
")",
"error",
"{",
"for",
"_",
",",
"log",
":=",
"range",
"strings",
".",
"Split",
"(",
"logs",
",",
"\"",
"\\n",
"\"",
")",
"{",
"category",
":=",
"\"",
"\"",
"\n",
"parts",
":=",
"strings",
".",
"Split"... | // printLogs prints each log line with a color matched to its category. | [
"printLogs",
"prints",
"each",
"log",
"line",
"with",
"a",
"color",
"matched",
"to",
"its",
"category",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L172-L187 |
142,918 | deis/deis | client/cmd/apps.go | AppRun | func AppRun(appID, command string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Running '%s'...\n", command)
out, err := apps.Run(c, appID, command)
if err != nil {
return err
}
fmt.Print(out.Output)
os.Exit(out.ReturnCode)
return nil
} | go | func AppRun(appID, command string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Running '%s'...\n", command)
out, err := apps.Run(c, appID, command)
if err != nil {
return err
}
fmt.Print(out.Output)
os.Exit(out.ReturnCode)
return nil
} | [
"func",
"AppRun",
"(",
"appID",
",",
"command",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"fmt",
".",
"Printf",
"(",
"\"... | // AppRun runs a one time command in the app. | [
"AppRun",
"runs",
"a",
"one",
"time",
"command",
"in",
"the",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L190-L208 |
142,919 | deis/deis | client/cmd/apps.go | AppDestroy | func AppDestroy(appID, confirm string) error {
gitSession := false
c, err := client.New()
if err != nil {
return err
}
if appID == "" {
appID, err = git.DetectAppName(c.ControllerURL.Host)
if err != nil {
return err
}
gitSession = true
}
if confirm == "" {
fmt.Printf(` ! WARNING: Potentia... | go | func AppDestroy(appID, confirm string) error {
gitSession := false
c, err := client.New()
if err != nil {
return err
}
if appID == "" {
appID, err = git.DetectAppName(c.ControllerURL.Host)
if err != nil {
return err
}
gitSession = true
}
if confirm == "" {
fmt.Printf(` ! WARNING: Potentia... | [
"func",
"AppDestroy",
"(",
"appID",
",",
"confirm",
"string",
")",
"error",
"{",
"gitSession",
":=",
"false",
"\n\n",
"c",
",",
"err",
":=",
"client",
".",
"New",
"(",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
... | // AppDestroy destroys an app. | [
"AppDestroy",
"destroys",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L211-L258 |
142,920 | deis/deis | client/cmd/apps.go | AppTransfer | func AppTransfer(appID, username string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Transferring %s to %s... ", appID, username)
err = apps.Transfer(c, appID, username)
if err != nil {
return err
}
fmt.Println("done")
return nil
} | go | func AppTransfer(appID, username string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Transferring %s to %s... ", appID, username)
err = apps.Transfer(c, appID, username)
if err != nil {
return err
}
fmt.Println("done")
return nil
} | [
"func",
"AppTransfer",
"(",
"appID",
",",
"username",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"fmt",
".",
"Printf",
"(",... | // AppTransfer transfers app ownership to another user. | [
"AppTransfer",
"transfers",
"app",
"ownership",
"to",
"another",
"user",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/apps.go#L261-L279 |
142,921 | deis/deis | client/controller/models/users/users.go | List | func List(c *client.Client, results int) (api.Users, int, error) {
body, count, err := c.LimitedRequest("/v1/users/", results)
if err != nil {
return []api.User{}, -1, err
}
var users []api.User
if err = json.Unmarshal([]byte(body), &users); err != nil {
return []api.User{}, -1, err
}
return users, count,... | go | func List(c *client.Client, results int) (api.Users, int, error) {
body, count, err := c.LimitedRequest("/v1/users/", results)
if err != nil {
return []api.User{}, -1, err
}
var users []api.User
if err = json.Unmarshal([]byte(body), &users); err != nil {
return []api.User{}, -1, err
}
return users, count,... | [
"func",
"List",
"(",
"c",
"*",
"client",
".",
"Client",
",",
"results",
"int",
")",
"(",
"api",
".",
"Users",
",",
"int",
",",
"error",
")",
"{",
"body",
",",
"count",
",",
"err",
":=",
"c",
".",
"LimitedRequest",
"(",
"\"",
"\"",
",",
"results",... | // List users registered with the controller. | [
"List",
"users",
"registered",
"with",
"the",
"controller",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/users/users.go#L11-L24 |
142,922 | deis/deis | client/parser/apps.go | Apps | func Apps(argv []string) error {
usage := `
Valid commands for apps:
apps:create create a new application
apps:list list accessible applications
apps:info view info about an application
apps:open open the application in a browser
apps:logs view aggregated application logs
ap... | go | func Apps(argv []string) error {
usage := `
Valid commands for apps:
apps:create create a new application
apps:list list accessible applications
apps:info view info about an application
apps:open open the application in a browser
apps:logs view aggregated application logs
ap... | [
"func",
"Apps",
"(",
"argv",
"[",
"]",
"string",
")",
"error",
"{",
"usage",
":=",
"`\nValid commands for apps:\n\napps:create create a new application\napps:list list accessible applications\napps:info view info about an application\napps:open open the appl... | // Apps routes app commands to their specific function. | [
"Apps",
"routes",
"app",
"commands",
"to",
"their",
"specific",
"function",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/apps.go#L12-L58 |
142,923 | deis/deis | client/controller/client/http.go | CreateHTTPClient | func CreateHTTPClient(sslVerify bool) *http.Client {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: !sslVerify},
DisableKeepAlives: true,
}
return &http.Client{Transport: tr}
} | go | func CreateHTTPClient(sslVerify bool) *http.Client {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: !sslVerify},
DisableKeepAlives: true,
}
return &http.Client{Transport: tr}
} | [
"func",
"CreateHTTPClient",
"(",
"sslVerify",
"bool",
")",
"*",
"http",
".",
"Client",
"{",
"tr",
":=",
"&",
"http",
".",
"Transport",
"{",
"TLSClientConfig",
":",
"&",
"tls",
".",
"Config",
"{",
"InsecureSkipVerify",
":",
"!",
"sslVerify",
"}",
",",
"Di... | // CreateHTTPClient creates a HTTP Client with proper SSL options. | [
"CreateHTTPClient",
"creates",
"a",
"HTTP",
"Client",
"with",
"proper",
"SSL",
"options",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/client/http.go#L20-L26 |
142,924 | deis/deis | client/controller/client/http.go | Request | func (c Client) Request(method string, path string, body []byte) (*http.Response, error) {
url := c.ControllerURL
if strings.Contains(path, "?") {
parts := strings.Split(path, "?")
url.Path = parts[0]
url.RawQuery = parts[1]
} else {
url.Path = path
}
req, err := http.NewRequest(method, url.String(), byt... | go | func (c Client) Request(method string, path string, body []byte) (*http.Response, error) {
url := c.ControllerURL
if strings.Contains(path, "?") {
parts := strings.Split(path, "?")
url.Path = parts[0]
url.RawQuery = parts[1]
} else {
url.Path = path
}
req, err := http.NewRequest(method, url.String(), byt... | [
"func",
"(",
"c",
"Client",
")",
"Request",
"(",
"method",
"string",
",",
"path",
"string",
",",
"body",
"[",
"]",
"byte",
")",
"(",
"*",
"http",
".",
"Response",
",",
"error",
")",
"{",
"url",
":=",
"c",
".",
"ControllerURL",
"\n\n",
"if",
"string... | // Request makes a HTTP request on the controller. | [
"Request",
"makes",
"a",
"HTTP",
"request",
"on",
"the",
"controller",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/client/http.go#L29-L67 |
142,925 | deis/deis | client/controller/client/http.go | BasicRequest | func (c Client) BasicRequest(method string, path string, body []byte) (string, error) {
res, err := c.Request(method, path, body)
if err != nil {
return "", err
}
defer res.Body.Close()
resBody, err := ioutil.ReadAll(res.Body)
if err != nil {
return "", err
}
return string(resBody), checkForErrors(res, s... | go | func (c Client) BasicRequest(method string, path string, body []byte) (string, error) {
res, err := c.Request(method, path, body)
if err != nil {
return "", err
}
defer res.Body.Close()
resBody, err := ioutil.ReadAll(res.Body)
if err != nil {
return "", err
}
return string(resBody), checkForErrors(res, s... | [
"func",
"(",
"c",
"Client",
")",
"BasicRequest",
"(",
"method",
"string",
",",
"path",
"string",
",",
"body",
"[",
"]",
"byte",
")",
"(",
"string",
",",
"error",
")",
"{",
"res",
",",
"err",
":=",
"c",
".",
"Request",
"(",
"method",
",",
"path",
... | // BasicRequest makes a simple http request on the controller. | [
"BasicRequest",
"makes",
"a",
"simple",
"http",
"request",
"on",
"the",
"controller",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/client/http.go#L92-L106 |
142,926 | deis/deis | logger/drain/factory.go | NewDrain | func NewDrain(drainURL string) (LogDrain, error) {
if drainURL == "" {
// nil means no drain-- which is valid
return nil, nil
}
// Any of these three can use the same drain implementation
if strings.HasPrefix(drainURL, "udp://") || strings.HasPrefix(drainURL, "syslog://") || strings.HasPrefix(drainURL, "tcp://"... | go | func NewDrain(drainURL string) (LogDrain, error) {
if drainURL == "" {
// nil means no drain-- which is valid
return nil, nil
}
// Any of these three can use the same drain implementation
if strings.HasPrefix(drainURL, "udp://") || strings.HasPrefix(drainURL, "syslog://") || strings.HasPrefix(drainURL, "tcp://"... | [
"func",
"NewDrain",
"(",
"drainURL",
"string",
")",
"(",
"LogDrain",
",",
"error",
")",
"{",
"if",
"drainURL",
"==",
"\"",
"\"",
"{",
"// nil means no drain-- which is valid",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n",
"// Any of these three can use the same dr... | // NewDrain returns a pointer to an appropriate implementation of the LogDrain interface, as
// determined by the drainURL it is passed. | [
"NewDrain",
"returns",
"a",
"pointer",
"to",
"an",
"appropriate",
"implementation",
"of",
"the",
"LogDrain",
"interface",
"as",
"determined",
"by",
"the",
"drainURL",
"it",
"is",
"passed",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/drain/factory.go#L12-L27 |
142,927 | deis/deis | logger/configurer/configurer.go | NewConfigurer | func NewConfigurer(etcdHost string, etcdPort int, etcdPath string, configInterval int,
syslogishServer *syslogish.Server) (*Configurer, error) {
etcdClient := etcd.NewClient([]string{fmt.Sprintf("http://%s:%d", etcdHost, etcdPort)})
ticker := time.NewTicker(time.Duration(configInterval) * time.Second)
configurer :=... | go | func NewConfigurer(etcdHost string, etcdPort int, etcdPath string, configInterval int,
syslogishServer *syslogish.Server) (*Configurer, error) {
etcdClient := etcd.NewClient([]string{fmt.Sprintf("http://%s:%d", etcdHost, etcdPort)})
ticker := time.NewTicker(time.Duration(configInterval) * time.Second)
configurer :=... | [
"func",
"NewConfigurer",
"(",
"etcdHost",
"string",
",",
"etcdPort",
"int",
",",
"etcdPath",
"string",
",",
"configInterval",
"int",
",",
"syslogishServer",
"*",
"syslogish",
".",
"Server",
")",
"(",
"*",
"Configurer",
",",
"error",
")",
"{",
"etcdClient",
"... | // NewConfigurer returns a pointer to a new Configurer instance. | [
"NewConfigurer",
"returns",
"a",
"pointer",
"to",
"a",
"new",
"Configurer",
"instance",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/configurer/configurer.go#L30-L53 |
142,928 | deis/deis | logger/configurer/configurer.go | Start | func (c *Configurer) Start() {
// Should only ever be called once
if !c.running {
c.running = true
go c.configure()
log.Println("configurer running")
}
} | go | func (c *Configurer) Start() {
// Should only ever be called once
if !c.running {
c.running = true
go c.configure()
log.Println("configurer running")
}
} | [
"func",
"(",
"c",
"*",
"Configurer",
")",
"Start",
"(",
")",
"{",
"// Should only ever be called once",
"if",
"!",
"c",
".",
"running",
"{",
"c",
".",
"running",
"=",
"true",
"\n",
"go",
"c",
".",
"configure",
"(",
")",
"\n",
"log",
".",
"Println",
"... | // Start begins the configurer's main loop. | [
"Start",
"begins",
"the",
"configurer",
"s",
"main",
"loop",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/configurer/configurer.go#L56-L63 |
142,929 | deis/deis | client/parser/domains.go | Domains | func Domains(argv []string) error {
usage := `
Valid commands for domains:
domains:add bind a domain to an application
domains:list list domains bound to an application
domains:remove unbind a domain from an application
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case "dom... | go | func Domains(argv []string) error {
usage := `
Valid commands for domains:
domains:add bind a domain to an application
domains:list list domains bound to an application
domains:remove unbind a domain from an application
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case "dom... | [
"func",
"Domains",
"(",
"argv",
"[",
"]",
"string",
")",
"error",
"{",
"usage",
":=",
"`\nValid commands for domains:\n\ndomains:add bind a domain to an application\ndomains:list list domains bound to an application\ndomains:remove unbind a domain from an applicatio... | // Domains routes domain commands to their specific function. | [
"Domains",
"routes",
"domain",
"commands",
"to",
"their",
"specific",
"function",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/domains.go#L9-L39 |
142,930 | deis/deis | client/controller/client/client.go | New | func New() (*Client, error) {
filename := locateSettingsFile()
if _, err := os.Stat(filename); err != nil {
if os.IsNotExist(err) {
return nil, errors.New("Not logged in. Use 'deis login' or 'deis register' to get started.")
}
return nil, err
}
contents, err := ioutil.ReadFile(filename)
if err != nil {... | go | func New() (*Client, error) {
filename := locateSettingsFile()
if _, err := os.Stat(filename); err != nil {
if os.IsNotExist(err) {
return nil, errors.New("Not logged in. Use 'deis login' or 'deis register' to get started.")
}
return nil, err
}
contents, err := ioutil.ReadFile(filename)
if err != nil {... | [
"func",
"New",
"(",
")",
"(",
"*",
"Client",
",",
"error",
")",
"{",
"filename",
":=",
"locateSettingsFile",
"(",
")",
"\n\n",
"if",
"_",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"filename",
")",
";",
"err",
"!=",
"nil",
"{",
"if",
"os",
".",
... | // New creates a new client from a settings file. | [
"New",
"creates",
"a",
"new",
"client",
"from",
"a",
"settings",
"file",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/client/client.go#L47-L80 |
142,931 | deis/deis | client/controller/client/client.go | Save | func (c Client) Save() error {
settings := settingsFile{Username: c.Username, SslVerify: c.SSLVerify,
Controller: c.ControllerURL.String(), Token: c.Token, Limit: c.ResponseLimit}
if settings.Limit <= 0 {
settings.Limit = DefaultResponseLimit
}
settingsContents, err := json.Marshal(settings)
if err != nil {... | go | func (c Client) Save() error {
settings := settingsFile{Username: c.Username, SslVerify: c.SSLVerify,
Controller: c.ControllerURL.String(), Token: c.Token, Limit: c.ResponseLimit}
if settings.Limit <= 0 {
settings.Limit = DefaultResponseLimit
}
settingsContents, err := json.Marshal(settings)
if err != nil {... | [
"func",
"(",
"c",
"Client",
")",
"Save",
"(",
")",
"error",
"{",
"settings",
":=",
"settingsFile",
"{",
"Username",
":",
"c",
".",
"Username",
",",
"SslVerify",
":",
"c",
".",
"SSLVerify",
",",
"Controller",
":",
"c",
".",
"ControllerURL",
".",
"String... | // Save settings to a file | [
"Save",
"settings",
"to",
"a",
"file"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/client/client.go#L83-L102 |
142,932 | deis/deis | client/controller/client/client.go | Delete | func Delete() error {
filename := locateSettingsFile()
if _, err := os.Stat(filename); err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
if err := os.Remove(filename); err != nil {
return err
}
return nil
} | go | func Delete() error {
filename := locateSettingsFile()
if _, err := os.Stat(filename); err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
if err := os.Remove(filename); err != nil {
return err
}
return nil
} | [
"func",
"Delete",
"(",
")",
"error",
"{",
"filename",
":=",
"locateSettingsFile",
"(",
")",
"\n\n",
"if",
"_",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"filename",
")",
";",
"err",
"!=",
"nil",
"{",
"if",
"os",
".",
"IsNotExist",
"(",
"err",
")",
... | // Delete user's settings file. | [
"Delete",
"user",
"s",
"settings",
"file",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/client/client.go#L105-L121 |
142,933 | deis/deis | client/controller/models/certs/certs.go | New | func New(c *client.Client, cert string, key string, commonName string) (api.Cert, error) {
req := api.CertCreateRequest{Certificate: cert, Key: key, Name: commonName}
reqBody, err := json.Marshal(req)
if err != nil {
return api.Cert{}, err
}
resBody, err := c.BasicRequest("POST", "/v1/certs/", reqBody)
if er... | go | func New(c *client.Client, cert string, key string, commonName string) (api.Cert, error) {
req := api.CertCreateRequest{Certificate: cert, Key: key, Name: commonName}
reqBody, err := json.Marshal(req)
if err != nil {
return api.Cert{}, err
}
resBody, err := c.BasicRequest("POST", "/v1/certs/", reqBody)
if er... | [
"func",
"New",
"(",
"c",
"*",
"client",
".",
"Client",
",",
"cert",
"string",
",",
"key",
"string",
",",
"commonName",
"string",
")",
"(",
"api",
".",
"Cert",
",",
"error",
")",
"{",
"req",
":=",
"api",
".",
"CertCreateRequest",
"{",
"Certificate",
"... | // New creates a new cert. | [
"New",
"creates",
"a",
"new",
"cert",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/certs/certs.go#L28-L48 |
142,934 | deis/deis | client/controller/models/certs/certs.go | Delete | func Delete(c *client.Client, commonName string) error {
u := fmt.Sprintf("/v1/certs/%s", commonName)
_, err := c.BasicRequest("DELETE", u, nil)
return err
} | go | func Delete(c *client.Client, commonName string) error {
u := fmt.Sprintf("/v1/certs/%s", commonName)
_, err := c.BasicRequest("DELETE", u, nil)
return err
} | [
"func",
"Delete",
"(",
"c",
"*",
"client",
".",
"Client",
",",
"commonName",
"string",
")",
"error",
"{",
"u",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"commonName",
")",
"\n\n",
"_",
",",
"err",
":=",
"c",
".",
"BasicRequest",
"(",
"\"",... | // Delete removes a cert. | [
"Delete",
"removes",
"a",
"cert",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/certs/certs.go#L51-L56 |
142,935 | deis/deis | client/cmd/domains.go | DomainsList | func DomainsList(appID string, results int) error {
c, appID, err := load(appID)
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
domains, count, err := domains.List(c, appID, results)
if err != nil {
return err
}
fmt.Printf("=== %s Domains%s", appID, limitCount(... | go | func DomainsList(appID string, results int) error {
c, appID, err := load(appID)
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
domains, count, err := domains.List(c, appID, results)
if err != nil {
return err
}
fmt.Printf("=== %s Domains%s", appID, limitCount(... | [
"func",
"DomainsList",
"(",
"appID",
"string",
",",
"results",
"int",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"results",
"==... | // DomainsList lists domains registered with an app. | [
"DomainsList",
"lists",
"domains",
"registered",
"with",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/domains.go#L11-L36 |
142,936 | deis/deis | client/cmd/domains.go | DomainsAdd | func DomainsAdd(appID, domain string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Adding %s to %s... ", domain, appID)
quit := progress()
_, err = domains.New(c, appID, domain)
quit <- true
<-quit
if err != nil {
return err
}
fmt.Println("done")
return nil
} | go | func DomainsAdd(appID, domain string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Adding %s to %s... ", domain, appID)
quit := progress()
_, err = domains.New(c, appID, domain)
quit <- true
<-quit
if err != nil {
return err
}
fmt.Println("done")
return nil
} | [
"func",
"DomainsAdd",
"(",
"appID",
",",
"domain",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"fmt",
".",
"Printf",
"(",
... | // DomainsAdd adds a domain to an app. | [
"DomainsAdd",
"adds",
"a",
"domain",
"to",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/domains.go#L39-L59 |
142,937 | deis/deis | client/cmd/domains.go | DomainsRemove | func DomainsRemove(appID, domain string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Removing %s from %s... ", domain, appID)
quit := progress()
err = domains.Delete(c, appID, domain)
quit <- true
<-quit
if err != nil {
return err
}
fmt.Println("done")
return nil
} | go | func DomainsRemove(appID, domain string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Printf("Removing %s from %s... ", domain, appID)
quit := progress()
err = domains.Delete(c, appID, domain)
quit <- true
<-quit
if err != nil {
return err
}
fmt.Println("done")
return nil
} | [
"func",
"DomainsRemove",
"(",
"appID",
",",
"domain",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"fmt",
".",
"Printf",
"(",... | // DomainsRemove removes a domain registered with an app. | [
"DomainsRemove",
"removes",
"a",
"domain",
"registered",
"with",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/domains.go#L62-L82 |
142,938 | deis/deis | client/parser/auth.go | Auth | func Auth(argv []string) error {
usage := `
Valid commands for auth:
auth:register register a new user
auth:login authenticate against a controller
auth:logout clear the current user session
auth:passwd change the password for the current user
auth:whoami display ... | go | func Auth(argv []string) error {
usage := `
Valid commands for auth:
auth:register register a new user
auth:login authenticate against a controller
auth:logout clear the current user session
auth:passwd change the password for the current user
auth:whoami display ... | [
"func",
"Auth",
"(",
"argv",
"[",
"]",
"string",
")",
"error",
"{",
"usage",
":=",
"`\nValid commands for auth:\n\nauth:register register a new user\nauth:login authenticate against a controller\nauth:logout clear the current user session\nauth:passwd ... | // Auth routes auth commands to the specific function. | [
"Auth",
"routes",
"auth",
"commands",
"to",
"the",
"specific",
"function",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/auth.go#L11-L48 |
142,939 | deis/deis | client/controller/models/builds/builds.go | New | func New(c *client.Client, appID string, image string,
procfile map[string]string) (api.Build, error) {
u := fmt.Sprintf("/v1/apps/%s/builds/", appID)
req := api.CreateBuildRequest{Image: image, Procfile: procfile}
body, err := json.Marshal(req)
if err != nil {
return api.Build{}, err
}
resBody, err := c.... | go | func New(c *client.Client, appID string, image string,
procfile map[string]string) (api.Build, error) {
u := fmt.Sprintf("/v1/apps/%s/builds/", appID)
req := api.CreateBuildRequest{Image: image, Procfile: procfile}
body, err := json.Marshal(req)
if err != nil {
return api.Build{}, err
}
resBody, err := c.... | [
"func",
"New",
"(",
"c",
"*",
"client",
".",
"Client",
",",
"appID",
"string",
",",
"image",
"string",
",",
"procfile",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"api",
".",
"Build",
",",
"error",
")",
"{",
"u",
":=",
"fmt",
".",
"Sprintf",
... | // New creates a build for an app. | [
"New",
"creates",
"a",
"build",
"for",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/builds/builds.go#L29-L54 |
142,940 | deis/deis | builder/utils.go | YamlToJSON | func YamlToJSON(bytes []byte) (string, error) {
var anomaly map[string]string
if err := yaml.Unmarshal(bytes, &anomaly); err != nil {
return "", err
}
retVal, err := json.Marshal(&anomaly)
if err != nil {
return "", err
}
return string(retVal), nil
} | go | func YamlToJSON(bytes []byte) (string, error) {
var anomaly map[string]string
if err := yaml.Unmarshal(bytes, &anomaly); err != nil {
return "", err
}
retVal, err := json.Marshal(&anomaly)
if err != nil {
return "", err
}
return string(retVal), nil
} | [
"func",
"YamlToJSON",
"(",
"bytes",
"[",
"]",
"byte",
")",
"(",
"string",
",",
"error",
")",
"{",
"var",
"anomaly",
"map",
"[",
"string",
"]",
"string",
"\n\n",
"if",
"err",
":=",
"yaml",
".",
"Unmarshal",
"(",
"bytes",
",",
"&",
"anomaly",
")",
";... | // YamlToJSON takes an input yaml string, parses it and returns a string formatted as json. | [
"YamlToJSON",
"takes",
"an",
"input",
"yaml",
"string",
"parses",
"it",
"and",
"returns",
"a",
"string",
"formatted",
"as",
"json",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/utils.go#L11-L25 |
142,941 | deis/deis | builder/utils.go | ParseConfig | func ParseConfig(body []byte) (*Config, error) {
var config Config
err := json.Unmarshal(body, &config)
return &config, err
} | go | func ParseConfig(body []byte) (*Config, error) {
var config Config
err := json.Unmarshal(body, &config)
return &config, err
} | [
"func",
"ParseConfig",
"(",
"body",
"[",
"]",
"byte",
")",
"(",
"*",
"Config",
",",
"error",
")",
"{",
"var",
"config",
"Config",
"\n",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"body",
",",
"&",
"config",
")",
"\n",
"return",
"&",
"config",
",",... | // ParseConfig takes a response body from the controller and returns a Config object. | [
"ParseConfig",
"takes",
"a",
"response",
"body",
"from",
"the",
"controller",
"and",
"returns",
"a",
"Config",
"object",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/utils.go#L28-L32 |
142,942 | deis/deis | builder/utils.go | ParseDomain | func ParseDomain(bytes []byte) (string, error) {
var hook BuildHookResponse
if err := json.Unmarshal(bytes, &hook); err != nil {
return "", err
}
if hook.Domains == nil {
return "", fmt.Errorf("invalid application domain")
}
if len(hook.Domains) < 1 {
return "", fmt.Errorf("invalid application domain")
}... | go | func ParseDomain(bytes []byte) (string, error) {
var hook BuildHookResponse
if err := json.Unmarshal(bytes, &hook); err != nil {
return "", err
}
if hook.Domains == nil {
return "", fmt.Errorf("invalid application domain")
}
if len(hook.Domains) < 1 {
return "", fmt.Errorf("invalid application domain")
}... | [
"func",
"ParseDomain",
"(",
"bytes",
"[",
"]",
"byte",
")",
"(",
"string",
",",
"error",
")",
"{",
"var",
"hook",
"BuildHookResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"bytes",
",",
"&",
"hook",
")",
";",
"err",
"!=",
"nil",
... | // ParseDomain returns the domain field from the bytes of a build hook response. | [
"ParseDomain",
"returns",
"the",
"domain",
"field",
"from",
"the",
"bytes",
"of",
"a",
"build",
"hook",
"response",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/utils.go#L35-L50 |
142,943 | deis/deis | builder/utils.go | ParseReleaseVersion | func ParseReleaseVersion(bytes []byte) (int, error) {
var hook BuildHookResponse
if err := json.Unmarshal(bytes, &hook); err != nil {
return 0, fmt.Errorf("invalid application json configuration")
}
if hook.Release == nil {
return 0, fmt.Errorf("invalid application version")
}
return hook.Release["version"]... | go | func ParseReleaseVersion(bytes []byte) (int, error) {
var hook BuildHookResponse
if err := json.Unmarshal(bytes, &hook); err != nil {
return 0, fmt.Errorf("invalid application json configuration")
}
if hook.Release == nil {
return 0, fmt.Errorf("invalid application version")
}
return hook.Release["version"]... | [
"func",
"ParseReleaseVersion",
"(",
"bytes",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"var",
"hook",
"BuildHookResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"bytes",
",",
"&",
"hook",
")",
";",
"err",
"!=",
"nil... | // ParseReleaseVersion returns the version field from the bytes of a build hook response. | [
"ParseReleaseVersion",
"returns",
"the",
"version",
"field",
"from",
"the",
"bytes",
"of",
"a",
"build",
"hook",
"response",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/utils.go#L53-L64 |
142,944 | deis/deis | builder/utils.go | GetDefaultType | func GetDefaultType(bytes []byte) (string, error) {
type YamlTypeMap struct {
DefaultProcessTypes ProcessType `yaml:"default_process_types"`
}
var p YamlTypeMap
if err := yaml.Unmarshal(bytes, &p); err != nil {
return "", err
}
retVal, err := json.Marshal(&p.DefaultProcessTypes)
if err != nil {
return ... | go | func GetDefaultType(bytes []byte) (string, error) {
type YamlTypeMap struct {
DefaultProcessTypes ProcessType `yaml:"default_process_types"`
}
var p YamlTypeMap
if err := yaml.Unmarshal(bytes, &p); err != nil {
return "", err
}
retVal, err := json.Marshal(&p.DefaultProcessTypes)
if err != nil {
return ... | [
"func",
"GetDefaultType",
"(",
"bytes",
"[",
"]",
"byte",
")",
"(",
"string",
",",
"error",
")",
"{",
"type",
"YamlTypeMap",
"struct",
"{",
"DefaultProcessTypes",
"ProcessType",
"`yaml:\"default_process_types\"`",
"\n",
"}",
"\n\n",
"var",
"p",
"YamlTypeMap",
"\... | // GetDefaultType returns the default process types given a YAML byte array. | [
"GetDefaultType",
"returns",
"the",
"default",
"process",
"types",
"given",
"a",
"YAML",
"byte",
"array",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/utils.go#L67-L89 |
142,945 | deis/deis | client/parser/git.go | Git | func Git(argv []string) error {
usage := `
Valid commands for git:
git:remote Adds git remote of application to repository
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case "git:remote":
return gitRemote(argv)
case "git":
fmt.Print(usage)
return nil
default:
PrintUsage()
return... | go | func Git(argv []string) error {
usage := `
Valid commands for git:
git:remote Adds git remote of application to repository
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case "git:remote":
return gitRemote(argv)
case "git":
fmt.Print(usage)
return nil
default:
PrintUsage()
return... | [
"func",
"Git",
"(",
"argv",
"[",
"]",
"string",
")",
"error",
"{",
"usage",
":=",
"`\nValid commands for git:\n\ngit:remote Adds git remote of application to repository\n\nUse 'deis help [command]' to learn more.\n`",
"\n\n",
"switch",
"argv",
"[",
"0",
"]",
"{",
"ca... | // Git routes git commands to their specific function. | [
"Git",
"routes",
"git",
"commands",
"to",
"their",
"specific",
"function",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/git.go#L11-L30 |
142,946 | deis/deis | builder/sshd/sshd.go | compareKeys | func compareKeys(a, b ssh.PublicKey) bool {
if a.Type() != b.Type() {
return false
}
// The best way to compare just the key seems to be to marshal both and
// then compare the output byte sequence.
return subtle.ConstantTimeCompare(a.Marshal(), b.Marshal()) == 1
} | go | func compareKeys(a, b ssh.PublicKey) bool {
if a.Type() != b.Type() {
return false
}
// The best way to compare just the key seems to be to marshal both and
// then compare the output byte sequence.
return subtle.ConstantTimeCompare(a.Marshal(), b.Marshal()) == 1
} | [
"func",
"compareKeys",
"(",
"a",
",",
"b",
"ssh",
".",
"PublicKey",
")",
"bool",
"{",
"if",
"a",
".",
"Type",
"(",
")",
"!=",
"b",
".",
"Type",
"(",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"// The best way to compare just the key seems to be to marsh... | // compareKeys compares to key files and returns true of they match. | [
"compareKeys",
"compares",
"to",
"key",
"files",
"and",
"returns",
"true",
"of",
"they",
"match",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/sshd/sshd.go#L145-L152 |
142,947 | deis/deis | builder/sshd/sshd.go | Fingerprint | func Fingerprint(key ssh.PublicKey) string {
hash := md5.Sum(key.Marshal())
buf := make([]byte, hex.EncodedLen(len(hash)))
hex.Encode(buf, hash[:])
// We need this in colon notation:
fp := make([]byte, len(buf)+15)
i, j := 0, 0
for ; i < len(buf); i++ {
if i > 0 && i%2 == 0 {
fp[j] = ':'
j++
}
fp[j]... | go | func Fingerprint(key ssh.PublicKey) string {
hash := md5.Sum(key.Marshal())
buf := make([]byte, hex.EncodedLen(len(hash)))
hex.Encode(buf, hash[:])
// We need this in colon notation:
fp := make([]byte, len(buf)+15)
i, j := 0, 0
for ; i < len(buf); i++ {
if i > 0 && i%2 == 0 {
fp[j] = ':'
j++
}
fp[j]... | [
"func",
"Fingerprint",
"(",
"key",
"ssh",
".",
"PublicKey",
")",
"string",
"{",
"hash",
":=",
"md5",
".",
"Sum",
"(",
"key",
".",
"Marshal",
"(",
")",
")",
"\n",
"buf",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"hex",
".",
"EncodedLen",
"(",
"len... | // Fingerprint generates a colon-separated fingerprint string from a public key. | [
"Fingerprint",
"generates",
"a",
"colon",
"-",
"separated",
"fingerprint",
"string",
"from",
"a",
"public",
"key",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/sshd/sshd.go#L210-L228 |
142,948 | deis/deis | client/cmd/config.go | ConfigList | func ConfigList(appID string, oneLine bool) error {
c, appID, err := load(appID)
if err != nil {
return err
}
config, err := config.List(c, appID)
if err != nil {
return err
}
var keys []string
for k := range config.Values {
keys = append(keys, k)
}
sort.Strings(keys)
if oneLine {
for _, key := ... | go | func ConfigList(appID string, oneLine bool) error {
c, appID, err := load(appID)
if err != nil {
return err
}
config, err := config.List(c, appID)
if err != nil {
return err
}
var keys []string
for k := range config.Values {
keys = append(keys, k)
}
sort.Strings(keys)
if oneLine {
for _, key := ... | [
"func",
"ConfigList",
"(",
"appID",
"string",
",",
"oneLine",
"bool",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"config",
",",
"err"... | // ConfigList lists an app's config. | [
"ConfigList",
"lists",
"an",
"app",
"s",
"config",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/config.go#L19-L57 |
142,949 | deis/deis | client/cmd/config.go | ConfigSet | func ConfigSet(appID string, configVars []string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
configMap := parseConfig(configVars)
value, ok := configMap["SSH_KEY"]
if ok {
sshKey := value.(string)
if _, err := os.Stat(value.(string)); err == nil {
contents, err := ioutil.ReadF... | go | func ConfigSet(appID string, configVars []string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
configMap := parseConfig(configVars)
value, ok := configMap["SSH_KEY"]
if ok {
sshKey := value.(string)
if _, err := os.Stat(value.(string)); err == nil {
contents, err := ioutil.ReadF... | [
"func",
"ConfigSet",
"(",
"appID",
"string",
",",
"configVars",
"[",
"]",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"confi... | // ConfigSet sets an app's config variables. | [
"ConfigSet",
"sets",
"an",
"app",
"s",
"config",
"variables",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/config.go#L60-L113 |
142,950 | deis/deis | client/cmd/config.go | ConfigUnset | func ConfigUnset(appID string, configVars []string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Print("Removing config... ")
quit := progress()
configObj := api.Config{}
valuesMap := make(map[string]interface{})
for _, configVar := range configVars {
valuesMap[configVar] = ni... | go | func ConfigUnset(appID string, configVars []string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
fmt.Print("Removing config... ")
quit := progress()
configObj := api.Config{}
valuesMap := make(map[string]interface{})
for _, configVar := range configVars {
valuesMap[configVar] = ni... | [
"func",
"ConfigUnset",
"(",
"appID",
"string",
",",
"configVars",
"[",
"]",
"string",
")",
"error",
"{",
"c",
",",
"appID",
",",
"err",
":=",
"load",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"fmt... | // ConfigUnset removes a config variable from an app. | [
"ConfigUnset",
"removes",
"a",
"config",
"variable",
"from",
"an",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/config.go#L116-L149 |
142,951 | deis/deis | client/cmd/config.go | ConfigPull | func ConfigPull(appID string, interactive bool, overwrite bool) error {
filename := ".env"
if !overwrite {
if _, err := os.Stat(filename); err == nil {
return fmt.Errorf("%s already exists, pass -o to overwrite", filename)
}
}
c, appID, err := load(appID)
if err != nil {
return err
}
configVars, err... | go | func ConfigPull(appID string, interactive bool, overwrite bool) error {
filename := ".env"
if !overwrite {
if _, err := os.Stat(filename); err == nil {
return fmt.Errorf("%s already exists, pass -o to overwrite", filename)
}
}
c, appID, err := load(appID)
if err != nil {
return err
}
configVars, err... | [
"func",
"ConfigPull",
"(",
"appID",
"string",
",",
"interactive",
"bool",
",",
"overwrite",
"bool",
")",
"error",
"{",
"filename",
":=",
"\"",
"\"",
"\n\n",
"if",
"!",
"overwrite",
"{",
"if",
"_",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"filename",
... | // ConfigPull pulls an app's config to a file. | [
"ConfigPull",
"pulls",
"an",
"app",
"s",
"config",
"to",
"a",
"file",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/config.go#L152-L202 |
142,952 | deis/deis | client/cmd/config.go | ConfigPush | func ConfigPush(appID string, fileName string) error {
contents, err := ioutil.ReadFile(fileName)
if err != nil {
return err
}
config := strings.Split(string(contents), "\n")
return ConfigSet(appID, config[:len(config)-1])
} | go | func ConfigPush(appID string, fileName string) error {
contents, err := ioutil.ReadFile(fileName)
if err != nil {
return err
}
config := strings.Split(string(contents), "\n")
return ConfigSet(appID, config[:len(config)-1])
} | [
"func",
"ConfigPush",
"(",
"appID",
"string",
",",
"fileName",
"string",
")",
"error",
"{",
"contents",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"fileName",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"confi... | // ConfigPush pushes an app's config from a file. | [
"ConfigPush",
"pushes",
"an",
"app",
"s",
"config",
"from",
"a",
"file",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/config.go#L205-L214 |
142,953 | deis/deis | deisctl/backend/fleet/stop.go | Stop | func (c *FleetClient) Stop(targets []string, wg *sync.WaitGroup, out, ew io.Writer) {
// expand @* targets
expandedTargets, err := c.expandTargets(targets)
if err != nil {
fmt.Fprintln(ew, err.Error())
return
}
for _, target := range expandedTargets {
wg.Add(1)
go doStop(c, target, wg, out, ew)
}
return... | go | func (c *FleetClient) Stop(targets []string, wg *sync.WaitGroup, out, ew io.Writer) {
// expand @* targets
expandedTargets, err := c.expandTargets(targets)
if err != nil {
fmt.Fprintln(ew, err.Error())
return
}
for _, target := range expandedTargets {
wg.Add(1)
go doStop(c, target, wg, out, ew)
}
return... | [
"func",
"(",
"c",
"*",
"FleetClient",
")",
"Stop",
"(",
"targets",
"[",
"]",
"string",
",",
"wg",
"*",
"sync",
".",
"WaitGroup",
",",
"out",
",",
"ew",
"io",
".",
"Writer",
")",
"{",
"// expand @* targets",
"expandedTargets",
",",
"err",
":=",
"c",
"... | // Stop units and wait for their desiredState | [
"Stop",
"units",
"and",
"wait",
"for",
"their",
"desiredState"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/stop.go#L16-L29 |
142,954 | deis/deis | builder/etcd/etcd.go | genSSHKeys | func genSSHKeys(c cookoo.Context) error {
// Generate a new key
out, err := exec.Command("ssh-keygen", "-A").CombinedOutput()
if err != nil {
log.Infof(c, "ssh-keygen: %s", out)
log.Errf(c, "Failed to generate SSH keys: %s", err)
return err
}
return nil
} | go | func genSSHKeys(c cookoo.Context) error {
// Generate a new key
out, err := exec.Command("ssh-keygen", "-A").CombinedOutput()
if err != nil {
log.Infof(c, "ssh-keygen: %s", out)
log.Errf(c, "Failed to generate SSH keys: %s", err)
return err
}
return nil
} | [
"func",
"genSSHKeys",
"(",
"c",
"cookoo",
".",
"Context",
")",
"error",
"{",
"// Generate a new key",
"out",
",",
"err",
":=",
"exec",
".",
"Command",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
".",
"CombinedOutput",
"(",
")",
"\n",
"if",
"err",
"!=",
"n... | // genSshKeys generates the default set of SSH host keys. | [
"genSshKeys",
"generates",
"the",
"default",
"set",
"of",
"SSH",
"host",
"keys",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/etcd/etcd.go#L314-L323 |
142,955 | deis/deis | builder/etcd/etcd.go | checkRetry | func checkRetry(c *etcd.Cluster, numReqs int, last http.Response, err error) error {
if numReqs > retryCycles*len(c.Machines) {
return fmt.Errorf("Tried and failed %d cluster connections: %s", retryCycles, err)
}
switch last.StatusCode {
case 0:
return nil
case 500:
time.Sleep(retrySleep)
return nil
case... | go | func checkRetry(c *etcd.Cluster, numReqs int, last http.Response, err error) error {
if numReqs > retryCycles*len(c.Machines) {
return fmt.Errorf("Tried and failed %d cluster connections: %s", retryCycles, err)
}
switch last.StatusCode {
case 0:
return nil
case 500:
time.Sleep(retrySleep)
return nil
case... | [
"func",
"checkRetry",
"(",
"c",
"*",
"etcd",
".",
"Cluster",
",",
"numReqs",
"int",
",",
"last",
"http",
".",
"Response",
",",
"err",
"error",
")",
"error",
"{",
"if",
"numReqs",
">",
"retryCycles",
"*",
"len",
"(",
"c",
".",
"Machines",
")",
"{",
... | // checkRetry overrides etcd.DefaultCheckRetry.
//
// It adds configurable number of retries and configurable timesouts. | [
"checkRetry",
"overrides",
"etcd",
".",
"DefaultCheckRetry",
".",
"It",
"adds",
"configurable",
"number",
"of",
"retries",
"and",
"configurable",
"timesouts",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/etcd/etcd.go#L519-L535 |
142,956 | deis/deis | deisctl/backend/fleet/start.go | Start | func (c *FleetClient) Start(targets []string, wg *sync.WaitGroup, out, ew io.Writer) {
// expand @* targets
expandedTargets, err := c.expandTargets(targets)
if err != nil {
io.WriteString(ew, err.Error())
return
}
for _, target := range expandedTargets {
wg.Add(1)
go doStart(c, target, wg, out, ew)
}
re... | go | func (c *FleetClient) Start(targets []string, wg *sync.WaitGroup, out, ew io.Writer) {
// expand @* targets
expandedTargets, err := c.expandTargets(targets)
if err != nil {
io.WriteString(ew, err.Error())
return
}
for _, target := range expandedTargets {
wg.Add(1)
go doStart(c, target, wg, out, ew)
}
re... | [
"func",
"(",
"c",
"*",
"FleetClient",
")",
"Start",
"(",
"targets",
"[",
"]",
"string",
",",
"wg",
"*",
"sync",
".",
"WaitGroup",
",",
"out",
",",
"ew",
"io",
".",
"Writer",
")",
"{",
"// expand @* targets",
"expandedTargets",
",",
"err",
":=",
"c",
... | // Start units and wait for their desiredState | [
"Start",
"units",
"and",
"wait",
"for",
"their",
"desiredState"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/start.go#L14-L27 |
142,957 | deis/deis | deisctl/cmd/cmd.go | Scale | func Scale(targets []string, b backend.Backend) error {
var wg sync.WaitGroup
for _, target := range targets {
component, num, err := splitScaleTarget(target)
if err != nil {
return err
}
// the router, registry, and store-gateway are the only component that can scale at the moment
if !strings.Contains(... | go | func Scale(targets []string, b backend.Backend) error {
var wg sync.WaitGroup
for _, target := range targets {
component, num, err := splitScaleTarget(target)
if err != nil {
return err
}
// the router, registry, and store-gateway are the only component that can scale at the moment
if !strings.Contains(... | [
"func",
"Scale",
"(",
"targets",
"[",
"]",
"string",
",",
"b",
"backend",
".",
"Backend",
")",
"error",
"{",
"var",
"wg",
"sync",
".",
"WaitGroup",
"\n\n",
"for",
"_",
",",
"target",
":=",
"range",
"targets",
"{",
"component",
",",
"num",
",",
"err",... | // Scale grows or shrinks the number of running components.
// Currently "router", "registry" and "store-gateway" are the only types that can be scaled. | [
"Scale",
"grows",
"or",
"shrinks",
"the",
"number",
"of",
"running",
"components",
".",
"Currently",
"router",
"registry",
"and",
"store",
"-",
"gateway",
"are",
"the",
"only",
"types",
"that",
"can",
"be",
"scaled",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L56-L72 |
142,958 | deis/deis | deisctl/cmd/cmd.go | Start | func Start(targets []string, b backend.Backend) error {
// if target is platform, install all services
if len(targets) == 1 {
switch targets[0] {
case PlatformCommand:
return StartPlatform(b, false)
case StatelessPlatformCommand:
return StartPlatform(b, true)
}
}
var wg sync.WaitGroup
b.Start(targe... | go | func Start(targets []string, b backend.Backend) error {
// if target is platform, install all services
if len(targets) == 1 {
switch targets[0] {
case PlatformCommand:
return StartPlatform(b, false)
case StatelessPlatformCommand:
return StartPlatform(b, true)
}
}
var wg sync.WaitGroup
b.Start(targe... | [
"func",
"Start",
"(",
"targets",
"[",
"]",
"string",
",",
"b",
"backend",
".",
"Backend",
")",
"error",
"{",
"// if target is platform, install all services",
"if",
"len",
"(",
"targets",
")",
"==",
"1",
"{",
"switch",
"targets",
"[",
"0",
"]",
"{",
"case"... | // Start activates the specified components. | [
"Start",
"activates",
"the",
"specified",
"components",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L75-L92 |
142,959 | deis/deis | deisctl/cmd/cmd.go | RollingRestart | func RollingRestart(target string, b backend.Backend) error {
var wg sync.WaitGroup
b.RollingRestart(target, &wg, Stdout, Stderr)
wg.Wait()
return nil
} | go | func RollingRestart(target string, b backend.Backend) error {
var wg sync.WaitGroup
b.RollingRestart(target, &wg, Stdout, Stderr)
wg.Wait()
return nil
} | [
"func",
"RollingRestart",
"(",
"target",
"string",
",",
"b",
"backend",
".",
"Backend",
")",
"error",
"{",
"var",
"wg",
"sync",
".",
"WaitGroup",
"\n\n",
"b",
".",
"RollingRestart",
"(",
"target",
",",
"&",
"wg",
",",
"Stdout",
",",
"Stderr",
")",
"\n"... | // RollingRestart restart instance unit in a rolling manner | [
"RollingRestart",
"restart",
"instance",
"unit",
"in",
"a",
"rolling",
"manner"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L95-L102 |
142,960 | deis/deis | deisctl/cmd/cmd.go | CheckRequiredKeys | func CheckRequiredKeys(cb config.Backend) error {
if err := config.CheckConfig("/deis/platform/", "domain", cb); err != nil {
return fmt.Errorf(`Missing platform domain, use:
deisctl config platform set domain=<your-domain>`)
}
if err := config.CheckConfig("/deis/platform/", "sshPrivateKey", cb); err != nil {
f... | go | func CheckRequiredKeys(cb config.Backend) error {
if err := config.CheckConfig("/deis/platform/", "domain", cb); err != nil {
return fmt.Errorf(`Missing platform domain, use:
deisctl config platform set domain=<your-domain>`)
}
if err := config.CheckConfig("/deis/platform/", "sshPrivateKey", cb); err != nil {
f... | [
"func",
"CheckRequiredKeys",
"(",
"cb",
"config",
".",
"Backend",
")",
"error",
"{",
"if",
"err",
":=",
"config",
".",
"CheckConfig",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"cb",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(... | // CheckRequiredKeys exist in config backend | [
"CheckRequiredKeys",
"exist",
"in",
"config",
"backend"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L105-L117 |
142,961 | deis/deis | deisctl/cmd/cmd.go | Restart | func Restart(targets []string, b backend.Backend) error {
// act as if the user called "stop" and then "start"
if err := Stop(targets, b); err != nil {
return err
}
return Start(targets, b)
} | go | func Restart(targets []string, b backend.Backend) error {
// act as if the user called "stop" and then "start"
if err := Stop(targets, b); err != nil {
return err
}
return Start(targets, b)
} | [
"func",
"Restart",
"(",
"targets",
"[",
"]",
"string",
",",
"b",
"backend",
".",
"Backend",
")",
"error",
"{",
"// act as if the user called \"stop\" and then \"start\"",
"if",
"err",
":=",
"Stop",
"(",
"targets",
",",
"b",
")",
";",
"err",
"!=",
"nil",
"{",... | // Restart stops and then starts the specified components. | [
"Restart",
"stops",
"and",
"then",
"starts",
"the",
"specified",
"components",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L241-L249 |
142,962 | deis/deis | deisctl/cmd/cmd.go | Journal | func Journal(targets []string, b backend.Backend) error {
for _, target := range targets {
if err := b.Journal(target); err != nil {
return err
}
}
return nil
} | go | func Journal(targets []string, b backend.Backend) error {
for _, target := range targets {
if err := b.Journal(target); err != nil {
return err
}
}
return nil
} | [
"func",
"Journal",
"(",
"targets",
"[",
"]",
"string",
",",
"b",
"backend",
".",
"Backend",
")",
"error",
"{",
"for",
"_",
",",
"target",
":=",
"range",
"targets",
"{",
"if",
"err",
":=",
"b",
".",
"Journal",
"(",
"target",
")",
";",
"err",
"!=",
... | // Journal prints log output for the specified components. | [
"Journal",
"prints",
"log",
"output",
"for",
"the",
"specified",
"components",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L263-L271 |
142,963 | deis/deis | deisctl/cmd/cmd.go | Uninstall | func Uninstall(targets []string, b backend.Backend) error {
if len(targets) == 1 {
switch targets[0] {
case PlatformCommand:
return UninstallPlatform(b, false)
case StatelessPlatformCommand:
return UninstallPlatform(b, true)
}
}
var wg sync.WaitGroup
// uninstall the specific target
b.Destroy(targe... | go | func Uninstall(targets []string, b backend.Backend) error {
if len(targets) == 1 {
switch targets[0] {
case PlatformCommand:
return UninstallPlatform(b, false)
case StatelessPlatformCommand:
return UninstallPlatform(b, true)
}
}
var wg sync.WaitGroup
// uninstall the specific target
b.Destroy(targe... | [
"func",
"Uninstall",
"(",
"targets",
"[",
"]",
"string",
",",
"b",
"backend",
".",
"Backend",
")",
"error",
"{",
"if",
"len",
"(",
"targets",
")",
"==",
"1",
"{",
"switch",
"targets",
"[",
"0",
"]",
"{",
"case",
"PlatformCommand",
":",
"return",
"Uni... | // Uninstall unloads the definitions of the specified components.
// After Uninstall, the components will be unavailable until Install is called. | [
"Uninstall",
"unloads",
"the",
"definitions",
"of",
"the",
"specified",
"components",
".",
"After",
"Uninstall",
"the",
"components",
"will",
"be",
"unavailable",
"until",
"Install",
"is",
"called",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L335-L352 |
142,964 | deis/deis | deisctl/cmd/cmd.go | RefreshUnits | func RefreshUnits(unitDir, tag, rootURL string) error {
unitDir = utils.ResolvePath(unitDir)
decoratorDir := filepath.Join(unitDir, "decorators")
// create the target dir if necessary
if err := os.MkdirAll(decoratorDir, 0755); err != nil {
return err
}
// download and save the unit files to the specified path
... | go | func RefreshUnits(unitDir, tag, rootURL string) error {
unitDir = utils.ResolvePath(unitDir)
decoratorDir := filepath.Join(unitDir, "decorators")
// create the target dir if necessary
if err := os.MkdirAll(decoratorDir, 0755); err != nil {
return err
}
// download and save the unit files to the specified path
... | [
"func",
"RefreshUnits",
"(",
"unitDir",
",",
"tag",
",",
"rootURL",
"string",
")",
"error",
"{",
"unitDir",
"=",
"utils",
".",
"ResolvePath",
"(",
"unitDir",
")",
"\n",
"decoratorDir",
":=",
"filepath",
".",
"Join",
"(",
"unitDir",
",",
"\"",
"\"",
")",
... | // RefreshUnits overwrites local unit files with those requested.
// Downloading from the Deis project GitHub URL by tag or SHA is the only mechanism
// currently supported. | [
"RefreshUnits",
"overwrites",
"local",
"unit",
"files",
"with",
"those",
"requested",
".",
"Downloading",
"from",
"the",
"Deis",
"project",
"GitHub",
"URL",
"by",
"tag",
"or",
"SHA",
"is",
"the",
"only",
"mechanism",
"currently",
"supported",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L425-L453 |
142,965 | deis/deis | deisctl/cmd/cmd.go | SSH | func SSH(target string, cmd []string, b backend.Backend) error {
if len(cmd) > 0 {
return b.SSHExec(target, strings.Join(cmd, " "))
}
return b.SSH(target)
} | go | func SSH(target string, cmd []string, b backend.Backend) error {
if len(cmd) > 0 {
return b.SSHExec(target, strings.Join(cmd, " "))
}
return b.SSH(target)
} | [
"func",
"SSH",
"(",
"target",
"string",
",",
"cmd",
"[",
"]",
"string",
",",
"b",
"backend",
".",
"Backend",
")",
"error",
"{",
"if",
"len",
"(",
"cmd",
")",
">",
"0",
"{",
"return",
"b",
".",
"SSHExec",
"(",
"target",
",",
"strings",
".",
"Join"... | // SSH opens an interactive shell on a machine in the cluster | [
"SSH",
"opens",
"an",
"interactive",
"shell",
"on",
"a",
"machine",
"in",
"the",
"cluster"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/cmd.go#L456-L463 |
142,966 | deis/deis | client/parser/tags.go | Tags | func Tags(argv []string) error {
usage := `
Valid commands for tags:
tags:list list tags for an app
tags:set set tags for an app
tags:unset unset tags for an app
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case "tags:list":
return tagsList(argv)
case "tags:set":
return ta... | go | func Tags(argv []string) error {
usage := `
Valid commands for tags:
tags:list list tags for an app
tags:set set tags for an app
tags:unset unset tags for an app
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case "tags:list":
return tagsList(argv)
case "tags:set":
return ta... | [
"func",
"Tags",
"(",
"argv",
"[",
"]",
"string",
")",
"error",
"{",
"usage",
":=",
"`\nValid commands for tags:\n\ntags:list list tags for an app\ntags:set set tags for an app\ntags:unset unset tags for an app\n\nUse 'deis help [command]' to learn more.\n`",
"\n\n",
... | // Tags routes tags commands to their specific function | [
"Tags",
"routes",
"tags",
"commands",
"to",
"their",
"specific",
"function"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/tags.go#L9-L40 |
142,967 | deis/deis | logger/storage/factory.go | NewAdapter | func NewAdapter(storeageAdapterType string) (Adapter, error) {
if storeageAdapterType == "" || storeageAdapterType == "file" {
adapter, err := file.NewStorageAdapter(LogRoot)
if err != nil {
return nil, err
}
return adapter, nil
}
match := memoryAdapterRegex.FindStringSubmatch(storeageAdapterType)
if mat... | go | func NewAdapter(storeageAdapterType string) (Adapter, error) {
if storeageAdapterType == "" || storeageAdapterType == "file" {
adapter, err := file.NewStorageAdapter(LogRoot)
if err != nil {
return nil, err
}
return adapter, nil
}
match := memoryAdapterRegex.FindStringSubmatch(storeageAdapterType)
if mat... | [
"func",
"NewAdapter",
"(",
"storeageAdapterType",
"string",
")",
"(",
"Adapter",
",",
"error",
")",
"{",
"if",
"storeageAdapterType",
"==",
"\"",
"\"",
"||",
"storeageAdapterType",
"==",
"\"",
"\"",
"{",
"adapter",
",",
"err",
":=",
"file",
".",
"NewStorageA... | // NewAdapter returns a pointer to an appropriate implementation of the Adapter interface, as
// determined by the storeageAdapterType string it is passed. | [
"NewAdapter",
"returns",
"a",
"pointer",
"to",
"an",
"appropriate",
"implementation",
"of",
"the",
"Adapter",
"interface",
"as",
"determined",
"by",
"the",
"storeageAdapterType",
"string",
"it",
"is",
"passed",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/storage/factory.go#L23-L48 |
142,968 | deis/deis | builder/docker/docker.go | Start | func Start(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
// Allow insecure Docker registries on all private network ranges in RFC 1918 and RFC 6598.
dargs := []string{
"-d",
"--bip=172.19.42.1/16",
"--insecure-registry",
"10.0.0.0/8",
"--insecure-registry",
"172.16.0.0/12",
"--in... | go | func Start(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
// Allow insecure Docker registries on all private network ranges in RFC 1918 and RFC 6598.
dargs := []string{
"-d",
"--bip=172.19.42.1/16",
"--insecure-registry",
"10.0.0.0/8",
"--insecure-registry",
"172.16.0.0/12",
"--in... | [
"func",
"Start",
"(",
"c",
"cookoo",
".",
"Context",
",",
"p",
"*",
"cookoo",
".",
"Params",
")",
"(",
"interface",
"{",
"}",
",",
"cookoo",
".",
"Interrupt",
")",
"{",
"// Allow insecure Docker registries on all private network ranges in RFC 1918 and RFC 6598.",
"d... | // Start starts a Docker daemon.
//
// This assumes the presence of the docker client on the host. It does not use
// the API. | [
"Start",
"starts",
"a",
"Docker",
"daemon",
".",
"This",
"assumes",
"the",
"presence",
"of",
"the",
"docker",
"client",
"on",
"the",
"host",
".",
"It",
"does",
"not",
"use",
"the",
"API",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/builder/docker/docker.go#L62-L100 |
142,969 | deis/deis | client/parser/releases.go | Releases | func Releases(argv []string) error {
usage := `
Valid commands for releases:
releases:list list an application's release history
releases:info print information about a specific release
releases:rollback return to a previous release
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case... | go | func Releases(argv []string) error {
usage := `
Valid commands for releases:
releases:list list an application's release history
releases:info print information about a specific release
releases:rollback return to a previous release
Use 'deis help [command]' to learn more.
`
switch argv[0] {
case... | [
"func",
"Releases",
"(",
"argv",
"[",
"]",
"string",
")",
"error",
"{",
"usage",
":=",
"`\nValid commands for releases:\n\nreleases:list list an application's release history\nreleases:info print information about a specific release\nreleases:rollback return to a previous re... | // Releases routes releases commands to their specific function. | [
"Releases",
"routes",
"releases",
"commands",
"to",
"their",
"specific",
"function",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/releases.go#L12-L43 |
142,970 | deis/deis | client/pkg/git/git.go | CreateRemote | func CreateRemote(host, remote, appID string) error {
cmd := exec.Command("git", "remote", "add", remote, RemoteURL(host, appID))
stderr, err := cmd.StderrPipe()
if err != nil {
return err
}
if err = cmd.Start(); err != nil {
return err
}
output, _ := ioutil.ReadAll(stderr)
fmt.Print(string(output))
if... | go | func CreateRemote(host, remote, appID string) error {
cmd := exec.Command("git", "remote", "add", remote, RemoteURL(host, appID))
stderr, err := cmd.StderrPipe()
if err != nil {
return err
}
if err = cmd.Start(); err != nil {
return err
}
output, _ := ioutil.ReadAll(stderr)
fmt.Print(string(output))
if... | [
"func",
"CreateRemote",
"(",
"host",
",",
"remote",
",",
"appID",
"string",
")",
"error",
"{",
"cmd",
":=",
"exec",
".",
"Command",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"remote",
",",
"RemoteURL",
"(",
"host",
",",
"appID",
")",
... | // CreateRemote adds a git remote in the current directory. | [
"CreateRemote",
"adds",
"a",
"git",
"remote",
"in",
"the",
"current",
"directory",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/pkg/git/git.go#L14-L36 |
142,971 | deis/deis | client/pkg/git/git.go | DeleteRemote | func DeleteRemote(appID string) error {
name, err := remoteNameFromAppID(appID)
if err != nil {
return err
}
if _, err = exec.Command("git", "remote", "remove", name).Output(); err != nil {
return err
}
fmt.Printf("Git remote %s removed\n", name)
return nil
} | go | func DeleteRemote(appID string) error {
name, err := remoteNameFromAppID(appID)
if err != nil {
return err
}
if _, err = exec.Command("git", "remote", "remove", name).Output(); err != nil {
return err
}
fmt.Printf("Git remote %s removed\n", name)
return nil
} | [
"func",
"DeleteRemote",
"(",
"appID",
"string",
")",
"error",
"{",
"name",
",",
"err",
":=",
"remoteNameFromAppID",
"(",
"appID",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"_",
",",
"err",
"=",
"exec",
".",... | // DeleteRemote removes a git remote in the current directory. | [
"DeleteRemote",
"removes",
"a",
"git",
"remote",
"in",
"the",
"current",
"directory",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/pkg/git/git.go#L39-L53 |
142,972 | deis/deis | client/pkg/git/git.go | DetectAppName | func DetectAppName(host string) (string, error) {
remote, err := findRemote(host)
// Don't return an error if remote can't be found, return directory name instead.
if err != nil {
dir, err := os.Getwd()
return strings.ToLower(path.Base(dir)), err
}
ss := strings.Split(remote, "/")
return strings.Split(ss[le... | go | func DetectAppName(host string) (string, error) {
remote, err := findRemote(host)
// Don't return an error if remote can't be found, return directory name instead.
if err != nil {
dir, err := os.Getwd()
return strings.ToLower(path.Base(dir)), err
}
ss := strings.Split(remote, "/")
return strings.Split(ss[le... | [
"func",
"DetectAppName",
"(",
"host",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"remote",
",",
"err",
":=",
"findRemote",
"(",
"host",
")",
"\n\n",
"// Don't return an error if remote can't be found, return directory name instead.",
"if",
"err",
"!=",
"n... | // DetectAppName detects if there is deis remote in git. | [
"DetectAppName",
"detects",
"if",
"there",
"is",
"deis",
"remote",
"in",
"git",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/pkg/git/git.go#L74-L85 |
142,973 | deis/deis | client/pkg/git/git.go | RemoteURL | func RemoteURL(host, appID string) string {
// Strip off any trailing :port number after the host name.
host = strings.Split(host, ":")[0]
return fmt.Sprintf("ssh://git@%s:2222/%s.git", host, appID)
} | go | func RemoteURL(host, appID string) string {
// Strip off any trailing :port number after the host name.
host = strings.Split(host, ":")[0]
return fmt.Sprintf("ssh://git@%s:2222/%s.git", host, appID)
} | [
"func",
"RemoteURL",
"(",
"host",
",",
"appID",
"string",
")",
"string",
"{",
"// Strip off any trailing :port number after the host name.",
"host",
"=",
"strings",
".",
"Split",
"(",
"host",
",",
"\"",
"\"",
")",
"[",
"0",
"]",
"\n",
"return",
"fmt",
".",
"... | // RemoteURL returns the git URL of app. | [
"RemoteURL",
"returns",
"the",
"git",
"URL",
"of",
"app",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/pkg/git/git.go#L111-L115 |
142,974 | deis/deis | client/cmd/keys.go | KeysList | func KeysList(results int) error {
c, err := client.New()
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
keys, count, err := keys.List(c, results)
if err != nil {
return err
}
fmt.Printf("=== %s Keys%s", c.Username, limitCount(len(keys), count))
sort.Sort(key... | go | func KeysList(results int) error {
c, err := client.New()
if err != nil {
return err
}
if results == defaultLimit {
results = c.ResponseLimit
}
keys, count, err := keys.List(c, results)
if err != nil {
return err
}
fmt.Printf("=== %s Keys%s", c.Username, limitCount(len(keys), count))
sort.Sort(key... | [
"func",
"KeysList",
"(",
"results",
"int",
")",
"error",
"{",
"c",
",",
"err",
":=",
"client",
".",
"New",
"(",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"results",
"==",
"defaultLimit",
"{",
"results",
"... | // KeysList lists a user's keys. | [
"KeysList",
"lists",
"a",
"user",
"s",
"keys",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/keys.go#L18-L43 |
142,975 | deis/deis | client/cmd/keys.go | KeyRemove | func KeyRemove(keyID string) error {
c, err := client.New()
if err != nil {
return err
}
fmt.Printf("Removing %s SSH Key...", keyID)
if err = keys.Delete(c, keyID); err != nil {
fmt.Println()
return err
}
fmt.Println(" done")
return nil
} | go | func KeyRemove(keyID string) error {
c, err := client.New()
if err != nil {
return err
}
fmt.Printf("Removing %s SSH Key...", keyID)
if err = keys.Delete(c, keyID); err != nil {
fmt.Println()
return err
}
fmt.Println(" done")
return nil
} | [
"func",
"KeyRemove",
"(",
"keyID",
"string",
")",
"error",
"{",
"c",
",",
"err",
":=",
"client",
".",
"New",
"(",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"fmt",
".",
"Printf",
"(",
"\"",
"\"",
",",
"keyID",... | // KeyRemove removes keys. | [
"KeyRemove",
"removes",
"keys",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/keys.go#L46-L62 |
142,976 | deis/deis | client/cmd/keys.go | KeyAdd | func KeyAdd(keyLocation string) error {
c, err := client.New()
if err != nil {
return err
}
var key api.KeyCreateRequest
if keyLocation == "" {
key, err = chooseKey()
} else {
key, err = getKey(keyLocation)
}
if err != nil {
return err
}
fmt.Printf("Uploading %s to deis...", path.Base(key.Name))
... | go | func KeyAdd(keyLocation string) error {
c, err := client.New()
if err != nil {
return err
}
var key api.KeyCreateRequest
if keyLocation == "" {
key, err = chooseKey()
} else {
key, err = getKey(keyLocation)
}
if err != nil {
return err
}
fmt.Printf("Uploading %s to deis...", path.Base(key.Name))
... | [
"func",
"KeyAdd",
"(",
"keyLocation",
"string",
")",
"error",
"{",
"c",
",",
"err",
":=",
"client",
".",
"New",
"(",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"var",
"key",
"api",
".",
"KeyCreateRequest",
"\n\n",... | // KeyAdd adds keys. | [
"KeyAdd",
"adds",
"keys",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/keys.go#L65-L93 |
142,977 | deis/deis | client/controller/models/keys/keys.go | New | func New(c *client.Client, id string, pubKey string) (api.Key, error) {
req := api.KeyCreateRequest{ID: id, Public: pubKey}
body, err := json.Marshal(req)
resBody, err := c.BasicRequest("POST", "/v1/keys/", body)
if err != nil {
return api.Key{}, err
}
key := api.Key{}
if err = json.Unmarshal([]byte(resBody... | go | func New(c *client.Client, id string, pubKey string) (api.Key, error) {
req := api.KeyCreateRequest{ID: id, Public: pubKey}
body, err := json.Marshal(req)
resBody, err := c.BasicRequest("POST", "/v1/keys/", body)
if err != nil {
return api.Key{}, err
}
key := api.Key{}
if err = json.Unmarshal([]byte(resBody... | [
"func",
"New",
"(",
"c",
"*",
"client",
".",
"Client",
",",
"id",
"string",
",",
"pubKey",
"string",
")",
"(",
"api",
".",
"Key",
",",
"error",
")",
"{",
"req",
":=",
"api",
".",
"KeyCreateRequest",
"{",
"ID",
":",
"id",
",",
"Public",
":",
"pubK... | // New creates a new key. | [
"New",
"creates",
"a",
"new",
"key",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/keys/keys.go#L28-L44 |
142,978 | deis/deis | pkg/time/time.go | MarshalJSON | func (t *Time) MarshalJSON() ([]byte, error) {
return []byte(t.Time.Format(`"` + DeisDatetimeFormat + `"`)), nil
} | go | func (t *Time) MarshalJSON() ([]byte, error) {
return []byte(t.Time.Format(`"` + DeisDatetimeFormat + `"`)), nil
} | [
"func",
"(",
"t",
"*",
"Time",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"return",
"[",
"]",
"byte",
"(",
"t",
".",
"Time",
".",
"Format",
"(",
"`\"`",
"+",
"DeisDatetimeFormat",
"+",
"`\"`",
")",
")",
",",
"n... | // MarshalJSON implements the json.Marshaler interface.
// The time is a quoted string in Deis' datetime format. | [
"MarshalJSON",
"implements",
"the",
"json",
".",
"Marshaler",
"interface",
".",
"The",
"time",
"is",
"a",
"quoted",
"string",
"in",
"Deis",
"datetime",
"format",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/pkg/time/time.go#L19-L21 |
142,979 | deis/deis | pkg/prettyprint/colorizer.go | DeisIfy | func DeisIfy(msg string) string {
var t = struct {
Msg string
C map[string]string
}{
Msg: msg,
C: Colors,
}
tpl := "{{.C.Deis1}}\n{{.C.Deis2}} {{.Msg}}\n{{.C.Deis3}}\n"
var buf bytes.Buffer
template.Must(template.New("deis").Parse(tpl)).Execute(&buf, t)
return buf.String()
} | go | func DeisIfy(msg string) string {
var t = struct {
Msg string
C map[string]string
}{
Msg: msg,
C: Colors,
}
tpl := "{{.C.Deis1}}\n{{.C.Deis2}} {{.Msg}}\n{{.C.Deis3}}\n"
var buf bytes.Buffer
template.Must(template.New("deis").Parse(tpl)).Execute(&buf, t)
return buf.String()
} | [
"func",
"DeisIfy",
"(",
"msg",
"string",
")",
"string",
"{",
"var",
"t",
"=",
"struct",
"{",
"Msg",
"string",
"\n",
"C",
"map",
"[",
"string",
"]",
"string",
"\n",
"}",
"{",
"Msg",
":",
"msg",
",",
"C",
":",
"Colors",
",",
"}",
"\n",
"tpl",
":=... | // DeisIfy returns a pretty-printed deis logo along with the corresponding message | [
"DeisIfy",
"returns",
"a",
"pretty",
"-",
"printed",
"deis",
"logo",
"along",
"with",
"the",
"corresponding",
"message"
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/pkg/prettyprint/colorizer.go#L63-L75 |
142,980 | deis/deis | pkg/prettyprint/colorizer.go | NoColor | func NoColor(msg string) string {
empties := make(map[string]string, len(Colors))
for k := range Colors {
empties[k] = ""
}
return colorize(msg, empties)
} | go | func NoColor(msg string) string {
empties := make(map[string]string, len(Colors))
for k := range Colors {
empties[k] = ""
}
return colorize(msg, empties)
} | [
"func",
"NoColor",
"(",
"msg",
"string",
")",
"string",
"{",
"empties",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
",",
"len",
"(",
"Colors",
")",
")",
"\n",
"for",
"k",
":=",
"range",
"Colors",
"{",
"empties",
"[",
"k",
"]",
"=",
"\... | // NoColor strips colors from the template.
//
// NoColor provides support for non-color ANSI terminals. It can be used
// as an alternative to Colorize when it is detected that the terminal does
// not support colors. | [
"NoColor",
"strips",
"colors",
"from",
"the",
"template",
".",
"NoColor",
"provides",
"support",
"for",
"non",
"-",
"color",
"ANSI",
"terminals",
".",
"It",
"can",
"be",
"used",
"as",
"an",
"alternative",
"to",
"Colorize",
"when",
"it",
"is",
"detected",
"... | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/pkg/prettyprint/colorizer.go#L87-L93 |
142,981 | deis/deis | pkg/prettyprint/colorizer.go | Overwritef | func Overwritef(msg string, args ...interface{}) string {
return Overwrite(fmt.Sprintf(msg, args...))
} | go | func Overwritef(msg string, args ...interface{}) string {
return Overwrite(fmt.Sprintf(msg, args...))
} | [
"func",
"Overwritef",
"(",
"msg",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"string",
"{",
"return",
"Overwrite",
"(",
"fmt",
".",
"Sprintf",
"(",
"msg",
",",
"args",
"...",
")",
")",
"\n",
"}"
] | // Overwritef formats a string and then returns an overwrite line.
//
// See `Overwrite` for details. | [
"Overwritef",
"formats",
"a",
"string",
"and",
"then",
"returns",
"an",
"overwrite",
"line",
".",
"See",
"Overwrite",
"for",
"details",
"."
] | 1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410 | https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/pkg/prettyprint/colorizer.go#L162-L164 |
142,982 | hashicorp/go-getter | get.go | Get | func Get(dst, src string, opts ...ClientOption) error {
return (&Client{
Src: src,
Dst: dst,
Dir: true,
Options: opts,
}).Get()
} | go | func Get(dst, src string, opts ...ClientOption) error {
return (&Client{
Src: src,
Dst: dst,
Dir: true,
Options: opts,
}).Get()
} | [
"func",
"Get",
"(",
"dst",
",",
"src",
"string",
",",
"opts",
"...",
"ClientOption",
")",
"error",
"{",
"return",
"(",
"&",
"Client",
"{",
"Src",
":",
"src",
",",
"Dst",
":",
"dst",
",",
"Dir",
":",
"true",
",",
"Options",
":",
"opts",
",",
"}",
... | // Get downloads the directory specified by src into the folder specified by
// dst. If dst already exists, Get will attempt to update it.
//
// src is a URL, whereas dst is always just a file path to a folder. This
// folder doesn't need to exist. It will be created if it doesn't exist. | [
"Get",
"downloads",
"the",
"directory",
"specified",
"by",
"src",
"into",
"the",
"folder",
"specified",
"by",
"dst",
".",
"If",
"dst",
"already",
"exists",
"Get",
"will",
"attempt",
"to",
"update",
"it",
".",
"src",
"is",
"a",
"URL",
"whereas",
"dst",
"i... | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get.go#L83-L90 |
142,983 | hashicorp/go-getter | get.go | GetAny | func GetAny(dst, src string, opts ...ClientOption) error {
return (&Client{
Src: src,
Dst: dst,
Mode: ClientModeAny,
Options: opts,
}).Get()
} | go | func GetAny(dst, src string, opts ...ClientOption) error {
return (&Client{
Src: src,
Dst: dst,
Mode: ClientModeAny,
Options: opts,
}).Get()
} | [
"func",
"GetAny",
"(",
"dst",
",",
"src",
"string",
",",
"opts",
"...",
"ClientOption",
")",
"error",
"{",
"return",
"(",
"&",
"Client",
"{",
"Src",
":",
"src",
",",
"Dst",
":",
"dst",
",",
"Mode",
":",
"ClientModeAny",
",",
"Options",
":",
"opts",
... | // GetAny downloads a URL into the given destination. Unlike Get or
// GetFile, both directories and files are supported.
//
// dst must be a directory. If src is a file, it will be downloaded
// into dst with the basename of the URL. If src is a directory or
// archive, it will be unpacked directly into dst. | [
"GetAny",
"downloads",
"a",
"URL",
"into",
"the",
"given",
"destination",
".",
"Unlike",
"Get",
"or",
"GetFile",
"both",
"directories",
"and",
"files",
"are",
"supported",
".",
"dst",
"must",
"be",
"a",
"directory",
".",
"If",
"src",
"is",
"a",
"file",
"... | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get.go#L98-L105 |
142,984 | hashicorp/go-getter | get.go | getRunCommand | func getRunCommand(cmd *exec.Cmd) error {
var buf bytes.Buffer
cmd.Stdout = &buf
cmd.Stderr = &buf
err := cmd.Run()
if err == nil {
return nil
}
if exiterr, ok := err.(*exec.ExitError); ok {
// The program has exited with an exit code != 0
if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
return... | go | func getRunCommand(cmd *exec.Cmd) error {
var buf bytes.Buffer
cmd.Stdout = &buf
cmd.Stderr = &buf
err := cmd.Run()
if err == nil {
return nil
}
if exiterr, ok := err.(*exec.ExitError); ok {
// The program has exited with an exit code != 0
if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
return... | [
"func",
"getRunCommand",
"(",
"cmd",
"*",
"exec",
".",
"Cmd",
")",
"error",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"cmd",
".",
"Stdout",
"=",
"&",
"buf",
"\n",
"cmd",
".",
"Stderr",
"=",
"&",
"buf",
"\n",
"err",
":=",
"cmd",
".",
"Run",... | // getRunCommand is a helper that will run a command and capture the output
// in the case an error happens. | [
"getRunCommand",
"is",
"a",
"helper",
"that",
"will",
"run",
"a",
"command",
"and",
"capture",
"the",
"output",
"in",
"the",
"case",
"an",
"error",
"happens",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get.go#L120-L140 |
142,985 | hashicorp/go-getter | client_option_progress.go | WithProgress | func WithProgress(pl ProgressTracker) func(*Client) error {
return func(c *Client) error {
c.ProgressListener = pl
return nil
}
} | go | func WithProgress(pl ProgressTracker) func(*Client) error {
return func(c *Client) error {
c.ProgressListener = pl
return nil
}
} | [
"func",
"WithProgress",
"(",
"pl",
"ProgressTracker",
")",
"func",
"(",
"*",
"Client",
")",
"error",
"{",
"return",
"func",
"(",
"c",
"*",
"Client",
")",
"error",
"{",
"c",
".",
"ProgressListener",
"=",
"pl",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"... | // WithProgress allows for a user to track
// the progress of a download.
// For example by displaying a progress bar with
// current download.
// Not all getters have progress support yet. | [
"WithProgress",
"allows",
"for",
"a",
"user",
"to",
"track",
"the",
"progress",
"of",
"a",
"download",
".",
"For",
"example",
"by",
"displaying",
"a",
"progress",
"bar",
"with",
"current",
"download",
".",
"Not",
"all",
"getters",
"have",
"progress",
"suppor... | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/client_option_progress.go#L12-L17 |
142,986 | hashicorp/go-getter | get_git.go | fetchSubmodules | func (g *GitGetter) fetchSubmodules(ctx context.Context, dst, sshKeyFile string, depth int) error {
args := []string{"submodule", "update", "--init", "--recursive"}
if depth > 0 {
args = append(args, "--depth", strconv.Itoa(depth))
}
cmd := exec.CommandContext(ctx, "git", args...)
cmd.Dir = dst
setupGitEnv(cmd,... | go | func (g *GitGetter) fetchSubmodules(ctx context.Context, dst, sshKeyFile string, depth int) error {
args := []string{"submodule", "update", "--init", "--recursive"}
if depth > 0 {
args = append(args, "--depth", strconv.Itoa(depth))
}
cmd := exec.CommandContext(ctx, "git", args...)
cmd.Dir = dst
setupGitEnv(cmd,... | [
"func",
"(",
"g",
"*",
"GitGetter",
")",
"fetchSubmodules",
"(",
"ctx",
"context",
".",
"Context",
",",
"dst",
",",
"sshKeyFile",
"string",
",",
"depth",
"int",
")",
"error",
"{",
"args",
":=",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
... | // fetchSubmodules downloads any configured submodules recursively. | [
"fetchSubmodules",
"downloads",
"any",
"configured",
"submodules",
"recursively",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get_git.go#L216-L225 |
142,987 | hashicorp/go-getter | get_git.go | setupGitEnv | func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) {
const gitSSHCommand = "GIT_SSH_COMMAND="
var sshCmd []string
// If we have an existing GIT_SSH_COMMAND, we need to append our options.
// We will also remove our old entry to make sure the behavior is the same
// with versions of Go < 1.9.
env := os.Environ()
... | go | func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) {
const gitSSHCommand = "GIT_SSH_COMMAND="
var sshCmd []string
// If we have an existing GIT_SSH_COMMAND, we need to append our options.
// We will also remove our old entry to make sure the behavior is the same
// with versions of Go < 1.9.
env := os.Environ()
... | [
"func",
"setupGitEnv",
"(",
"cmd",
"*",
"exec",
".",
"Cmd",
",",
"sshKeyFile",
"string",
")",
"{",
"const",
"gitSSHCommand",
"=",
"\"",
"\"",
"\n",
"var",
"sshCmd",
"[",
"]",
"string",
"\n\n",
"// If we have an existing GIT_SSH_COMMAND, we need to append our options... | // setupGitEnv sets up the environment for the given command. This is used to
// pass configuration data to git and ssh and enables advanced cloning methods. | [
"setupGitEnv",
"sets",
"up",
"the",
"environment",
"for",
"the",
"given",
"command",
".",
"This",
"is",
"used",
"to",
"pass",
"configuration",
"data",
"to",
"git",
"and",
"ssh",
"and",
"enables",
"advanced",
"cloning",
"methods",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get_git.go#L229-L261 |
142,988 | hashicorp/go-getter | get_git.go | checkGitVersion | func checkGitVersion(min string) error {
want, err := version.NewVersion(min)
if err != nil {
return err
}
out, err := exec.Command("git", "version").Output()
if err != nil {
return err
}
fields := strings.Fields(string(out))
if len(fields) < 3 {
return fmt.Errorf("Unexpected 'git version' output: %q", ... | go | func checkGitVersion(min string) error {
want, err := version.NewVersion(min)
if err != nil {
return err
}
out, err := exec.Command("git", "version").Output()
if err != nil {
return err
}
fields := strings.Fields(string(out))
if len(fields) < 3 {
return fmt.Errorf("Unexpected 'git version' output: %q", ... | [
"func",
"checkGitVersion",
"(",
"min",
"string",
")",
"error",
"{",
"want",
",",
"err",
":=",
"version",
".",
"NewVersion",
"(",
"min",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"out",
",",
"err",
":=",
"exec",
"... | // checkGitVersion is used to check the version of git installed on the system
// against a known minimum version. Returns an error if the installed version
// is older than the given minimum. | [
"checkGitVersion",
"is",
"used",
"to",
"check",
"the",
"version",
"of",
"git",
"installed",
"on",
"the",
"system",
"against",
"a",
"known",
"minimum",
"version",
".",
"Returns",
"an",
"error",
"if",
"the",
"installed",
"version",
"is",
"older",
"than",
"the"... | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get_git.go#L266-L301 |
142,989 | hashicorp/go-getter | get_http.go | getSubdir | func (g *HttpGetter) getSubdir(ctx context.Context, dst, source, subDir string) error {
// Create a temporary directory to store the full source. This has to be
// a non-existent directory.
td, tdcloser, err := safetemp.Dir("", "getter")
if err != nil {
return err
}
defer tdcloser.Close()
var opts []ClientOpt... | go | func (g *HttpGetter) getSubdir(ctx context.Context, dst, source, subDir string) error {
// Create a temporary directory to store the full source. This has to be
// a non-existent directory.
td, tdcloser, err := safetemp.Dir("", "getter")
if err != nil {
return err
}
defer tdcloser.Close()
var opts []ClientOpt... | [
"func",
"(",
"g",
"*",
"HttpGetter",
")",
"getSubdir",
"(",
"ctx",
"context",
".",
"Context",
",",
"dst",
",",
"source",
",",
"subDir",
"string",
")",
"error",
"{",
"// Create a temporary directory to store the full source. This has to be",
"// a non-existent directory.... | // getSubdir downloads the source into the destination, but with
// the proper subdir. | [
"getSubdir",
"downloads",
"the",
"source",
"into",
"the",
"destination",
"but",
"with",
"the",
"proper",
"subdir",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get_http.go#L220-L261 |
142,990 | hashicorp/go-getter | get_http.go | parseMeta | func (g *HttpGetter) parseMeta(r io.Reader) (string, error) {
d := xml.NewDecoder(r)
d.CharsetReader = charsetReader
d.Strict = false
var err error
var t xml.Token
for {
t, err = d.Token()
if err != nil {
if err == io.EOF {
err = nil
}
return "", err
}
if e, ok := t.(xml.StartElement); ok && ... | go | func (g *HttpGetter) parseMeta(r io.Reader) (string, error) {
d := xml.NewDecoder(r)
d.CharsetReader = charsetReader
d.Strict = false
var err error
var t xml.Token
for {
t, err = d.Token()
if err != nil {
if err == io.EOF {
err = nil
}
return "", err
}
if e, ok := t.(xml.StartElement); ok && ... | [
"func",
"(",
"g",
"*",
"HttpGetter",
")",
"parseMeta",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"string",
",",
"error",
")",
"{",
"d",
":=",
"xml",
".",
"NewDecoder",
"(",
"r",
")",
"\n",
"d",
".",
"CharsetReader",
"=",
"charsetReader",
"\n",
"d",
... | // parseMeta looks for the first meta tag in the given reader that
// will give us the source URL. | [
"parseMeta",
"looks",
"for",
"the",
"first",
"meta",
"tag",
"in",
"the",
"given",
"reader",
"that",
"will",
"give",
"us",
"the",
"source",
"URL",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get_http.go#L265-L296 |
142,991 | hashicorp/go-getter | cmd/go-getter/progress_tracking.go | TrackProgress | func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
cpb.lock.Lock()
defer cpb.lock.Unlock()
newPb := pb.New64(totalSize)
newPb.Set64(currentSize)
ProgressBarConfig(newPb, filepath.Base(src))
if cpb.pool == nil {
cpb.pool = pb.NewPool()
cpb.poo... | go | func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
cpb.lock.Lock()
defer cpb.lock.Unlock()
newPb := pb.New64(totalSize)
newPb.Set64(currentSize)
ProgressBarConfig(newPb, filepath.Base(src))
if cpb.pool == nil {
cpb.pool = pb.NewPool()
cpb.poo... | [
"func",
"(",
"cpb",
"*",
"ProgressBar",
")",
"TrackProgress",
"(",
"src",
"string",
",",
"currentSize",
",",
"totalSize",
"int64",
",",
"stream",
"io",
".",
"ReadCloser",
")",
"io",
".",
"ReadCloser",
"{",
"cpb",
".",
"lock",
".",
"Lock",
"(",
")",
"\n... | // TrackProgress instantiates a new progress bar that will
// display the progress of stream until closed.
// total can be 0. | [
"TrackProgress",
"instantiates",
"a",
"new",
"progress",
"bar",
"that",
"will",
"display",
"the",
"progress",
"of",
"stream",
"until",
"closed",
".",
"total",
"can",
"be",
"0",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/cmd/go-getter/progress_tracking.go#L40-L70 |
142,992 | hashicorp/go-getter | detect_ssh.go | detectSSH | func detectSSH(src string) (*url.URL, error) {
matched := sshPattern.FindStringSubmatch(src)
if matched == nil {
return nil, nil
}
user := matched[1]
host := matched[2]
path := matched[3]
qidx := strings.Index(path, "?")
if qidx == -1 {
qidx = len(path)
}
var u url.URL
u.Scheme = "ssh"
u.User = url.Us... | go | func detectSSH(src string) (*url.URL, error) {
matched := sshPattern.FindStringSubmatch(src)
if matched == nil {
return nil, nil
}
user := matched[1]
host := matched[2]
path := matched[3]
qidx := strings.Index(path, "?")
if qidx == -1 {
qidx = len(path)
}
var u url.URL
u.Scheme = "ssh"
u.User = url.Us... | [
"func",
"detectSSH",
"(",
"src",
"string",
")",
"(",
"*",
"url",
".",
"URL",
",",
"error",
")",
"{",
"matched",
":=",
"sshPattern",
".",
"FindStringSubmatch",
"(",
"src",
")",
"\n",
"if",
"matched",
"==",
"nil",
"{",
"return",
"nil",
",",
"nil",
"\n"... | // detectSSH determines if the src string matches an SSH-like URL and
// converts it into a net.URL compatible string. This returns nil if the
// string doesn't match the SSH pattern.
//
// This function is tested indirectly via detect_git_test.go | [
"detectSSH",
"determines",
"if",
"the",
"src",
"string",
"matches",
"an",
"SSH",
"-",
"like",
"URL",
"and",
"converts",
"it",
"into",
"a",
"net",
".",
"URL",
"compatible",
"string",
".",
"This",
"returns",
"nil",
"if",
"the",
"string",
"doesn",
"t",
"mat... | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/detect_ssh.go#L21-L49 |
142,993 | hashicorp/go-getter | get_hg.go | GetFile | func (g *HgGetter) GetFile(dst string, u *url.URL) error {
// Create a temporary directory to store the full source. This has to be
// a non-existent directory.
td, tdcloser, err := safetemp.Dir("", "getter")
if err != nil {
return err
}
defer tdcloser.Close()
// Get the filename, and strip the filename from ... | go | func (g *HgGetter) GetFile(dst string, u *url.URL) error {
// Create a temporary directory to store the full source. This has to be
// a non-existent directory.
td, tdcloser, err := safetemp.Dir("", "getter")
if err != nil {
return err
}
defer tdcloser.Close()
// Get the filename, and strip the filename from ... | [
"func",
"(",
"g",
"*",
"HgGetter",
")",
"GetFile",
"(",
"dst",
"string",
",",
"u",
"*",
"url",
".",
"URL",
")",
"error",
"{",
"// Create a temporary directory to store the full source. This has to be",
"// a non-existent directory.",
"td",
",",
"tdcloser",
",",
"err... | // GetFile for Hg doesn't support updating at this time. It will download
// the file every time. | [
"GetFile",
"for",
"Hg",
"doesn",
"t",
"support",
"updating",
"at",
"this",
"time",
".",
"It",
"will",
"download",
"the",
"file",
"every",
"time",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get_hg.go#L70-L102 |
142,994 | hashicorp/go-getter | folder_storage.go | Dir | func (s *FolderStorage) Dir(key string) (d string, e bool, err error) {
d = s.dir(key)
_, err = os.Stat(d)
if err == nil {
// Directory exists
e = true
return
}
if os.IsNotExist(err) {
// Directory doesn't exist
d = ""
e = false
err = nil
return
}
// An error
d = ""
e = false
return
} | go | func (s *FolderStorage) Dir(key string) (d string, e bool, err error) {
d = s.dir(key)
_, err = os.Stat(d)
if err == nil {
// Directory exists
e = true
return
}
if os.IsNotExist(err) {
// Directory doesn't exist
d = ""
e = false
err = nil
return
}
// An error
d = ""
e = false
return
} | [
"func",
"(",
"s",
"*",
"FolderStorage",
")",
"Dir",
"(",
"key",
"string",
")",
"(",
"d",
"string",
",",
"e",
"bool",
",",
"err",
"error",
")",
"{",
"d",
"=",
"s",
".",
"dir",
"(",
"key",
")",
"\n",
"_",
",",
"err",
"=",
"os",
".",
"Stat",
"... | // Dir implements Storage.Dir | [
"Dir",
"implements",
"Storage",
".",
"Dir"
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/folder_storage.go#L19-L39 |
142,995 | hashicorp/go-getter | folder_storage.go | dir | func (s *FolderStorage) dir(key string) string {
sum := md5.Sum([]byte(key))
return filepath.Join(s.StorageDir, hex.EncodeToString(sum[:]))
} | go | func (s *FolderStorage) dir(key string) string {
sum := md5.Sum([]byte(key))
return filepath.Join(s.StorageDir, hex.EncodeToString(sum[:]))
} | [
"func",
"(",
"s",
"*",
"FolderStorage",
")",
"dir",
"(",
"key",
"string",
")",
"string",
"{",
"sum",
":=",
"md5",
".",
"Sum",
"(",
"[",
"]",
"byte",
"(",
"key",
")",
")",
"\n",
"return",
"filepath",
".",
"Join",
"(",
"s",
".",
"StorageDir",
",",
... | // dir returns the directory name internally that we'll use to map to
// internally. | [
"dir",
"returns",
"the",
"directory",
"name",
"internally",
"that",
"we",
"ll",
"use",
"to",
"map",
"to",
"internally",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/folder_storage.go#L62-L65 |
142,996 | hashicorp/go-getter | get_file_copy.go | Copy | func Copy(ctx context.Context, dst io.Writer, src io.Reader) (int64, error) {
// Copy will call the Reader and Writer interface multiple time, in order
// to copy by chunk (avoiding loading the whole file in memory).
return io.Copy(dst, readerFunc(func(p []byte) (int, error) {
select {
case <-ctx.Done():
// ... | go | func Copy(ctx context.Context, dst io.Writer, src io.Reader) (int64, error) {
// Copy will call the Reader and Writer interface multiple time, in order
// to copy by chunk (avoiding loading the whole file in memory).
return io.Copy(dst, readerFunc(func(p []byte) (int, error) {
select {
case <-ctx.Done():
// ... | [
"func",
"Copy",
"(",
"ctx",
"context",
".",
"Context",
",",
"dst",
"io",
".",
"Writer",
",",
"src",
"io",
".",
"Reader",
")",
"(",
"int64",
",",
"error",
")",
"{",
"// Copy will call the Reader and Writer interface multiple time, in order",
"// to copy by chunk (avo... | // Copy is a io.Copy cancellable by context | [
"Copy",
"is",
"a",
"io",
".",
"Copy",
"cancellable",
"by",
"context"
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/get_file_copy.go#L14-L29 |
142,997 | hashicorp/go-getter | netrc.go | addAuthFromNetrc | func addAuthFromNetrc(u *url.URL) error {
// If the URL already has auth information, do nothing
if u.User != nil && u.User.Username() != "" {
return nil
}
// Get the netrc file path
path := os.Getenv("NETRC")
if path == "" {
filename := ".netrc"
if runtime.GOOS == "windows" {
filename = "_netrc"
}
... | go | func addAuthFromNetrc(u *url.URL) error {
// If the URL already has auth information, do nothing
if u.User != nil && u.User.Username() != "" {
return nil
}
// Get the netrc file path
path := os.Getenv("NETRC")
if path == "" {
filename := ".netrc"
if runtime.GOOS == "windows" {
filename = "_netrc"
}
... | [
"func",
"addAuthFromNetrc",
"(",
"u",
"*",
"url",
".",
"URL",
")",
"error",
"{",
"// If the URL already has auth information, do nothing",
"if",
"u",
".",
"User",
"!=",
"nil",
"&&",
"u",
".",
"User",
".",
"Username",
"(",
")",
"!=",
"\"",
"\"",
"{",
"retur... | // addAuthFromNetrc adds auth information to the URL from the user's
// netrc file if it can be found. This will only add the auth info
// if the URL doesn't already have auth info specified and the
// the username is blank. | [
"addAuthFromNetrc",
"adds",
"auth",
"information",
"to",
"the",
"URL",
"from",
"the",
"user",
"s",
"netrc",
"file",
"if",
"it",
"can",
"be",
"found",
".",
"This",
"will",
"only",
"add",
"the",
"auth",
"info",
"if",
"the",
"URL",
"doesn",
"t",
"already",
... | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/netrc.go#L17-L67 |
142,998 | hashicorp/go-getter | client_option.go | Configure | func (c *Client) Configure(opts ...ClientOption) error {
if c.Ctx == nil {
c.Ctx = context.Background()
}
c.Options = opts
for _, opt := range opts {
err := opt(c)
if err != nil {
return err
}
}
// Default decompressor values
if c.Decompressors == nil {
c.Decompressors = Decompressors
}
// Default... | go | func (c *Client) Configure(opts ...ClientOption) error {
if c.Ctx == nil {
c.Ctx = context.Background()
}
c.Options = opts
for _, opt := range opts {
err := opt(c)
if err != nil {
return err
}
}
// Default decompressor values
if c.Decompressors == nil {
c.Decompressors = Decompressors
}
// Default... | [
"func",
"(",
"c",
"*",
"Client",
")",
"Configure",
"(",
"opts",
"...",
"ClientOption",
")",
"error",
"{",
"if",
"c",
".",
"Ctx",
"==",
"nil",
"{",
"c",
".",
"Ctx",
"=",
"context",
".",
"Background",
"(",
")",
"\n",
"}",
"\n",
"c",
".",
"Options",... | // Configure configures a client with options. | [
"Configure",
"configures",
"a",
"client",
"with",
"options",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/client_option.go#L9-L37 |
142,999 | hashicorp/go-getter | client_option.go | WithContext | func WithContext(ctx context.Context) func(*Client) error {
return func(c *Client) error {
c.Ctx = ctx
return nil
}
} | go | func WithContext(ctx context.Context) func(*Client) error {
return func(c *Client) error {
c.Ctx = ctx
return nil
}
} | [
"func",
"WithContext",
"(",
"ctx",
"context",
".",
"Context",
")",
"func",
"(",
"*",
"Client",
")",
"error",
"{",
"return",
"func",
"(",
"c",
"*",
"Client",
")",
"error",
"{",
"c",
".",
"Ctx",
"=",
"ctx",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"... | // WithContext allows to pass a context to operation
// in order to be able to cancel a download in progress. | [
"WithContext",
"allows",
"to",
"pass",
"a",
"context",
"to",
"operation",
"in",
"order",
"to",
"be",
"able",
"to",
"cancel",
"a",
"download",
"in",
"progress",
"."
] | 69dec094fde6ac8d2659bff743fc0b2096ccb54f | https://github.com/hashicorp/go-getter/blob/69dec094fde6ac8d2659bff743fc0b2096ccb54f/client_option.go#L41-L46 |
Subsets and Splits
SQL Console for google/code_x_glue_ct_code_to_text
This query implements a thoughtful three-tier curation strategy to build a balanced safety dataset, categorizing code by destructive operations, safe I/O operations, and pure computational negatives with subsampling—revealing important patterns about how destructive intent manifests in Python code for model safety research.
SQL Console for google/code_x_glue_ct_code_to_text
This query performs meaningful classification of Python code samples into safety-relevant tiers based on destructive operations, I/O patterns, and pure computation, which could be valuable for building safety classifiers or curating training data, though the output itself is a filtered/ranked dataset rather than revealing novel statistical insights.