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,800
deis/deis
deisctl/config/etcd/etcd.go
NewConfigBackend
func NewConfigBackend() (*ConfigBackend, error) { var dial func(string, string) (net.Conn, error) sshTimeout := time.Duration(fleet.Flags.SSHTimeout*1000) * time.Millisecond tun := getTunnelFlag() if tun != "" { sshClient, err := ssh.NewSSHClient("core", tun, getChecker(), false, sshTimeout) if err != nil { ...
go
func NewConfigBackend() (*ConfigBackend, error) { var dial func(string, string) (net.Conn, error) sshTimeout := time.Duration(fleet.Flags.SSHTimeout*1000) * time.Millisecond tun := getTunnelFlag() if tun != "" { sshClient, err := ssh.NewSSHClient("core", tun, getChecker(), false, sshTimeout) if err != nil { ...
[ "func", "NewConfigBackend", "(", ")", "(", "*", "ConfigBackend", ",", "error", ")", "{", "var", "dial", "func", "(", "string", ",", "string", ")", "(", "net", ".", "Conn", ",", "error", ")", "\n", "sshTimeout", ":=", "time", ".", "Duration", "(", "fl...
// NewConfigBackend returns this etcd-based implementation of the config.Backend // interface
[ "NewConfigBackend", "returns", "this", "etcd", "-", "based", "implementation", "of", "the", "config", ".", "Backend", "interface" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/config/etcd/etcd.go#L131-L171
142,801
deis/deis
logger/drain/simple/drain.go
NewDrain
func NewDrain(drainURL string) (*logDrain, error) { u, err := url.Parse(drainURL) if err != nil { return nil, err } var proto string if u.Scheme == "udp" || u.Scheme == "syslog" { proto = "udp" } else if u.Scheme == "tcp" { proto = "tcp" } else { return nil, fmt.Errorf("Invalid drain url scheme: %s", u.S...
go
func NewDrain(drainURL string) (*logDrain, error) { u, err := url.Parse(drainURL) if err != nil { return nil, err } var proto string if u.Scheme == "udp" || u.Scheme == "syslog" { proto = "udp" } else if u.Scheme == "tcp" { proto = "tcp" } else { return nil, fmt.Errorf("Invalid drain url scheme: %s", u.S...
[ "func", "NewDrain", "(", "drainURL", "string", ")", "(", "*", "logDrain", ",", "error", ")", "{", "u", ",", "err", ":=", "url", ".", "Parse", "(", "drainURL", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n",...
// NewDrain returns a pointer to a new instance of a drain.LogDrain
[ "NewDrain", "returns", "a", "pointer", "to", "a", "new", "instance", "of", "a", "drain", ".", "LogDrain" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/drain/simple/drain.go#L45-L59
142,802
deis/deis
logger/drain/simple/drain.go
Send
func (d *logDrain) Send(message string) error { if d.muted { return nil } d.mutex.Lock() defer d.mutex.Unlock() conn, err := d.getConnection(false) if err != nil { return err } _, err = fmt.Fprintln(conn, message) if err != nil { // Try again with a new connection in case the issue was a broken pipe co...
go
func (d *logDrain) Send(message string) error { if d.muted { return nil } d.mutex.Lock() defer d.mutex.Unlock() conn, err := d.getConnection(false) if err != nil { return err } _, err = fmt.Fprintln(conn, message) if err != nil { // Try again with a new connection in case the issue was a broken pipe co...
[ "func", "(", "d", "*", "logDrain", ")", "Send", "(", "message", "string", ")", "error", "{", "if", "d", ".", "muted", "{", "return", "nil", "\n", "}", "\n", "d", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "d", ".", "mutex", ".", "Unloc...
// Send forwards the provided log message to an external destination
[ "Send", "forwards", "the", "provided", "log", "message", "to", "an", "external", "destination" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/drain/simple/drain.go#L62-L85
142,803
deis/deis
logger/drain/simple/drain.go
getConnection
func (d *logDrain) getConnection(forceNew bool) (net.Conn, error) { // If we have a connection, it's not old, and we're not focing a new one... if d.conn != nil && !forceNew { // then return the existing connection return d.conn, nil } // If ANY of those conditions weren't met, it's time for a new connection. ...
go
func (d *logDrain) getConnection(forceNew bool) (net.Conn, error) { // If we have a connection, it's not old, and we're not focing a new one... if d.conn != nil && !forceNew { // then return the existing connection return d.conn, nil } // If ANY of those conditions weren't met, it's time for a new connection. ...
[ "func", "(", "d", "*", "logDrain", ")", "getConnection", "(", "forceNew", "bool", ")", "(", "net", ".", "Conn", ",", "error", ")", "{", "// If we have a connection, it's not old, and we're not focing a new one...", "if", "d", ".", "conn", "!=", "nil", "&&", "!",...
// getConnection returns a usable connection, often without needing to redial, but still // redialing when advised.
[ "getConnection", "returns", "a", "usable", "connection", "often", "without", "needing", "to", "redial", "but", "still", "redialing", "when", "advised", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/drain/simple/drain.go#L89-L132
142,804
deis/deis
client/cmd/releases.go
ReleasesList
func ReleasesList(appID string, results int) error { c, appID, err := load(appID) if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } releases, count, err := releases.List(c, appID, results) fmt.Printf("=== %s Releases%s", appID, limitCount(len(releases), count)) w := ...
go
func ReleasesList(appID string, results int) error { c, appID, err := load(appID) if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } releases, count, err := releases.List(c, appID, results) fmt.Printf("=== %s Releases%s", appID, limitCount(len(releases), count)) w := ...
[ "func", "ReleasesList", "(", "appID", "string", ",", "results", "int", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "results", "=...
// ReleasesList lists an app's releases.
[ "ReleasesList", "lists", "an", "app", "s", "releases", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/releases.go#L12-L35
142,805
deis/deis
client/cmd/releases.go
ReleasesInfo
func ReleasesInfo(appID string, version int) error { c, appID, err := load(appID) if err != nil { return err } r, err := releases.Get(c, appID, version) if err != nil { return err } fmt.Printf("=== %s Release v%d\n", appID, version) if r.Build != "" { fmt.Println("build: ", r.Build) } fmt.Println(...
go
func ReleasesInfo(appID string, version int) error { c, appID, err := load(appID) if err != nil { return err } r, err := releases.Get(c, appID, version) if err != nil { return err } fmt.Printf("=== %s Release v%d\n", appID, version) if r.Build != "" { fmt.Println("build: ", r.Build) } fmt.Println(...
[ "func", "ReleasesInfo", "(", "appID", "string", ",", "version", "int", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "r", ",", "err", ...
// ReleasesInfo prints info about a specific release.
[ "ReleasesInfo", "prints", "info", "about", "a", "specific", "release", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/releases.go#L38-L63
142,806
deis/deis
client/cmd/releases.go
ReleasesRollback
func ReleasesRollback(appID string, version int) error { c, appID, err := load(appID) if err != nil { return err } if version == -1 { fmt.Print("Rolling back one release... ") } else { fmt.Printf("Rolling back to v%d... ", version) } quit := progress() newVersion, err := releases.Rollback(c, appID, ver...
go
func ReleasesRollback(appID string, version int) error { c, appID, err := load(appID) if err != nil { return err } if version == -1 { fmt.Print("Rolling back one release... ") } else { fmt.Printf("Rolling back to v%d... ", version) } quit := progress() newVersion, err := releases.Rollback(c, appID, ver...
[ "func", "ReleasesRollback", "(", "appID", "string", ",", "version", "int", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "version", ...
// ReleasesRollback rolls an app back to a previous release.
[ "ReleasesRollback", "rolls", "an", "app", "back", "to", "a", "previous", "release", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/releases.go#L66-L91
142,807
deis/deis
Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go
IsNotModified
func IsNotModified(err error) bool { if err == nil { return false } ae, ok := err.(*Error) return ok && ae.Code == http.StatusNotModified }
go
func IsNotModified(err error) bool { if err == nil { return false } ae, ok := err.(*Error) return ok && ae.Code == http.StatusNotModified }
[ "func", "IsNotModified", "(", "err", "error", ")", "bool", "{", "if", "err", "==", "nil", "{", "return", "false", "\n", "}", "\n", "ae", ",", "ok", ":=", "err", ".", "(", "*", "Error", ")", "\n", "return", "ok", "&&", "ae", ".", "Code", "==", "...
// IsNotModified reports whether err is the result of the // server replying with http.StatusNotModified. // Such error values are sometimes returned by "Do" methods // on calls when If-None-Match is used.
[ "IsNotModified", "reports", "whether", "err", "is", "the", "result", "of", "the", "server", "replying", "with", "http", ".", "StatusNotModified", ".", "Such", "error", "values", "are", "sometimes", "returned", "by", "Do", "methods", "on", "calls", "when", "If"...
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go#L141-L147
142,808
deis/deis
Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go
ProcessMediaOptions
func ProcessMediaOptions(opts []MediaOption) *MediaOptions { mo := &MediaOptions{ChunkSize: DefaultUploadChunkSize} for _, o := range opts { o.setOptions(mo) } return mo }
go
func ProcessMediaOptions(opts []MediaOption) *MediaOptions { mo := &MediaOptions{ChunkSize: DefaultUploadChunkSize} for _, o := range opts { o.setOptions(mo) } return mo }
[ "func", "ProcessMediaOptions", "(", "opts", "[", "]", "MediaOption", ")", "*", "MediaOptions", "{", "mo", ":=", "&", "MediaOptions", "{", "ChunkSize", ":", "DefaultUploadChunkSize", "}", "\n", "for", "_", ",", "o", ":=", "range", "opts", "{", "o", ".", "...
// ProcessMediaOptions stores options from opts in a MediaOptions. // It is not used by developers directly.
[ "ProcessMediaOptions", "stores", "options", "from", "opts", "in", "a", "MediaOptions", ".", "It", "is", "not", "used", "by", "developers", "directly", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go#L257-L263
142,809
deis/deis
Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go
SetOpaque
func SetOpaque(u *url.URL) { u.Opaque = "//" + u.Host + u.Path if !has4860Fix { u.Opaque = u.Scheme + ":" + u.Opaque } }
go
func SetOpaque(u *url.URL) { u.Opaque = "//" + u.Host + u.Path if !has4860Fix { u.Opaque = u.Scheme + ":" + u.Opaque } }
[ "func", "SetOpaque", "(", "u", "*", "url", ".", "URL", ")", "{", "u", ".", "Opaque", "=", "\"", "\"", "+", "u", ".", "Host", "+", "u", ".", "Path", "\n", "if", "!", "has4860Fix", "{", "u", ".", "Opaque", "=", "u", ".", "Scheme", "+", "\"", ...
// SetOpaque sets u.Opaque from u.Path such that HTTP requests to it // don't alter any hex-escaped characters in u.Path.
[ "SetOpaque", "sets", "u", ".", "Opaque", "from", "u", ".", "Path", "such", "that", "HTTP", "requests", "to", "it", "don", "t", "alter", "any", "hex", "-", "escaped", "characters", "in", "u", ".", "Path", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go#L294-L299
142,810
deis/deis
Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go
CloseBody
func CloseBody(res *http.Response) { if res == nil || res.Body == nil { return } // Justification for 3 byte reads: two for up to "\r\n" after // a JSON/XML document, and then 1 to see EOF if we haven't yet. // TODO(bradfitz): detect Go 1.3+ and skip these reads. // See https://codereview.appspot.com/58240043 ...
go
func CloseBody(res *http.Response) { if res == nil || res.Body == nil { return } // Justification for 3 byte reads: two for up to "\r\n" after // a JSON/XML document, and then 1 to see EOF if we haven't yet. // TODO(bradfitz): detect Go 1.3+ and skip these reads. // See https://codereview.appspot.com/58240043 ...
[ "func", "CloseBody", "(", "res", "*", "http", ".", "Response", ")", "{", "if", "res", "==", "nil", "||", "res", ".", "Body", "==", "nil", "{", "return", "\n", "}", "\n", "// Justification for 3 byte reads: two for up to \"\\r\\n\" after", "// a JSON/XML document, ...
// CloseBody is used to close res.Body. // Prior to calling Close, it also tries to Read a small amount to see an EOF. // Not seeing an EOF can prevent HTTP Transports from reusing connections.
[ "CloseBody", "is", "used", "to", "close", "res", ".", "Body", ".", "Prior", "to", "calling", "Close", "it", "also", "tries", "to", "Read", "a", "small", "amount", "to", "see", "an", "EOF", ".", "Not", "seeing", "an", "EOF", "can", "prevent", "HTTP", ...
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go#L316-L334
142,811
deis/deis
Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go
CombineFields
func CombineFields(s []Field) string { r := make([]string, len(s)) for i, v := range s { r[i] = string(v) } return strings.Join(r, ",") }
go
func CombineFields(s []Field) string { r := make([]string, len(s)) for i, v := range s { r[i] = string(v) } return strings.Join(r, ",") }
[ "func", "CombineFields", "(", "s", "[", "]", "Field", ")", "string", "{", "r", ":=", "make", "(", "[", "]", "string", ",", "len", "(", "s", ")", ")", "\n", "for", "i", ",", "v", ":=", "range", "s", "{", "r", "[", "i", "]", "=", "string", "(...
// CombineFields combines fields into a single string.
[ "CombineFields", "combines", "fields", "into", "a", "single", "string", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go#L382-L388
142,812
deis/deis
client/cmd/auth.go
Register
func Register(controller string, username string, password string, email string, sslVerify bool) error { u, err := url.Parse(controller) httpClient := client.CreateHTTPClient(sslVerify) if err != nil { return err } controllerURL, err := chooseScheme(*u) if err != nil { return err } if err = client.Che...
go
func Register(controller string, username string, password string, email string, sslVerify bool) error { u, err := url.Parse(controller) httpClient := client.CreateHTTPClient(sslVerify) if err != nil { return err } controllerURL, err := chooseScheme(*u) if err != nil { return err } if err = client.Che...
[ "func", "Register", "(", "controller", "string", ",", "username", "string", ",", "password", "string", ",", "email", "string", ",", "sslVerify", "bool", ")", "error", "{", "u", ",", "err", ":=", "url", ".", "Parse", "(", "controller", ")", "\n", "httpCli...
// Register creates a account on a Deis controller.
[ "Register", "creates", "a", "account", "on", "a", "Deis", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/auth.go#L18-L83
142,813
deis/deis
client/cmd/auth.go
Login
func Login(controller string, username string, password string, sslVerify bool) error { u, err := url.Parse(controller) if err != nil { return err } controllerURL, err := chooseScheme(*u) httpClient := client.CreateHTTPClient(sslVerify) if err != nil { return err } if err = client.CheckConnection(httpCl...
go
func Login(controller string, username string, password string, sslVerify bool) error { u, err := url.Parse(controller) if err != nil { return err } controllerURL, err := chooseScheme(*u) httpClient := client.CreateHTTPClient(sslVerify) if err != nil { return err } if err = client.CheckConnection(httpCl...
[ "func", "Login", "(", "controller", "string", ",", "username", "string", ",", "password", "string", ",", "sslVerify", "bool", ")", "error", "{", "u", ",", "err", ":=", "url", ".", "Parse", "(", "controller", ")", "\n\n", "if", "err", "!=", "nil", "{", ...
// Login to a Deis controller.
[ "Login", "to", "a", "Deis", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/auth.go#L106-L142
142,814
deis/deis
client/cmd/auth.go
Logout
func Logout() error { if err := client.Delete(); err != nil { return err } fmt.Println("Logged out") return nil }
go
func Logout() error { if err := client.Delete(); err != nil { return err } fmt.Println("Logged out") return nil }
[ "func", "Logout", "(", ")", "error", "{", "if", "err", ":=", "client", ".", "Delete", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "return", "nil", "\n", "}" ]
// Logout from a Deis controller.
[ "Logout", "from", "a", "Deis", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/auth.go#L145-L152
142,815
deis/deis
client/cmd/auth.go
Cancel
func Cancel(username string, password string, yes bool) error { c, err := client.New() if err != nil { return err } if username == "" || password != "" { fmt.Println("Please log in again in order to cancel this account") if err = Login(c.ControllerURL.String(), username, password, c.SSLVerify); err != nil ...
go
func Cancel(username string, password string, yes bool) error { c, err := client.New() if err != nil { return err } if username == "" || password != "" { fmt.Println("Please log in again in order to cancel this account") if err = Login(c.ControllerURL.String(), username, password, c.SSLVerify); err != nil ...
[ "func", "Cancel", "(", "username", "string", ",", "password", "string", ",", "yes", "bool", ")", "error", "{", "c", ",", "err", ":=", "client", ".", "New", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", ...
// Cancel deletes a user's account.
[ "Cancel", "deletes", "a", "user", "s", "account", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/auth.go#L201-L263
142,816
deis/deis
client/cmd/auth.go
Whoami
func Whoami() error { c, err := client.New() if err != nil { return err } fmt.Printf("You are %s at %s\n", c.Username, c.ControllerURL.String()) return nil }
go
func Whoami() error { c, err := client.New() if err != nil { return err } fmt.Printf("You are %s at %s\n", c.Username, c.ControllerURL.String()) return nil }
[ "func", "Whoami", "(", ")", "error", "{", "c", ",", "err", ":=", "client", ".", "New", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "c", ".", "Username",...
// Whoami prints the logged in user.
[ "Whoami", "prints", "the", "logged", "in", "user", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/auth.go#L266-L275
142,817
deis/deis
client/cmd/auth.go
Regenerate
func Regenerate(username string, all bool) error { c, err := client.New() if err != nil { return err } token, err := auth.Regenerate(c, username, all) if err != nil { return err } if username == "" && all == false { c.Token = token err = c.Save() if err != nil { return err } } fmt.Println...
go
func Regenerate(username string, all bool) error { c, err := client.New() if err != nil { return err } token, err := auth.Regenerate(c, username, all) if err != nil { return err } if username == "" && all == false { c.Token = token err = c.Save() if err != nil { return err } } fmt.Println...
[ "func", "Regenerate", "(", "username", "string", ",", "all", "bool", ")", "error", "{", "c", ",", "err", ":=", "client", ".", "New", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "token", ",", "err", ":=", "...
// Regenerate regenenerates a user's token.
[ "Regenerate", "regenenerates", "a", "user", "s", "token", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/auth.go#L278-L303
142,818
deis/deis
client/cmd/certs.go
CertsList
func CertsList(results int) error { c, err := client.New() if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } certList, _, err := certs.List(c, results) if err != nil { return err } if len(certList) == 0 { fmt.Println("No certs") return nil } certMap := make...
go
func CertsList(results int) error { c, err := client.New() if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } certList, _, err := certs.List(c, results) if err != nil { return err } if len(certList) == 0 { fmt.Println("No certs") return nil } certMap := make...
[ "func", "CertsList", "(", "results", "int", ")", "error", "{", "c", ",", "err", ":=", "client", ".", "New", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "results", "==", "defaultLimit", "{", "results", ...
// CertsList lists certs registered with the controller.
[ "CertsList", "lists", "certs", "registered", "with", "the", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/certs.go#L15-L72
142,819
deis/deis
client/cmd/certs.go
CertAdd
func CertAdd(cert, key, commonName, sans string) error { c, err := client.New() if err != nil { return err } fmt.Print("Adding SSL endpoint... ") quit := progress() err = processCertsAdd(c, cert, key, commonName, sans) quit <- true <-quit if err != nil { return err } fmt.Println("done") return nil }
go
func CertAdd(cert, key, commonName, sans string) error { c, err := client.New() if err != nil { return err } fmt.Print("Adding SSL endpoint... ") quit := progress() err = processCertsAdd(c, cert, key, commonName, sans) quit <- true <-quit if err != nil { return err } fmt.Println("done") return nil }
[ "func", "CertAdd", "(", "cert", ",", "key", ",", "commonName", ",", "sans", "string", ")", "error", "{", "c", ",", "err", ":=", "client", ".", "New", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".",...
// CertAdd adds a cert to the controller.
[ "CertAdd", "adds", "a", "cert", "to", "the", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/certs.go#L75-L94
142,820
deis/deis
client/cmd/certs.go
CertRemove
func CertRemove(commonName string) error { c, err := client.New() if err != nil { return err } fmt.Printf("Removing %s... ", commonName) quit := progress() certs.Delete(c, commonName) quit <- true <-quit if err == nil { fmt.Println("done") } return err }
go
func CertRemove(commonName string) error { c, err := client.New() if err != nil { return err } fmt.Printf("Removing %s... ", commonName) quit := progress() certs.Delete(c, commonName) quit <- true <-quit if err == nil { fmt.Println("done") } return err }
[ "func", "CertRemove", "(", "commonName", "string", ")", "error", "{", "c", ",", "err", ":=", "client", ".", "New", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", ".", "Printf", "(", "\"", "\"", ",", "c...
// CertRemove deletes a cert from the controller.
[ "CertRemove", "deletes", "a", "cert", "from", "the", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/certs.go#L127-L147
142,821
deis/deis
deisctl/backend/fleet/ssh.go
SSH
func (c *FleetClient) SSH(name string) error { sshClient, _, err := c.sshConnect(name) if err != nil { return err } defer sshClient.Close() err = ssh.Shell(sshClient) return err }
go
func (c *FleetClient) SSH(name string) error { sshClient, _, err := c.sshConnect(name) if err != nil { return err } defer sshClient.Close() err = ssh.Shell(sshClient) return err }
[ "func", "(", "c", "*", "FleetClient", ")", "SSH", "(", "name", "string", ")", "error", "{", "sshClient", ",", "_", ",", "err", ":=", "c", ".", "sshConnect", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n"...
// SSH opens an interactive shell to a machine in the cluster
[ "SSH", "opens", "an", "interactive", "shell", "to", "a", "machine", "in", "the", "cluster" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/ssh.go#L16-L25
142,822
deis/deis
deisctl/backend/fleet/ssh.go
findUnit
func (c *FleetClient) findUnit(name string) (machID string, err error) { u, err := c.Fleet.Unit(name) switch { case err != nil: return "", fmt.Errorf("Error retrieving Unit %s: %v", name, err) case suToGlobal(*u): return "", fmt.Errorf("Unable to connect to global unit %s.\n", name) case u == nil: return "",...
go
func (c *FleetClient) findUnit(name string) (machID string, err error) { u, err := c.Fleet.Unit(name) switch { case err != nil: return "", fmt.Errorf("Error retrieving Unit %s: %v", name, err) case suToGlobal(*u): return "", fmt.Errorf("Unable to connect to global unit %s.\n", name) case u == nil: return "",...
[ "func", "(", "c", "*", "FleetClient", ")", "findUnit", "(", "name", "string", ")", "(", "machID", "string", ",", "err", "error", ")", "{", "u", ",", "err", ":=", "c", ".", "Fleet", ".", "Unit", "(", "name", ")", "\n", "switch", "{", "case", "err"...
// findUnits returns the machine ID of a running unit
[ "findUnits", "returns", "the", "machine", "ID", "of", "a", "running", "unit" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/ssh.go#L152-L166
142,823
deis/deis
client/cmd/perms.go
PermsList
func PermsList(appID string, admin bool, results int) error { c, appID, err := permsLoad(appID, admin) if err != nil { return err } var users []string var count int if admin { if results == defaultLimit { results = c.ResponseLimit } users, count, err = perms.ListAdmins(c, results) } else { users,...
go
func PermsList(appID string, admin bool, results int) error { c, appID, err := permsLoad(appID, admin) if err != nil { return err } var users []string var count int if admin { if results == defaultLimit { results = c.ResponseLimit } users, count, err = perms.ListAdmins(c, results) } else { users,...
[ "func", "PermsList", "(", "appID", "string", ",", "admin", "bool", ",", "results", "int", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "permsLoad", "(", "appID", ",", "admin", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", ...
// PermsList prints which users have permissions.
[ "PermsList", "prints", "which", "users", "have", "permissions", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/perms.go#L13-L49
142,824
deis/deis
client/cmd/perms.go
PermCreate
func PermCreate(appID string, username string, admin bool) error { c, appID, err := permsLoad(appID, admin) if err != nil { return err } if admin { fmt.Printf("Adding %s to system administrators... ", username) err = perms.NewAdmin(c, username) } else { fmt.Printf("Adding %s to %s collaborators... ", us...
go
func PermCreate(appID string, username string, admin bool) error { c, appID, err := permsLoad(appID, admin) if err != nil { return err } if admin { fmt.Printf("Adding %s to system administrators... ", username) err = perms.NewAdmin(c, username) } else { fmt.Printf("Adding %s to %s collaborators... ", us...
[ "func", "PermCreate", "(", "appID", "string", ",", "username", "string", ",", "admin", "bool", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "permsLoad", "(", "appID", ",", "admin", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err...
// PermCreate adds a user to an app or makes them an administrator.
[ "PermCreate", "adds", "a", "user", "to", "an", "app", "or", "makes", "them", "an", "administrator", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/perms.go#L52-L75
142,825
deis/deis
client/cmd/perms.go
PermDelete
func PermDelete(appID string, username string, admin bool) error { c, appID, err := permsLoad(appID, admin) if err != nil { return err } if admin { fmt.Printf("Removing %s from system administrators... ", username) err = perms.DeleteAdmin(c, username) } else { fmt.Printf("Removing %s from %s collaborato...
go
func PermDelete(appID string, username string, admin bool) error { c, appID, err := permsLoad(appID, admin) if err != nil { return err } if admin { fmt.Printf("Removing %s from system administrators... ", username) err = perms.DeleteAdmin(c, username) } else { fmt.Printf("Removing %s from %s collaborato...
[ "func", "PermDelete", "(", "appID", "string", ",", "username", "string", ",", "admin", "bool", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "permsLoad", "(", "appID", ",", "admin", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err...
// PermDelete removes a user from an app or revokes admin privilages.
[ "PermDelete", "removes", "a", "user", "from", "an", "app", "or", "revokes", "admin", "privilages", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/perms.go#L78-L101
142,826
deis/deis
logger/storage/file/adapter.go
NewStorageAdapter
func NewStorageAdapter(logRoot string) (*adapter, error) { src, err := os.Stat(logRoot) if err != nil { return nil, fmt.Errorf("Directory %s does not exist", logRoot) } if !src.IsDir() { return nil, fmt.Errorf("%s is not a directory", logRoot) } return &adapter{logRoot: logRoot, files: make(map[string]*os.Fil...
go
func NewStorageAdapter(logRoot string) (*adapter, error) { src, err := os.Stat(logRoot) if err != nil { return nil, fmt.Errorf("Directory %s does not exist", logRoot) } if !src.IsDir() { return nil, fmt.Errorf("%s is not a directory", logRoot) } return &adapter{logRoot: logRoot, files: make(map[string]*os.Fil...
[ "func", "NewStorageAdapter", "(", "logRoot", "string", ")", "(", "*", "adapter", ",", "error", ")", "{", "src", ",", "err", ":=", "os", ".", "Stat", "(", "logRoot", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf...
// NewStorageAdapter returns a pointer to a new instance of a file-based storage.Adapter.
[ "NewStorageAdapter", "returns", "a", "pointer", "to", "a", "new", "instance", "of", "a", "file", "-", "based", "storage", ".", "Adapter", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/storage/file/adapter.go#L20-L29
142,827
deis/deis
logger/storage/file/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 file pointers so we can avoid // waiting for / obtaining a lock unnecessarily f, ok := a.files[app] if !ok { // Ensure only one goroutine at a time can be adding a file pointer to the map of f...
go
func (a *adapter) Write(app string, message string) error { // Check first if we might actually have to add to the map of file pointers so we can avoid // waiting for / obtaining a lock unnecessarily f, ok := a.files[app] if !ok { // Ensure only one goroutine at a time can be adding a file pointer to the map of f...
[ "func", "(", "a", "*", "adapter", ")", "Write", "(", "app", "string", ",", "message", "string", ")", "error", "{", "// Check first if we might actually have to add to the map of file pointers so we can avoid", "// waiting for / obtaining a lock unnecessarily", "f", ",", "ok",...
// Write adds a log message to to an app-specific log file
[ "Write", "adds", "a", "log", "message", "to", "to", "an", "app", "-", "specific", "log", "file" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/storage/file/adapter.go#L32-L55
142,828
deis/deis
logger/storage/file/adapter.go
Read
func (a *adapter) Read(app string, lines int) ([]string, error) { if lines <= 0 { return []string{}, nil } filePath := a.getFilePath(app) exists, err := fileExists(filePath) if err != nil { return nil, err } if !exists { return nil, fmt.Errorf("Could not find logs for '%s'", app) } logBytes, err := exec....
go
func (a *adapter) Read(app string, lines int) ([]string, error) { if lines <= 0 { return []string{}, nil } filePath := a.getFilePath(app) exists, err := fileExists(filePath) if err != nil { return nil, err } if !exists { return nil, fmt.Errorf("Could not find logs for '%s'", app) } logBytes, err := exec....
[ "func", "(", "a", "*", "adapter", ")", "Read", "(", "app", "string", ",", "lines", "int", ")", "(", "[", "]", "string", ",", "error", ")", "{", "if", "lines", "<=", "0", "{", "return", "[", "]", "string", "{", "}", ",", "nil", "\n", "}", "\n"...
// Read retrieves a specified number of log lines from an app-specific log file
[ "Read", "retrieves", "a", "specified", "number", "of", "log", "lines", "from", "an", "app", "-", "specific", "log", "file" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/storage/file/adapter.go#L58-L76
142,829
deis/deis
client/parser/perms.go
Perms
func Perms(argv []string) error { usage := ` Valid commands for perms: perms:list list permissions granted on an app perms:create create a new permission for a user perms:delete delete a permission for a user Use 'deis help perms:[command]' to learn more. ` switch argv[0] { case "perms...
go
func Perms(argv []string) error { usage := ` Valid commands for perms: perms:list list permissions granted on an app perms:create create a new permission for a user perms:delete delete a permission for a user Use 'deis help perms:[command]' to learn more. ` switch argv[0] { case "perms...
[ "func", "Perms", "(", "argv", "[", "]", "string", ")", "error", "{", "usage", ":=", "`\nValid commands for perms:\n\nperms:list list permissions granted on an app\nperms:create create a new permission for a user\nperms:delete delete a permission for a user\n\nUse...
// Perms routes perms commands to their specific function.
[ "Perms", "routes", "perms", "commands", "to", "their", "specific", "function", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/perms.go#L9-L39
142,830
deis/deis
client/parser/keys.go
Keys
func Keys(argv []string) error { usage := ` Valid commands for SSH keys: keys:list list SSH keys for the logged in user keys:add add an SSH key keys:remove remove an SSH key Use 'deis help [command]' to learn more. ` switch argv[0] { case "keys:list": return keysList(argv) case "keys:add": ...
go
func Keys(argv []string) error { usage := ` Valid commands for SSH keys: keys:list list SSH keys for the logged in user keys:add add an SSH key keys:remove remove an SSH key Use 'deis help [command]' to learn more. ` switch argv[0] { case "keys:list": return keysList(argv) case "keys:add": ...
[ "func", "Keys", "(", "argv", "[", "]", "string", ")", "error", "{", "usage", ":=", "`\nValid commands for SSH keys:\n\nkeys:list list SSH keys for the logged in user\nkeys:add add an SSH key\nkeys:remove remove an SSH key\n\nUse 'deis help [command]' to learn more.\n`", ...
// Keys routes key commands to the specific function.
[ "Keys", "routes", "key", "commands", "to", "the", "specific", "function", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/keys.go#L9-L40
142,831
deis/deis
client/cmd/limits.go
LimitsList
func LimitsList(appID string) error { c, appID, err := load(appID) if err != nil { return err } config, err := config.List(c, appID) fmt.Printf("=== %s Limits\n\n", appID) fmt.Println("--- Memory") if len(config.Memory) == 0 { fmt.Println("Unlimited") } else { memoryMap := make(map[string]string) f...
go
func LimitsList(appID string) error { c, appID, err := load(appID) if err != nil { return err } config, err := config.List(c, appID) fmt.Printf("=== %s Limits\n\n", appID) fmt.Println("--- Memory") if len(config.Memory) == 0 { fmt.Println("Unlimited") } else { memoryMap := make(map[string]string) f...
[ "func", "LimitsList", "(", "appID", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "config", ",", "err", ":=", "config", ".", ...
// LimitsList lists an app's limits.
[ "LimitsList", "lists", "an", "app", "s", "limits", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/limits.go#L15-L53
142,832
deis/deis
client/cmd/limits.go
LimitsSet
func LimitsSet(appID string, limits []string, limitType string) error { c, appID, err := load(appID) if err != nil { return err } limitsMap := parseLimits(limits) fmt.Print("Applying limits... ") quit := progress() configObj := api.Config{} if limitType == "cpu" { configObj.CPU = limitsMap } else { ...
go
func LimitsSet(appID string, limits []string, limitType string) error { c, appID, err := load(appID) if err != nil { return err } limitsMap := parseLimits(limits) fmt.Print("Applying limits... ") quit := progress() configObj := api.Config{} if limitType == "cpu" { configObj.CPU = limitsMap } else { ...
[ "func", "LimitsSet", "(", "appID", "string", ",", "limits", "[", "]", "string", ",", "limitType", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "...
// LimitsSet sets an app's limits.
[ "LimitsSet", "sets", "an", "app", "s", "limits", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/limits.go#L56-L88
142,833
deis/deis
client/cmd/limits.go
LimitsUnset
func LimitsUnset(appID string, limits []string, limitType string) error { c, appID, err := load(appID) if err != nil { return err } fmt.Print("Applying limits... ") quit := progress() configObj := api.Config{} valuesMap := make(map[string]interface{}) for _, limit := range limits { valuesMap[limit] = ...
go
func LimitsUnset(appID string, limits []string, limitType string) error { c, appID, err := load(appID) if err != nil { return err } fmt.Print("Applying limits... ") quit := progress() configObj := api.Config{} valuesMap := make(map[string]interface{}) for _, limit := range limits { valuesMap[limit] = ...
[ "func", "LimitsUnset", "(", "appID", "string", ",", "limits", "[", "]", "string", ",", "limitType", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", ...
// LimitsUnset removes an app's limits.
[ "LimitsUnset", "removes", "an", "app", "s", "limits", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/limits.go#L91-L128
142,834
deis/deis
client/controller/models/auth/auth.go
Register
func Register(c *client.Client, username, password, email string) error { user := api.AuthRegisterRequest{Username: username, Password: password, Email: email} body, err := json.Marshal(user) if err != nil { return err } _, err = c.BasicRequest("POST", "/v1/auth/register/", body) return err }
go
func Register(c *client.Client, username, password, email string) error { user := api.AuthRegisterRequest{Username: username, Password: password, Email: email} body, err := json.Marshal(user) if err != nil { return err } _, err = c.BasicRequest("POST", "/v1/auth/register/", body) return err }
[ "func", "Register", "(", "c", "*", "client", ".", "Client", ",", "username", ",", "password", ",", "email", "string", ")", "error", "{", "user", ":=", "api", ".", "AuthRegisterRequest", "{", "Username", ":", "username", ",", "Password", ":", "password", ...
// Register a new user with the controller.
[ "Register", "a", "new", "user", "with", "the", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/auth/auth.go#L11-L21
142,835
deis/deis
client/controller/models/auth/auth.go
Regenerate
func Regenerate(c *client.Client, username string, all bool) (string, error) { var reqBody []byte var err error if all == true { reqBody, err = json.Marshal(api.AuthRegenerateRequest{All: all}) } else if username != "" { reqBody, err = json.Marshal(api.AuthRegenerateRequest{Name: username}) } if err != nil ...
go
func Regenerate(c *client.Client, username string, all bool) (string, error) { var reqBody []byte var err error if all == true { reqBody, err = json.Marshal(api.AuthRegenerateRequest{All: all}) } else if username != "" { reqBody, err = json.Marshal(api.AuthRegenerateRequest{Name: username}) } if err != nil ...
[ "func", "Regenerate", "(", "c", "*", "client", ".", "Client", ",", "username", "string", ",", "all", "bool", ")", "(", "string", ",", "error", ")", "{", "var", "reqBody", "[", "]", "byte", "\n", "var", "err", "error", "\n\n", "if", "all", "==", "tr...
// Regenerate user's auth tokens.
[ "Regenerate", "user", "s", "auth", "tokens", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/auth/auth.go#L65-L95
142,836
deis/deis
client/controller/models/apps/apps.go
List
func List(c *client.Client, results int) (api.Apps, int, error) { body, count, err := c.LimitedRequest("/v1/apps/", results) if err != nil { return []api.App{}, -1, err } var apps []api.App if err = json.Unmarshal([]byte(body), &apps); err != nil { return []api.App{}, -1, err } return apps, count, nil }
go
func List(c *client.Client, results int) (api.Apps, int, error) { body, count, err := c.LimitedRequest("/v1/apps/", results) if err != nil { return []api.App{}, -1, err } var apps []api.App if err = json.Unmarshal([]byte(body), &apps); err != nil { return []api.App{}, -1, err } return apps, count, nil }
[ "func", "List", "(", "c", "*", "client", ".", "Client", ",", "results", "int", ")", "(", "api", ".", "Apps", ",", "int", ",", "error", ")", "{", "body", ",", "count", ",", "err", ":=", "c", ".", "LimitedRequest", "(", "\"", "\"", ",", "results", ...
// List lists apps on a Deis controller.
[ "List", "lists", "apps", "on", "a", "Deis", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/apps/apps.go#L14-L27
142,837
deis/deis
client/controller/models/apps/apps.go
New
func New(c *client.Client, id string) (api.App, error) { body := []byte{} var err error if id != "" { req := api.AppCreateRequest{ID: id} body, err = json.Marshal(req) if err != nil { return api.App{}, err } } resBody, err := c.BasicRequest("POST", "/v1/apps/", body) if err != nil { return api.Ap...
go
func New(c *client.Client, id string) (api.App, error) { body := []byte{} var err error if id != "" { req := api.AppCreateRequest{ID: id} body, err = json.Marshal(req) if err != nil { return api.App{}, err } } resBody, err := c.BasicRequest("POST", "/v1/apps/", body) if err != nil { return api.Ap...
[ "func", "New", "(", "c", "*", "client", ".", "Client", ",", "id", "string", ")", "(", "api", ".", "App", ",", "error", ")", "{", "body", ":=", "[", "]", "byte", "{", "}", "\n\n", "var", "err", "error", "\n", "if", "id", "!=", "\"", "\"", "{",...
// New creates a new app.
[ "New", "creates", "a", "new", "app", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/apps/apps.go#L30-L55
142,838
deis/deis
client/controller/models/apps/apps.go
Get
func Get(c *client.Client, appID string) (api.App, error) { u := fmt.Sprintf("/v1/apps/%s/", appID) body, err := c.BasicRequest("GET", u, nil) if err != nil { return api.App{}, err } app := api.App{} if err = json.Unmarshal([]byte(body), &app); err != nil { return api.App{}, err } return app, nil }
go
func Get(c *client.Client, appID string) (api.App, error) { u := fmt.Sprintf("/v1/apps/%s/", appID) body, err := c.BasicRequest("GET", u, nil) if err != nil { return api.App{}, err } app := api.App{} if err = json.Unmarshal([]byte(body), &app); err != nil { return api.App{}, err } return app, nil }
[ "func", "Get", "(", "c", "*", "client", ".", "Client", ",", "appID", "string", ")", "(", "api", ".", "App", ",", "error", ")", "{", "u", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "appID", ")", "\n\n", "body", ",", "err", ":=", "c", "...
// Get app details from a Deis controller.
[ "Get", "app", "details", "from", "a", "Deis", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/apps/apps.go#L58-L74
142,839
deis/deis
client/controller/models/apps/apps.go
Logs
func Logs(c *client.Client, appID string, lines int) (string, error) { u := fmt.Sprintf("/v1/apps/%s/logs", appID) if lines > 0 { u += "?log_lines=" + strconv.Itoa(lines) } body, err := c.BasicRequest("GET", u, nil) if err != nil { return "", err } return strings.Trim(body, `"`), nil }
go
func Logs(c *client.Client, appID string, lines int) (string, error) { u := fmt.Sprintf("/v1/apps/%s/logs", appID) if lines > 0 { u += "?log_lines=" + strconv.Itoa(lines) } body, err := c.BasicRequest("GET", u, nil) if err != nil { return "", err } return strings.Trim(body, `"`), nil }
[ "func", "Logs", "(", "c", "*", "client", ".", "Client", ",", "appID", "string", ",", "lines", "int", ")", "(", "string", ",", "error", ")", "{", "u", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "appID", ")", "\n\n", "if", "lines", ">", "...
// Logs retrieves logs from an app.
[ "Logs", "retrieves", "logs", "from", "an", "app", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/apps/apps.go#L77-L91
142,840
deis/deis
client/controller/models/apps/apps.go
Run
func Run(c *client.Client, appID string, command string) (api.AppRunResponse, error) { req := api.AppRunRequest{Command: command} body, err := json.Marshal(req) if err != nil { return api.AppRunResponse{}, err } u := fmt.Sprintf("/v1/apps/%s/run", appID) resBody, err := c.BasicRequest("POST", u, body) if e...
go
func Run(c *client.Client, appID string, command string) (api.AppRunResponse, error) { req := api.AppRunRequest{Command: command} body, err := json.Marshal(req) if err != nil { return api.AppRunResponse{}, err } u := fmt.Sprintf("/v1/apps/%s/run", appID) resBody, err := c.BasicRequest("POST", u, body) if e...
[ "func", "Run", "(", "c", "*", "client", ".", "Client", ",", "appID", "string", ",", "command", "string", ")", "(", "api", ".", "AppRunResponse", ",", "error", ")", "{", "req", ":=", "api", ".", "AppRunRequest", "{", "Command", ":", "command", "}", "\...
// Run one time command in an app.
[ "Run", "one", "time", "command", "in", "an", "app", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/apps/apps.go#L94-L117
142,841
deis/deis
deisctl/backend/fleet/fleet.go
NewClient
func NewClient(cb config.Backend) (*FleetClient, error) { client, err := getRegistryClient() if err != nil { return nil, err } // path hierarchy for finding systemd service templates templatePaths := []string{ os.Getenv("DEISCTL_UNITS"), path.Join(os.Getenv("HOME"), ".deis", "units"), "/var/lib/deis/units...
go
func NewClient(cb config.Backend) (*FleetClient, error) { client, err := getRegistryClient() if err != nil { return nil, err } // path hierarchy for finding systemd service templates templatePaths := []string{ os.Getenv("DEISCTL_UNITS"), path.Join(os.Getenv("HOME"), ".deis", "units"), "/var/lib/deis/units...
[ "func", "NewClient", "(", "cb", "config", ".", "Backend", ")", "(", "*", "FleetClient", ",", "error", ")", "{", "client", ",", "err", ":=", "getRegistryClient", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", ...
// NewClient returns a client used to communicate with Fleet // using the Registry API
[ "NewClient", "returns", "a", "client", "used", "to", "communicate", "with", "Fleet", "using", "the", "Registry", "API" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/fleet.go#L31-L49
142,842
deis/deis
publisher/server/publisher.go
New
func New(dockerClient *docker.Client, etcdClient *etcd.Client, host, logLevel string) *Server { return &Server{ DockerClient: dockerClient, EtcdClient: etcdClient, host: host, logLevel: logLevel, } }
go
func New(dockerClient *docker.Client, etcdClient *etcd.Client, host, logLevel string) *Server { return &Server{ DockerClient: dockerClient, EtcdClient: etcdClient, host: host, logLevel: logLevel, } }
[ "func", "New", "(", "dockerClient", "*", "docker", ".", "Client", ",", "etcdClient", "*", "etcd", ".", "Client", ",", "host", ",", "logLevel", "string", ")", "*", "Server", "{", "return", "&", "Server", "{", "DockerClient", ":", "dockerClient", ",", "Etc...
// New returns a new instance of Server.
[ "New", "returns", "a", "new", "instance", "of", "Server", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L37-L44
142,843
deis/deis
publisher/server/publisher.go
Listen
func (s *Server) Listen(ttl time.Duration) { listener := make(chan *docker.APIEvents) // TODO: figure out why we need to sleep for 10 milliseconds // https://github.com/fsouza/go-dockerclient/blob/0236a64c6c4bd563ec277ba00e370cc753e1677c/event_test.go#L43 defer func() { time.Sleep(10 * time.Millisecond); s.DockerCl...
go
func (s *Server) Listen(ttl time.Duration) { listener := make(chan *docker.APIEvents) // TODO: figure out why we need to sleep for 10 milliseconds // https://github.com/fsouza/go-dockerclient/blob/0236a64c6c4bd563ec277ba00e370cc753e1677c/event_test.go#L43 defer func() { time.Sleep(10 * time.Millisecond); s.DockerCl...
[ "func", "(", "s", "*", "Server", ")", "Listen", "(", "ttl", "time", ".", "Duration", ")", "{", "listener", ":=", "make", "(", "chan", "*", "docker", ".", "APIEvents", ")", "\n", "// TODO: figure out why we need to sleep for 10 milliseconds", "// https://github.com...
// Listen adds an event listener to the docker client and publishes containers that were started.
[ "Listen", "adds", "an", "event", "listener", "to", "the", "docker", "client", "and", "publishes", "containers", "that", "were", "started", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L47-L70
142,844
deis/deis
publisher/server/publisher.go
Poll
func (s *Server) Poll(ttl time.Duration) { containers, err := s.DockerClient.ListContainers(docker.ListContainersOptions{}) if err != nil { log.Fatal(err) } var wg sync.WaitGroup for _, container := range containers { wg.Add(1) go func(container docker.APIContainers, ttl time.Duration) { defer wg.Done() ...
go
func (s *Server) Poll(ttl time.Duration) { containers, err := s.DockerClient.ListContainers(docker.ListContainersOptions{}) if err != nil { log.Fatal(err) } var wg sync.WaitGroup for _, container := range containers { wg.Add(1) go func(container docker.APIContainers, ttl time.Duration) { defer wg.Done() ...
[ "func", "(", "s", "*", "Server", ")", "Poll", "(", "ttl", "time", ".", "Duration", ")", "{", "containers", ",", "err", ":=", "s", ".", "DockerClient", ".", "ListContainers", "(", "docker", ".", "ListContainersOptions", "{", "}", ")", "\n", "if", "err",...
// Poll lists all containers from the docker client every time the TTL comes up and publishes them to etcd
[ "Poll", "lists", "all", "containers", "from", "the", "docker", "client", "every", "time", "the", "TTL", "comes", "up", "and", "publishes", "them", "to", "etcd" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L73-L89
142,845
deis/deis
publisher/server/publisher.go
getContainer
func (s *Server) getContainer(id string) (*docker.APIContainers, error) { containers, err := s.DockerClient.ListContainers(docker.ListContainersOptions{}) if err != nil { return nil, err } for _, container := range containers { // send container to channel for processing if container.ID == id { return &con...
go
func (s *Server) getContainer(id string) (*docker.APIContainers, error) { containers, err := s.DockerClient.ListContainers(docker.ListContainersOptions{}) if err != nil { return nil, err } for _, container := range containers { // send container to channel for processing if container.ID == id { return &con...
[ "func", "(", "s", "*", "Server", ")", "getContainer", "(", "id", "string", ")", "(", "*", "docker", ".", "APIContainers", ",", "error", ")", "{", "containers", ",", "err", ":=", "s", ".", "DockerClient", ".", "ListContainers", "(", "docker", ".", "List...
// getContainer retrieves a container from the docker client based on id
[ "getContainer", "retrieves", "a", "container", "from", "the", "docker", "client", "based", "on", "id" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L92-L104
142,846
deis/deis
publisher/server/publisher.go
publishContainer
func (s *Server) publishContainer(container *docker.APIContainers, ttl time.Duration) { r := regexp.MustCompile(appNameRegex) for _, name := range container.Names { // HACK: remove slash from container name // see https://github.com/docker/docker/issues/7519 containerName := name[1:] match := r.FindStringSubm...
go
func (s *Server) publishContainer(container *docker.APIContainers, ttl time.Duration) { r := regexp.MustCompile(appNameRegex) for _, name := range container.Names { // HACK: remove slash from container name // see https://github.com/docker/docker/issues/7519 containerName := name[1:] match := r.FindStringSubm...
[ "func", "(", "s", "*", "Server", ")", "publishContainer", "(", "container", "*", "docker", ".", "APIContainers", ",", "ttl", "time", ".", "Duration", ")", "{", "r", ":=", "regexp", ".", "MustCompile", "(", "appNameRegex", ")", "\n", "for", "_", ",", "n...
// publishContainer publishes the docker container to etcd.
[ "publishContainer", "publishes", "the", "docker", "container", "to", "etcd", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L107-L165
142,847
deis/deis
publisher/server/publisher.go
removeContainer
func (s *Server) removeContainer(event string) { safeMap.RLock() appPath := safeMap.data[event] safeMap.RUnlock() if appPath != "" { keyPath := fmt.Sprintf("/deis/services/%s", appPath) log.Printf("stopped %s\n", keyPath) s.removeEtcd(keyPath, false) } }
go
func (s *Server) removeContainer(event string) { safeMap.RLock() appPath := safeMap.data[event] safeMap.RUnlock() if appPath != "" { keyPath := fmt.Sprintf("/deis/services/%s", appPath) log.Printf("stopped %s\n", keyPath) s.removeEtcd(keyPath, false) } }
[ "func", "(", "s", "*", "Server", ")", "removeContainer", "(", "event", "string", ")", "{", "safeMap", ".", "RLock", "(", ")", "\n", "appPath", ":=", "safeMap", ".", "data", "[", "event", "]", "\n", "safeMap", ".", "RUnlock", "(", ")", "\n\n", "if", ...
// removeContainer remove a container published by this component
[ "removeContainer", "remove", "a", "container", "published", "by", "this", "component" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L168-L178
142,848
deis/deis
publisher/server/publisher.go
IsPublishableApp
func (s *Server) IsPublishableApp(name string) bool { r := regexp.MustCompile(appNameRegex) match := r.FindStringSubmatch(name) if match == nil { return false } appName := match[1] version, err := strconv.Atoi(match[2]) if err != nil { log.Println(err) return false } if version >= latestRunningVersion(s...
go
func (s *Server) IsPublishableApp(name string) bool { r := regexp.MustCompile(appNameRegex) match := r.FindStringSubmatch(name) if match == nil { return false } appName := match[1] version, err := strconv.Atoi(match[2]) if err != nil { log.Println(err) return false } if version >= latestRunningVersion(s...
[ "func", "(", "s", "*", "Server", ")", "IsPublishableApp", "(", "name", "string", ")", "bool", "{", "r", ":=", "regexp", ".", "MustCompile", "(", "appNameRegex", ")", "\n", "match", ":=", "r", ".", "FindStringSubmatch", "(", "name", ")", "\n", "if", "ma...
// IsPublishableApp determines if the application should be published to etcd.
[ "IsPublishableApp", "determines", "if", "the", "application", "should", "be", "published", "to", "etcd", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L181-L198
142,849
deis/deis
publisher/server/publisher.go
IsPortOpen
func (s *Server) IsPortOpen(hostAndPort string) bool { portOpen := false conn, err := net.Dial("tcp", hostAndPort) if err == nil { portOpen = true defer conn.Close() } return portOpen }
go
func (s *Server) IsPortOpen(hostAndPort string) bool { portOpen := false conn, err := net.Dial("tcp", hostAndPort) if err == nil { portOpen = true defer conn.Close() } return portOpen }
[ "func", "(", "s", "*", "Server", ")", "IsPortOpen", "(", "hostAndPort", "string", ")", "bool", "{", "portOpen", ":=", "false", "\n", "conn", ",", "err", ":=", "net", ".", "Dial", "(", "\"", "\"", ",", "hostAndPort", ")", "\n", "if", "err", "==", "n...
// IsPortOpen checks if the given port is accepting tcp connections
[ "IsPortOpen", "checks", "if", "the", "given", "port", "is", "accepting", "tcp", "connections" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L201-L209
142,850
deis/deis
publisher/server/publisher.go
max
func max(n []int) int { val := 0 for _, i := range n { if i > val { val = i } } return val }
go
func max(n []int) int { val := 0 for _, i := range n { if i > val { val = i } } return val }
[ "func", "max", "(", "n", "[", "]", "int", ")", "int", "{", "val", ":=", "0", "\n", "for", "_", ",", "i", ":=", "range", "n", "{", "if", "i", ">", "val", "{", "val", "=", "i", "\n", "}", "\n", "}", "\n", "return", "val", "\n", "}" ]
// max returns the maximum value in n
[ "max", "returns", "the", "maximum", "value", "in", "n" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L262-L270
142,851
deis/deis
publisher/server/publisher.go
getEtcd
func (s *Server) getEtcd(key string) string { if s.logLevel == "debug" { log.Println("get", key) } resp, err := s.EtcdClient.Get(key, false, false) if err != nil { return "" } if resp != nil && resp.Node != nil { return resp.Node.Value } return "" }
go
func (s *Server) getEtcd(key string) string { if s.logLevel == "debug" { log.Println("get", key) } resp, err := s.EtcdClient.Get(key, false, false) if err != nil { return "" } if resp != nil && resp.Node != nil { return resp.Node.Value } return "" }
[ "func", "(", "s", "*", "Server", ")", "getEtcd", "(", "key", "string", ")", "string", "{", "if", "s", ".", "logLevel", "==", "\"", "\"", "{", "log", ".", "Println", "(", "\"", "\"", ",", "key", ")", "\n", "}", "\n", "resp", ",", "err", ":=", ...
// getEtcd retrieves the etcd key's value. Returns an empty string if the key was not found.
[ "getEtcd", "retrieves", "the", "etcd", "key", "s", "value", ".", "Returns", "an", "empty", "string", "if", "the", "key", "was", "not", "found", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L273-L285
142,852
deis/deis
publisher/server/publisher.go
setEtcd
func (s *Server) setEtcd(key, value string, ttl uint64) { if _, err := s.EtcdClient.Set(key, value, ttl); err != nil { log.Println(err) } if s.logLevel == "debug" { log.Println("set", key, "->", value) } }
go
func (s *Server) setEtcd(key, value string, ttl uint64) { if _, err := s.EtcdClient.Set(key, value, ttl); err != nil { log.Println(err) } if s.logLevel == "debug" { log.Println("set", key, "->", value) } }
[ "func", "(", "s", "*", "Server", ")", "setEtcd", "(", "key", ",", "value", "string", ",", "ttl", "uint64", ")", "{", "if", "_", ",", "err", ":=", "s", ".", "EtcdClient", ".", "Set", "(", "key", ",", "value", ",", "ttl", ")", ";", "err", "!=", ...
// setEtcd sets the corresponding etcd key with the value and ttl
[ "setEtcd", "sets", "the", "corresponding", "etcd", "key", "with", "the", "value", "and", "ttl" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L288-L295
142,853
deis/deis
publisher/server/publisher.go
removeEtcd
func (s *Server) removeEtcd(key string, recursive bool) { if _, err := s.EtcdClient.Delete(key, recursive); err != nil { log.Println(err) } if s.logLevel == "debug" { log.Println("del", key) } }
go
func (s *Server) removeEtcd(key string, recursive bool) { if _, err := s.EtcdClient.Delete(key, recursive); err != nil { log.Println(err) } if s.logLevel == "debug" { log.Println("del", key) } }
[ "func", "(", "s", "*", "Server", ")", "removeEtcd", "(", "key", "string", ",", "recursive", "bool", ")", "{", "if", "_", ",", "err", ":=", "s", ".", "EtcdClient", ".", "Delete", "(", "key", ",", "recursive", ")", ";", "err", "!=", "nil", "{", "lo...
// removeEtcd removes the corresponding etcd key
[ "removeEtcd", "removes", "the", "corresponding", "etcd", "key" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/publisher/server/publisher.go#L298-L305
142,854
deis/deis
client/controller/models/perms/perms.go
Delete
func Delete(c *client.Client, appID string, username string) error { return doDelete(c, fmt.Sprintf("/v1/apps/%s/perms/%s", appID, username)) }
go
func Delete(c *client.Client, appID string, username string) error { return doDelete(c, fmt.Sprintf("/v1/apps/%s/perms/%s", appID, username)) }
[ "func", "Delete", "(", "c", "*", "client", ".", "Client", ",", "appID", "string", ",", "username", "string", ")", "error", "{", "return", "doDelete", "(", "c", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "appID", ",", "username", ")", ")", "\...
// Delete removes a user from an app.
[ "Delete", "removes", "a", "user", "from", "an", "app", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/perms/perms.go#L78-L80
142,855
deis/deis
client/controller/models/perms/perms.go
DeleteAdmin
func DeleteAdmin(c *client.Client, username string) error { return doDelete(c, fmt.Sprintf("/v1/admin/perms/%s", username)) }
go
func DeleteAdmin(c *client.Client, username string) error { return doDelete(c, fmt.Sprintf("/v1/admin/perms/%s", username)) }
[ "func", "DeleteAdmin", "(", "c", "*", "client", ".", "Client", ",", "username", "string", ")", "error", "{", "return", "doDelete", "(", "c", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "username", ")", ")", "\n", "}" ]
// DeleteAdmin removes administrative privilages from a user.
[ "DeleteAdmin", "removes", "administrative", "privilages", "from", "a", "user", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/perms/perms.go#L83-L85
142,856
deis/deis
client/cmd/utils.go
chooseColor
func chooseColor(input string) string { var sum uint8 for _, char := range []byte(input) { sum += uint8(char) } // Seven possible terminal colors color := (sum % 7) + 1 if color == 7 { color = 9 } return fmt.Sprintf("\033[3%dm", color) }
go
func chooseColor(input string) string { var sum uint8 for _, char := range []byte(input) { sum += uint8(char) } // Seven possible terminal colors color := (sum % 7) + 1 if color == 7 { color = 9 } return fmt.Sprintf("\033[3%dm", color) }
[ "func", "chooseColor", "(", "input", "string", ")", "string", "{", "var", "sum", "uint8", "\n\n", "for", "_", ",", "char", ":=", "range", "[", "]", "byte", "(", "input", ")", "{", "sum", "+=", "uint8", "(", "char", ")", "\n", "}", "\n\n", "// Seven...
// Choose an ANSI color by converting a string to an int.
[ "Choose", "an", "ANSI", "color", "by", "converting", "a", "string", "to", "an", "int", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/utils.go#L39-L54
142,857
deis/deis
deisctl/deisctl.go
removeGlobalArgs
func removeGlobalArgs(argv []string) []string { var v []string for _, a := range argv { if !isGlobalArg(a) { v = append(v, a) } } return v }
go
func removeGlobalArgs(argv []string) []string { var v []string for _, a := range argv { if !isGlobalArg(a) { v = append(v, a) } } return v }
[ "func", "removeGlobalArgs", "(", "argv", "[", "]", "string", ")", "[", "]", "string", "{", "var", "v", "[", "]", "string", "\n", "for", "_", ",", "a", ":=", "range", "argv", "{", "if", "!", "isGlobalArg", "(", "a", ")", "{", "v", "=", "append", ...
// removeGlobalArgs returns the given args without any global option flags, to make // re-parsing by subcommands easier.
[ "removeGlobalArgs", "returns", "the", "given", "args", "without", "any", "global", "option", "flags", "to", "make", "re", "-", "parsing", "by", "subcommands", "easier", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/deisctl.go#L204-L212
142,858
deis/deis
deisctl/deisctl.go
setGlobalFlags
func setGlobalFlags(args map[string]interface{}, setTunnel bool) { fleet.Flags.Endpoint = args["--endpoint"].(string) fleet.Flags.EtcdKeyPrefix = args["--etcd-key-prefix"].(string) fleet.Flags.EtcdKeyFile = args["--etcd-keyfile"].(string) fleet.Flags.EtcdCertFile = args["--etcd-certfile"].(string) fleet.Flags.Etcd...
go
func setGlobalFlags(args map[string]interface{}, setTunnel bool) { fleet.Flags.Endpoint = args["--endpoint"].(string) fleet.Flags.EtcdKeyPrefix = args["--etcd-key-prefix"].(string) fleet.Flags.EtcdKeyFile = args["--etcd-keyfile"].(string) fleet.Flags.EtcdCertFile = args["--etcd-certfile"].(string) fleet.Flags.Etcd...
[ "func", "setGlobalFlags", "(", "args", "map", "[", "string", "]", "interface", "{", "}", ",", "setTunnel", "bool", ")", "{", "fleet", ".", "Flags", ".", "Endpoint", "=", "args", "[", "\"", "\"", "]", ".", "(", "string", ")", "\n", "fleet", ".", "Fl...
// setGlobalFlags sets fleet provider options based on deisctl global flags.
[ "setGlobalFlags", "sets", "fleet", "provider", "options", "based", "on", "deisctl", "global", "flags", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/deisctl.go#L215-L236
142,859
deis/deis
deisctl/backend/fleet/utils.go
expandTargets
func (c *FleetClient) expandTargets(targets []string) (expandedTargets []string, err error) { for _, t := range targets { // ensure unit name starts with "deis-" if !strings.HasPrefix(t, "deis-") { t = "deis-" + t } if strings.HasSuffix(t, "@*") { var targets []string targets, err = c.Units(strings.Tr...
go
func (c *FleetClient) expandTargets(targets []string) (expandedTargets []string, err error) { for _, t := range targets { // ensure unit name starts with "deis-" if !strings.HasPrefix(t, "deis-") { t = "deis-" + t } if strings.HasSuffix(t, "@*") { var targets []string targets, err = c.Units(strings.Tr...
[ "func", "(", "c", "*", "FleetClient", ")", "expandTargets", "(", "targets", "[", "]", "string", ")", "(", "expandedTargets", "[", "]", "string", ",", "err", "error", ")", "{", "for", "_", ",", "t", ":=", "range", "targets", "{", "// ensure unit name star...
// expand a target to all installed units
[ "expand", "a", "target", "to", "all", "installed", "units" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/utils.go#L89-L108
142,860
deis/deis
deisctl/backend/fleet/utils.go
randomValue
func randomValue(src []string) string { s := rand.NewSource(int64(time.Now().Unix())) r := rand.New(s) idx := r.Intn(len(src)) return src[idx] }
go
func randomValue(src []string) string { s := rand.NewSource(int64(time.Now().Unix())) r := rand.New(s) idx := r.Intn(len(src)) return src[idx] }
[ "func", "randomValue", "(", "src", "[", "]", "string", ")", "string", "{", "s", ":=", "rand", ".", "NewSource", "(", "int64", "(", "time", ".", "Now", "(", ")", ".", "Unix", "(", ")", ")", ")", "\n", "r", ":=", "rand", ".", "New", "(", "s", "...
// randomValue returns a random string from a slice of string
[ "randomValue", "returns", "a", "random", "string", "from", "a", "slice", "of", "string" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/utils.go#L111-L116
142,861
deis/deis
client/pkg/webbrowser/webbrowser_darwin.go
Webbrowser
func Webbrowser(u string) (err error) { _, err = exec.Command("open", u).Output() return }
go
func Webbrowser(u string) (err error) { _, err = exec.Command("open", u).Output() return }
[ "func", "Webbrowser", "(", "u", "string", ")", "(", "err", "error", ")", "{", "_", ",", "err", "=", "exec", ".", "Command", "(", "\"", "\"", ",", "u", ")", ".", "Output", "(", ")", "\n", "return", "\n", "}" ]
// Webbrowser opens a url with the default browser.
[ "Webbrowser", "opens", "a", "url", "with", "the", "default", "browser", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/pkg/webbrowser/webbrowser_darwin.go#L8-L11
142,862
deis/deis
client/cmd/git.go
GitRemote
func GitRemote(appID, remote string) error { c, appID, err := load(appID) if err != nil { return err } return git.CreateRemote(c.ControllerURL.Host, remote, appID) }
go
func GitRemote(appID, remote string) error { c, appID, err := load(appID) if err != nil { return err } return git.CreateRemote(c.ControllerURL.Host, remote, appID) }
[ "func", "GitRemote", "(", "appID", ",", "remote", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "git", ".", "CreateR...
// GitRemote creates a git remote for a deis app.
[ "GitRemote", "creates", "a", "git", "remote", "for", "a", "deis", "app", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/git.go#L8-L16
142,863
deis/deis
client/cmd/ps.go
PsList
func PsList(appID string, results int) error { c, appID, err := load(appID) if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } processes, count, err := ps.List(c, appID, results) if err != nil { return err } printProcesses(appID, processes, count) return nil }
go
func PsList(appID string, results int) error { c, appID, err := load(appID) if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } processes, count, err := ps.List(c, appID, results) if err != nil { return err } printProcesses(appID, processes, count) return nil }
[ "func", "PsList", "(", "appID", "string", ",", "results", "int", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "results", "==", ...
// PsList lists an app's processes.
[ "PsList", "lists", "an", "app", "s", "processes", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/ps.go#L16-L36
142,864
deis/deis
client/cmd/ps.go
PsScale
func PsScale(appID string, targets []string) error { c, appID, err := load(appID) if err != nil { return err } targetMap := make(map[string]int) regex := regexp.MustCompile("^([A-z]+)=([0-9]+)$") for _, target := range targets { if regex.MatchString(target) { captures := regex.FindStringSubmatch(target)...
go
func PsScale(appID string, targets []string) error { c, appID, err := load(appID) if err != nil { return err } targetMap := make(map[string]int) regex := regexp.MustCompile("^([A-z]+)=([0-9]+)$") for _, target := range targets { if regex.MatchString(target) { captures := regex.FindStringSubmatch(target)...
[ "func", "PsScale", "(", "appID", "string", ",", "targets", "[", "]", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "targetMap"...
// PsScale scales an app's processes.
[ "PsScale", "scales", "an", "app", "s", "processes", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/ps.go#L39-L85
142,865
deis/deis
client/cmd/ps.go
PsRestart
func PsRestart(appID, target string) error { c, appID, err := load(appID) if err != nil { return err } psType := "" psNum := -1 if target != "" { if strings.Contains(target, ".") { parts := strings.Split(target, ".") psType = parts[0] psNum, err = strconv.Atoi(parts[1]) if err != nil { ret...
go
func PsRestart(appID, target string) error { c, appID, err := load(appID) if err != nil { return err } psType := "" psNum := -1 if target != "" { if strings.Contains(target, ".") { parts := strings.Split(target, ".") psType = parts[0] psNum, err = strconv.Atoi(parts[1]) if err != nil { ret...
[ "func", "PsRestart", "(", "appID", ",", "target", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "psType", ":=", "\"", "\"", ...
// PsRestart restarts an app's processes.
[ "PsRestart", "restarts", "an", "app", "s", "processes", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/ps.go#L88-L135
142,866
deis/deis
deisctl/backend/fleet/list_units.go
ListUnits
func (c *FleetClient) ListUnits() (err error) { var states []*schema.UnitState unitStates, err := c.Fleet.UnitStates() if err != nil { return err } for _, us := range unitStates { for _, prefix := range units.Names { if strings.HasPrefix(us.Name, prefix) { states = append(states, us) break } ...
go
func (c *FleetClient) ListUnits() (err error) { var states []*schema.UnitState unitStates, err := c.Fleet.UnitStates() if err != nil { return err } for _, us := range unitStates { for _, prefix := range units.Names { if strings.HasPrefix(us.Name, prefix) { states = append(states, us) break } ...
[ "func", "(", "c", "*", "FleetClient", ")", "ListUnits", "(", ")", "(", "err", "error", ")", "{", "var", "states", "[", "]", "*", "schema", ".", "UnitState", "\n\n", "unitStates", ",", "err", ":=", "c", ".", "Fleet", ".", "UnitStates", "(", ")", "\n...
// ListUnits prints all Deis-related units to Stdout
[ "ListUnits", "prints", "all", "Deis", "-", "related", "units", "to", "Stdout" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/list_units.go#L68-L86
142,867
deis/deis
client/controller/models/ps/ps.go
Scale
func Scale(c *client.Client, appID string, targets map[string]int) error { u := fmt.Sprintf("/v1/apps/%s/scale/", appID) body, err := json.Marshal(targets) if err != nil { return err } _, err = c.BasicRequest("POST", u, body) return err }
go
func Scale(c *client.Client, appID string, targets map[string]int) error { u := fmt.Sprintf("/v1/apps/%s/scale/", appID) body, err := json.Marshal(targets) if err != nil { return err } _, err = c.BasicRequest("POST", u, body) return err }
[ "func", "Scale", "(", "c", "*", "client", ".", "Client", ",", "appID", "string", ",", "targets", "map", "[", "string", "]", "int", ")", "error", "{", "u", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "appID", ")", "\n\n", "body", ",", "err"...
// Scale an app's processes.
[ "Scale", "an", "app", "s", "processes", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/ps/ps.go#L30-L41
142,868
deis/deis
client/controller/models/ps/ps.go
Restart
func Restart(c *client.Client, appID string, procType string, num int) ([]api.Process, error) { u := fmt.Sprintf("/v1/apps/%s/containers/", appID) if procType == "" { u += "restart/" } else { if num == -1 { u += procType + "/restart/" } else { u += procType + "/" + strconv.Itoa(num) + "/restart/" } }...
go
func Restart(c *client.Client, appID string, procType string, num int) ([]api.Process, error) { u := fmt.Sprintf("/v1/apps/%s/containers/", appID) if procType == "" { u += "restart/" } else { if num == -1 { u += procType + "/restart/" } else { u += procType + "/" + strconv.Itoa(num) + "/restart/" } }...
[ "func", "Restart", "(", "c", "*", "client", ".", "Client", ",", "appID", "string", ",", "procType", "string", ",", "num", "int", ")", "(", "[", "]", "api", ".", "Process", ",", "error", ")", "{", "u", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"",...
// Restart an app's processes.
[ "Restart", "an", "app", "s", "processes", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/controller/models/ps/ps.go#L44-L69
142,869
deis/deis
contrib/bumpver/bump.go
Command
func Command(argv []string) (returnCode int) { usage := ` Updates the current semantic version number to a new one in the specified source and doc files. Usage: bumpver [-f <current>] <version> <files>... Options: -f --from=<current> An explicit version string to replace. Otherwise, use t...
go
func Command(argv []string) (returnCode int) { usage := ` Updates the current semantic version number to a new one in the specified source and doc files. Usage: bumpver [-f <current>] <version> <files>... Options: -f --from=<current> An explicit version string to replace. Otherwise, use t...
[ "func", "Command", "(", "argv", "[", "]", "string", ")", "(", "returnCode", "int", ")", "{", "usage", ":=", "`\nUpdates the current semantic version number to a new one in the specified\nsource and doc files.\n\nUsage:\n bumpver [-f <current>] <version> <files>...\n\nOptions:\n -f --...
// Command processes command-line arguments according to a usage string specification.
[ "Command", "processes", "command", "-", "line", "arguments", "according", "to", "a", "usage", "string", "specification", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/contrib/bumpver/bump.go#L14-L72
142,870
deis/deis
client/parser/users.go
Users
func Users(argv []string) error { usage := ` Valid commands for users: users:list list all registered users Use 'deis help [command]' to learn more. ` switch argv[0] { case "users:list": return usersList(argv) default: if printHelp(argv, usage) { return nil } if argv[0] == "users" { argv[0]...
go
func Users(argv []string) error { usage := ` Valid commands for users: users:list list all registered users Use 'deis help [command]' to learn more. ` switch argv[0] { case "users:list": return usersList(argv) default: if printHelp(argv, usage) { return nil } if argv[0] == "users" { argv[0]...
[ "func", "Users", "(", "argv", "[", "]", "string", ")", "error", "{", "usage", ":=", "`\nValid commands for users:\n\nusers:list list all registered users\n\nUse 'deis help [command]' to learn more.\n`", "\n\n", "switch", "argv", "[", "0", "]", "{", "case", "\"", "\...
// Users routes user commands to the specific function.
[ "Users", "routes", "user", "commands", "to", "the", "specific", "function", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/users.go#L9-L34
142,871
deis/deis
deisctl/cmd/upgrade.go
UpgradePrep
func UpgradePrep(stateless bool, b backend.Backend) error { var wg sync.WaitGroup b.Stop([]string{"database", "registry@*", "controller", "builder", "logger", "logspout"}, &wg, Stdout, Stderr) wg.Wait() b.Destroy([]string{"database", "registry@*", "controller", "builder", "logger", "logspout"}, &wg, Stdout, Stderr...
go
func UpgradePrep(stateless bool, b backend.Backend) error { var wg sync.WaitGroup b.Stop([]string{"database", "registry@*", "controller", "builder", "logger", "logspout"}, &wg, Stdout, Stderr) wg.Wait() b.Destroy([]string{"database", "registry@*", "controller", "builder", "logger", "logspout"}, &wg, Stdout, Stderr...
[ "func", "UpgradePrep", "(", "stateless", "bool", ",", "b", "backend", ".", "Backend", ")", "error", "{", "var", "wg", "sync", ".", "WaitGroup", "\n\n", "b", ".", "Stop", "(", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ...
// UpgradePrep stops and uninstalls all components except router and publisher
[ "UpgradePrep", "stops", "and", "uninstalls", "all", "components", "except", "router", "and", "publisher" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/upgrade.go#L15-L49
142,872
deis/deis
deisctl/cmd/upgrade.go
UpgradeTakeover
func UpgradeTakeover(stateless bool, b backend.Backend, cb config.Backend) error { if err := doUpgradeTakeOver(stateless, b, cb); err != nil { return err } return nil }
go
func UpgradeTakeover(stateless bool, b backend.Backend, cb config.Backend) error { if err := doUpgradeTakeOver(stateless, b, cb); err != nil { return err } return nil }
[ "func", "UpgradeTakeover", "(", "stateless", "bool", ",", "b", "backend", ".", "Backend", ",", "cb", "config", ".", "Backend", ")", "error", "{", "if", "err", ":=", "doUpgradeTakeOver", "(", "stateless", ",", "b", ",", "cb", ")", ";", "err", "!=", "nil...
// UpgradeTakeover gracefully starts a platform stopped with UpgradePrep
[ "UpgradeTakeover", "gracefully", "starts", "a", "platform", "stopped", "with", "UpgradePrep" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/upgrade.go#L72-L78
142,873
deis/deis
client/parser/certs.go
Certs
func Certs(argv []string) error { usage := ` Valid commands for certs: certs:list list SSL certificates for an app certs:add add an SSL certificate to an app certs:remove remove an SSL certificate from an app Use 'deis help [command]' to learn more. ` switch argv[0] { case "certs:l...
go
func Certs(argv []string) error { usage := ` Valid commands for certs: certs:list list SSL certificates for an app certs:add add an SSL certificate to an app certs:remove remove an SSL certificate from an app Use 'deis help [command]' to learn more. ` switch argv[0] { case "certs:l...
[ "func", "Certs", "(", "argv", "[", "]", "string", ")", "error", "{", "usage", ":=", "`\nValid commands for certs:\n\ncerts:list list SSL certificates for an app\ncerts:add add an SSL certificate to an app\ncerts:remove remove an SSL certificate from an app\n\n...
// Certs routes certs commands to their specific function.
[ "Certs", "routes", "certs", "commands", "to", "their", "specific", "function", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/certs.go#L9-L40
142,874
deis/deis
client/deis.go
prepareCmdArgs
func prepareCmdArgs(command string, argv []string) []string { cmdArgv := []string{extensionPrefix + command} cmdSplit := strings.Split(argv[0], command+":") if len(cmdSplit) > 1 { cmdArgv = append(cmdArgv, cmdSplit[1]) } return append(cmdArgv, argv[1:]...) }
go
func prepareCmdArgs(command string, argv []string) []string { cmdArgv := []string{extensionPrefix + command} cmdSplit := strings.Split(argv[0], command+":") if len(cmdSplit) > 1 { cmdArgv = append(cmdArgv, cmdSplit[1]) } return append(cmdArgv, argv[1:]...) }
[ "func", "prepareCmdArgs", "(", "command", "string", ",", "argv", "[", "]", "string", ")", "[", "]", "string", "{", "cmdArgv", ":=", "[", "]", "string", "{", "extensionPrefix", "+", "command", "}", "\n", "cmdSplit", ":=", "strings", ".", "Split", "(", "...
// split original command and pass its first element in arguments
[ "split", "original", "command", "and", "pass", "its", "first", "element", "in", "arguments" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/deis.go#L183-L192
142,875
deis/deis
router/cmd/boot/boot.go
waitForInitialConfd
func waitForInitialConfd(etcd string, timeout time.Duration) { for { var buffer bytes.Buffer output := bufio.NewWriter(&buffer) log.Debugf("Connecting to etcd server %s", etcd) cmd := exec.Command("confd", "-node", etcd, "-onetime", "--log-level", "error") cmd.Stdout = output cmd.Stderr = output err := ...
go
func waitForInitialConfd(etcd string, timeout time.Duration) { for { var buffer bytes.Buffer output := bufio.NewWriter(&buffer) log.Debugf("Connecting to etcd server %s", etcd) cmd := exec.Command("confd", "-node", etcd, "-onetime", "--log-level", "error") cmd.Stdout = output cmd.Stderr = output err := ...
[ "func", "waitForInitialConfd", "(", "etcd", "string", ",", "timeout", "time", ".", "Duration", ")", "{", "for", "{", "var", "buffer", "bytes", ".", "Buffer", "\n", "output", ":=", "bufio", ".", "NewWriter", "(", "&", "buffer", ")", "\n", "log", ".", "D...
// Wait until the compilation of the templates
[ "Wait", "until", "the", "compilation", "of", "the", "templates" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/router/cmd/boot/boot.go#L108-L127
142,876
deis/deis
deisctl/cmd/platform.go
InstallPlatform
func InstallPlatform(b backend.Backend, cb config.Backend, checkKeys func(config.Backend) error, stateless bool) error { if err := checkKeys(cb); err != nil { return err } if stateless { fmt.Println("Warning: With a stateless control plane, some components require manual configuration.") fmt.Println("See the...
go
func InstallPlatform(b backend.Backend, cb config.Backend, checkKeys func(config.Backend) error, stateless bool) error { if err := checkKeys(cb); err != nil { return err } if stateless { fmt.Println("Warning: With a stateless control plane, some components require manual configuration.") fmt.Println("See the...
[ "func", "InstallPlatform", "(", "b", "backend", ".", "Backend", ",", "cb", "config", ".", "Backend", ",", "checkKeys", "func", "(", "config", ".", "Backend", ")", "error", ",", "stateless", "bool", ")", "error", "{", "if", "err", ":=", "checkKeys", "(", ...
// InstallPlatform loads all components' definitions from local unit files. // After InstallPlatform, all components will be available for StartPlatform.
[ "InstallPlatform", "loads", "all", "components", "definitions", "from", "local", "unit", "files", ".", "After", "InstallPlatform", "all", "components", "will", "be", "available", "for", "StartPlatform", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/platform.go#L15-L43
142,877
deis/deis
deisctl/cmd/platform.go
StartPlatform
func StartPlatform(b backend.Backend, stateless bool) error { var wg sync.WaitGroup io.WriteString(Stdout, prettyprint.DeisIfy("Starting Deis...")) startDefaultServices(b, stateless, &wg, Stdout, Stderr) wg.Wait() fmt.Fprintln(Stdout, "Done.\n ") fmt.Fprintln(Stdout, "Please set up an administrative account....
go
func StartPlatform(b backend.Backend, stateless bool) error { var wg sync.WaitGroup io.WriteString(Stdout, prettyprint.DeisIfy("Starting Deis...")) startDefaultServices(b, stateless, &wg, Stdout, Stderr) wg.Wait() fmt.Fprintln(Stdout, "Done.\n ") fmt.Fprintln(Stdout, "Please set up an administrative account....
[ "func", "StartPlatform", "(", "b", "backend", ".", "Backend", ",", "stateless", "bool", ")", "error", "{", "var", "wg", "sync", ".", "WaitGroup", "\n\n", "io", ".", "WriteString", "(", "Stdout", ",", "prettyprint", ".", "DeisIfy", "(", "\"", "\"", ")", ...
// StartPlatform activates all components.
[ "StartPlatform", "activates", "all", "components", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/cmd/platform.go#L46-L59
142,878
deis/deis
client/cmd/tags.go
TagsList
func TagsList(appID string) error { c, appID, err := load(appID) if err != nil { return err } config, err := config.List(c, appID) fmt.Printf("=== %s Tags\n", appID) tagMap := make(map[string]string) for key, value := range config.Tags { tagMap[key] = fmt.Sprintf("%v", value) } fmt.Print(prettyprint....
go
func TagsList(appID string) error { c, appID, err := load(appID) if err != nil { return err } config, err := config.List(c, appID) fmt.Printf("=== %s Tags\n", appID) tagMap := make(map[string]string) for key, value := range config.Tags { tagMap[key] = fmt.Sprintf("%v", value) } fmt.Print(prettyprint....
[ "func", "TagsList", "(", "appID", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "config", ",", "err", ":=", "config", ".", "...
// TagsList lists an app's tags.
[ "TagsList", "lists", "an", "app", "s", "tags", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/tags.go#L14-L34
142,879
deis/deis
client/cmd/tags.go
TagsUnset
func TagsUnset(appID string, tags []string) error { c, appID, err := load(appID) if err != nil { return err } fmt.Print("Applying tags... ") quit := progress() configObj := api.Config{} tagsMap := make(map[string]interface{}) for _, tag := range tags { tagsMap[tag] = nil } configObj.Tags = tagsMap ...
go
func TagsUnset(appID string, tags []string) error { c, appID, err := load(appID) if err != nil { return err } fmt.Print("Applying tags... ") quit := progress() configObj := api.Config{} tagsMap := make(map[string]interface{}) for _, tag := range tags { tagsMap[tag] = nil } configObj.Tags = tagsMap ...
[ "func", "TagsUnset", "(", "appID", "string", ",", "tags", "[", "]", "string", ")", "error", "{", "c", ",", "appID", ",", "err", ":=", "load", "(", "appID", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "fmt", "."...
// TagsUnset removes an app's tags.
[ "TagsUnset", "removes", "an", "app", "s", "tags", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/tags.go#L67-L100
142,880
deis/deis
router/logger/stdout_formatter.go
Format
func (f *StdOutFormatter) Format(entry *logrus.Entry) ([]byte, error) { b := &bytes.Buffer{} fmt.Fprintf(b, "[%s] - %s\n", strings.ToUpper(entry.Level.String()), entry.Message) return b.Bytes(), nil }
go
func (f *StdOutFormatter) Format(entry *logrus.Entry) ([]byte, error) { b := &bytes.Buffer{} fmt.Fprintf(b, "[%s] - %s\n", strings.ToUpper(entry.Level.String()), entry.Message) return b.Bytes(), nil }
[ "func", "(", "f", "*", "StdOutFormatter", ")", "Format", "(", "entry", "*", "logrus", ".", "Entry", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "b", ":=", "&", "bytes", ".", "Buffer", "{", "}", "\n", "fmt", ".", "Fprintf", "(", "b", ","...
// Format rewrites a log entry for stdout as a byte array.
[ "Format", "rewrites", "a", "log", "entry", "for", "stdout", "as", "a", "byte", "array", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/router/logger/stdout_formatter.go#L16-L20
142,881
deis/deis
client/parser/version.go
Version
func Version(argv []string) error { usage := ` Displays the client version. Usage: deis version Use 'deis help [command]' to learn more. ` if _, err := docopt.Parse(usage, argv, true, "", false, true); err != nil { return err } fmt.Println(version.Version) return nil }
go
func Version(argv []string) error { usage := ` Displays the client version. Usage: deis version Use 'deis help [command]' to learn more. ` if _, err := docopt.Parse(usage, argv, true, "", false, true); err != nil { return err } fmt.Println(version.Version) return nil }
[ "func", "Version", "(", "argv", "[", "]", "string", ")", "error", "{", "usage", ":=", "`\nDisplays the client version.\n\nUsage: deis version\n\nUse 'deis help [command]' to learn more.\n`", "\n", "if", "_", ",", "err", ":=", "docopt", ".", "Parse", "(", "usage", ",",...
// Version displays the client version
[ "Version", "displays", "the", "client", "version" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/version.go#L11-L25
142,882
deis/deis
deisctl/config/config.go
Config
func Config(target string, action string, key []string, cb Backend) error { return doConfig(target, action, key, cb, os.Stdout) }
go
func Config(target string, action string, key []string, cb Backend) error { return doConfig(target, action, key, cb, os.Stdout) }
[ "func", "Config", "(", "target", "string", ",", "action", "string", ",", "key", "[", "]", "string", ",", "cb", "Backend", ")", "error", "{", "return", "doConfig", "(", "target", ",", "action", ",", "key", ",", "cb", ",", "os", ".", "Stdout", ")", "...
// Config runs the config subcommand
[ "Config", "runs", "the", "config", "subcommand" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/config/config.go#L25-L27
142,883
deis/deis
deisctl/config/config.go
CheckConfig
func CheckConfig(root string, k string, cb Backend) error { _, err := doConfigGet(cb, root, []string{k}) if err != nil { return err } return nil }
go
func CheckConfig(root string, k string, cb Backend) error { _, err := doConfigGet(cb, root, []string{k}) if err != nil { return err } return nil }
[ "func", "CheckConfig", "(", "root", "string", ",", "k", "string", ",", "cb", "Backend", ")", "error", "{", "_", ",", "err", ":=", "doConfigGet", "(", "cb", ",", "root", ",", "[", "]", "string", "{", "k", "}", ")", "\n", "if", "err", "!=", "nil", ...
// CheckConfig looks for a value at a keyspace path // and returns an error if a value is not found
[ "CheckConfig", "looks", "for", "a", "value", "at", "a", "keyspace", "path", "and", "returns", "an", "error", "if", "a", "value", "is", "not", "found" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/config/config.go#L31-L39
142,884
deis/deis
deisctl/config/config.go
valueForPath
func valueForPath(path string, v string) (string, error) { // check if path is part of fileKeys for _, p := range fileKeys { if path == p { // read value from filesystem bytes, err := ioutil.ReadFile(utils.ResolvePath(v)) if err != nil { return "", err } // see if we should return base64 enco...
go
func valueForPath(path string, v string) (string, error) { // check if path is part of fileKeys for _, p := range fileKeys { if path == p { // read value from filesystem bytes, err := ioutil.ReadFile(utils.ResolvePath(v)) if err != nil { return "", err } // see if we should return base64 enco...
[ "func", "valueForPath", "(", "path", "string", ",", "v", "string", ")", "(", "string", ",", "error", ")", "{", "// check if path is part of fileKeys", "for", "_", ",", "p", ":=", "range", "fileKeys", "{", "if", "path", "==", "p", "{", "// read value from fil...
// valueForPath returns the canonical value for a user-defined path and value
[ "valueForPath", "returns", "the", "canonical", "value", "for", "a", "user", "-", "defined", "path", "and", "value" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/config/config.go#L123-L149
142,885
deis/deis
deisctl/backend/fleet/status.go
printUnitStatus
func (c *FleetClient) printUnitStatus(name string) int { u, err := c.Fleet.Unit(name) switch { case suToGlobal(*u): fmt.Fprintf(c.errWriter, "Unable to get status for global unit %s. Check the status on the host using systemctl.\n", name) return 1 case err != nil: fmt.Fprintf(c.errWriter, "Error retrieving Un...
go
func (c *FleetClient) printUnitStatus(name string) int { u, err := c.Fleet.Unit(name) switch { case suToGlobal(*u): fmt.Fprintf(c.errWriter, "Unable to get status for global unit %s. Check the status on the host using systemctl.\n", name) return 1 case err != nil: fmt.Fprintf(c.errWriter, "Error retrieving Un...
[ "func", "(", "c", "*", "FleetClient", ")", "printUnitStatus", "(", "name", "string", ")", "int", "{", "u", ",", "err", ":=", "c", ".", "Fleet", ".", "Unit", "(", "name", ")", "\n", "switch", "{", "case", "suToGlobal", "(", "*", "u", ")", ":", "fm...
// printUnitStatus displays the systemd status for a given unit
[ "printUnitStatus", "displays", "the", "systemd", "status", "for", "a", "given", "unit" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/status.go#L21-L39
142,886
deis/deis
deisctl/backend/fleet/create.go
Create
func (c *FleetClient) Create( targets []string, wg *sync.WaitGroup, out, ew io.Writer) { units := make([]*schema.Unit, len(targets)) for i, target := range targets { unitName, unitFile, err := c.createUnitFile(target) if err != nil { fmt.Fprintf(ew, "Error creating: %s\n", err) return } units[i] = &s...
go
func (c *FleetClient) Create( targets []string, wg *sync.WaitGroup, out, ew io.Writer) { units := make([]*schema.Unit, len(targets)) for i, target := range targets { unitName, unitFile, err := c.createUnitFile(target) if err != nil { fmt.Fprintf(ew, "Error creating: %s\n", err) return } units[i] = &s...
[ "func", "(", "c", "*", "FleetClient", ")", "Create", "(", "targets", "[", "]", "string", ",", "wg", "*", "sync", ".", "WaitGroup", ",", "out", ",", "ew", "io", ".", "Writer", ")", "{", "units", ":=", "make", "(", "[", "]", "*", "schema", ".", "...
// Create schedules unit files for the given components.
[ "Create", "schedules", "unit", "files", "for", "the", "given", "components", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/create.go#L19-L40
142,887
deis/deis
deisctl/backend/fleet/create.go
createServiceUnit
func (c *FleetClient) createServiceUnit(component string, num int) (name string, uf *unit.UnitFile, err error) { name, err = formatUnitName(component, num) if err != nil { return "", nil, err } decorateStr, err := c.configBackend.GetWithDefault("/deis/platform/enablePlacementOptions", "false") if err != nil { ...
go
func (c *FleetClient) createServiceUnit(component string, num int) (name string, uf *unit.UnitFile, err error) { name, err = formatUnitName(component, num) if err != nil { return "", nil, err } decorateStr, err := c.configBackend.GetWithDefault("/deis/platform/enablePlacementOptions", "false") if err != nil { ...
[ "func", "(", "c", "*", "FleetClient", ")", "createServiceUnit", "(", "component", "string", ",", "num", "int", ")", "(", "name", "string", ",", "uf", "*", "unit", ".", "UnitFile", ",", "err", "error", ")", "{", "name", ",", "err", "=", "formatUnitName"...
// Create normal service unit
[ "Create", "normal", "service", "unit" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/create.go#L95-L113
142,888
deis/deis
deisctl/backend/fleet/list_machines.go
ListMachines
func (c *FleetClient) ListMachines() (err error) { machines, err := c.Fleet.Machines() if err != nil { return err } c.printMachines(machines) return }
go
func (c *FleetClient) ListMachines() (err error) { machines, err := c.Fleet.Machines() if err != nil { return err } c.printMachines(machines) return }
[ "func", "(", "c", "*", "FleetClient", ")", "ListMachines", "(", ")", "(", "err", "error", ")", "{", "machines", ",", "err", ":=", "c", ".", "Fleet", ".", "Machines", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n...
// ListMachines prints all nodes to Stdout
[ "ListMachines", "prints", "all", "nodes", "to", "Stdout" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/list_machines.go#L38-L46
142,889
deis/deis
client/cmd/users.go
UsersList
func UsersList(results int) error { c, err := client.New() if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } users, count, err := users.List(c, results) if err != nil { return err } fmt.Printf("=== Users%s", limitCount(len(users), count)) sort.Sort(users) for ...
go
func UsersList(results int) error { c, err := client.New() if err != nil { return err } if results == defaultLimit { results = c.ResponseLimit } users, count, err := users.List(c, results) if err != nil { return err } fmt.Printf("=== Users%s", limitCount(len(users), count)) sort.Sort(users) for ...
[ "func", "UsersList", "(", "results", "int", ")", "error", "{", "c", ",", "err", ":=", "client", ".", "New", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "results", "==", "defaultLimit", "{", "results", ...
// UsersList lists users registered with the controller.
[ "UsersList", "lists", "users", "registered", "with", "the", "controller", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/cmd/users.go#L12-L37
142,890
deis/deis
logger/syslogish/server.go
DestroyLogs
func (s *Server) DestroyLogs(app string) error { // Get a read lock to ensure the storage adapater pointer can't be updated by another // goroutine in the time between we check if it's nil and the time we invoke .Destroy() upon // it. s.adapterMutex.RLock() defer s.adapterMutex.RUnlock() if s.storageAdapter == ni...
go
func (s *Server) DestroyLogs(app string) error { // Get a read lock to ensure the storage adapater pointer can't be updated by another // goroutine in the time between we check if it's nil and the time we invoke .Destroy() upon // it. s.adapterMutex.RLock() defer s.adapterMutex.RUnlock() if s.storageAdapter == ni...
[ "func", "(", "s", "*", "Server", ")", "DestroyLogs", "(", "app", "string", ")", "error", "{", "// Get a read lock to ensure the storage adapater pointer can't be updated by another", "// goroutine in the time between we check if it's nil and the time we invoke .Destroy() upon", "// it....
// DestroyLogs deletes all logs for a specified app by delegating to the server's underlying // storage.Adapter.
[ "DestroyLogs", "deletes", "all", "logs", "for", "a", "specified", "app", "by", "delegating", "to", "the", "server", "s", "underlying", "storage", ".", "Adapter", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/syslogish/server.go#L188-L198
142,891
deis/deis
logger/syslogish/server.go
ReopenLogs
func (s *Server) ReopenLogs() error { // Get a read lock to ensure the storage adapater pointer can't be updated by another // goroutine in the time between we check if it's nil and the time we invoke .Reopen() upon // it. s.adapterMutex.RLock() defer s.adapterMutex.RUnlock() if s.storageAdapter == nil { return...
go
func (s *Server) ReopenLogs() error { // Get a read lock to ensure the storage adapater pointer can't be updated by another // goroutine in the time between we check if it's nil and the time we invoke .Reopen() upon // it. s.adapterMutex.RLock() defer s.adapterMutex.RUnlock() if s.storageAdapter == nil { return...
[ "func", "(", "s", "*", "Server", ")", "ReopenLogs", "(", ")", "error", "{", "// Get a read lock to ensure the storage adapater pointer can't be updated by another", "// goroutine in the time between we check if it's nil and the time we invoke .Reopen() upon", "// it.", "s", ".", "ada...
// ReopenLogs delegate to the server's underlying storage.Adapter to, if applicable, refresh // references to underlying storage mechanisms. This is useful, for instance, to ensure logging // continues smoothly after log rotation when file-based storage is in use.
[ "ReopenLogs", "delegate", "to", "the", "server", "s", "underlying", "storage", ".", "Adapter", "to", "if", "applicable", "refresh", "references", "to", "underlying", "storage", "mechanisms", ".", "This", "is", "useful", "for", "instance", "to", "ensure", "loggin...
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/logger/syslogish/server.go#L203-L213
142,892
deis/deis
client/parser/limits.go
Limits
func Limits(argv []string) error { usage := ` Valid commands for limits: limits:list list resource limits for an app limits:set set resource limits for an app limits:unset unset resource limits for an app Use 'deis help [command]' to learn more. ` switch argv[0] { case "limits:list": return...
go
func Limits(argv []string) error { usage := ` Valid commands for limits: limits:list list resource limits for an app limits:set set resource limits for an app limits:unset unset resource limits for an app Use 'deis help [command]' to learn more. ` switch argv[0] { case "limits:list": return...
[ "func", "Limits", "(", "argv", "[", "]", "string", ")", "error", "{", "usage", ":=", "`\nValid commands for limits:\n\nlimits:list list resource limits for an app\nlimits:set set resource limits for an app\nlimits:unset unset resource limits for an app\n\nUse 'deis help ...
// Limits routes limits commands to their specific function
[ "Limits", "routes", "limits", "commands", "to", "their", "specific", "function" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/limits.go#L9-L40
142,893
deis/deis
client/parser/builds.go
Builds
func Builds(argv []string) error { usage := ` Valid commands for builds: builds:list list build history for an application builds:create imports an image and deploys as a new release Use 'deis help [command]' to learn more. ` switch argv[0] { case "builds:list": return buildsList(argv) case "builds...
go
func Builds(argv []string) error { usage := ` Valid commands for builds: builds:list list build history for an application builds:create imports an image and deploys as a new release Use 'deis help [command]' to learn more. ` switch argv[0] { case "builds:list": return buildsList(argv) case "builds...
[ "func", "Builds", "(", "argv", "[", "]", "string", ")", "error", "{", "usage", ":=", "`\nValid commands for builds:\n\nbuilds:list list build history for an application\nbuilds:create imports an image and deploys as a new release\n\nUse 'deis help [command]' to learn more.\n`", ...
// Builds routes build commands to their specific function.
[ "Builds", "routes", "build", "commands", "to", "their", "specific", "function", "." ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/client/parser/builds.go#L9-L37
142,894
deis/deis
deisctl/backend/fleet/rolling_restart.go
RollingRestart
func (c *FleetClient) RollingRestart(component string, wg *sync.WaitGroup, out, ew io.Writer) { if component != "router" { fmt.Fprint(ew, "invalid component. supported for: router") return } components, err := c.Units(component) if err != nil { io.WriteString(ew, err.Error()) return } if len(components) ...
go
func (c *FleetClient) RollingRestart(component string, wg *sync.WaitGroup, out, ew io.Writer) { if component != "router" { fmt.Fprint(ew, "invalid component. supported for: router") return } components, err := c.Units(component) if err != nil { io.WriteString(ew, err.Error()) return } if len(components) ...
[ "func", "(", "c", "*", "FleetClient", ")", "RollingRestart", "(", "component", "string", ",", "wg", "*", "sync", ".", "WaitGroup", ",", "out", ",", "ew", "io", ".", "Writer", ")", "{", "if", "component", "!=", "\"", "\"", "{", "fmt", ".", "Fprint", ...
// RollingRestart for instance units
[ "RollingRestart", "for", "instance", "units" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/rolling_restart.go#L10-L37
142,895
deis/deis
deisctl/backend/fleet/unit.go
Units
func (c *FleetClient) Units(target string) (units []string, err error) { allUnits, err := c.Fleet.Units() if err != nil { return } // Look for units starting with the given target name first. If the given // name starts with "deis-", this will easily locate platform components, // but we search without canonica...
go
func (c *FleetClient) Units(target string) (units []string, err error) { allUnits, err := c.Fleet.Units() if err != nil { return } // Look for units starting with the given target name first. If the given // name starts with "deis-", this will easily locate platform components, // but we search without canonica...
[ "func", "(", "c", "*", "FleetClient", ")", "Units", "(", "target", "string", ")", "(", "units", "[", "]", "string", ",", "err", "error", ")", "{", "allUnits", ",", "err", ":=", "c", ".", "Fleet", ".", "Units", "(", ")", "\n", "if", "err", "!=", ...
// Units returns a list of units filtered by target
[ "Units", "returns", "a", "list", "of", "units", "filtered", "by", "target" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/unit.go#L30-L64
142,896
deis/deis
deisctl/backend/fleet/unit.go
nextUnit
func (c *FleetClient) nextUnit(component string) (num int, err error) { units, err := c.Units(component) if err != nil { return } num, err = nextUnitNum(units) if err != nil { return } return }
go
func (c *FleetClient) nextUnit(component string) (num int, err error) { units, err := c.Units(component) if err != nil { return } num, err = nextUnitNum(units) if err != nil { return } return }
[ "func", "(", "c", "*", "FleetClient", ")", "nextUnit", "(", "component", "string", ")", "(", "num", "int", ",", "err", "error", ")", "{", "units", ",", "err", ":=", "c", ".", "Units", "(", "component", ")", "\n", "if", "err", "!=", "nil", "{", "r...
// nextUnit returns the next unit number for a given component
[ "nextUnit", "returns", "the", "next", "unit", "number", "for", "a", "given", "component" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/unit.go#L67-L77
142,897
deis/deis
deisctl/backend/fleet/unit.go
lastUnit
func (c *FleetClient) lastUnit(component string) (num int, err error) { units, err := c.Units(component) if err != nil { return } num, err = lastUnitNum(units) if err != nil { return } return }
go
func (c *FleetClient) lastUnit(component string) (num int, err error) { units, err := c.Units(component) if err != nil { return } num, err = lastUnitNum(units) if err != nil { return } return }
[ "func", "(", "c", "*", "FleetClient", ")", "lastUnit", "(", "component", "string", ")", "(", "num", "int", ",", "err", "error", ")", "{", "units", ",", "err", ":=", "c", ".", "Units", "(", "component", ")", "\n", "if", "err", "!=", "nil", "{", "r...
// lastUnit returns the last unit number for a given component
[ "lastUnit", "returns", "the", "last", "unit", "number", "for", "a", "given", "component" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/unit.go#L80-L90
142,898
deis/deis
deisctl/backend/fleet/unit.go
NewUnit
func NewUnit(component string, templatePaths []string, decorate bool) (uf *unit.UnitFile, err error) { template, err := readTemplate(component, templatePaths) if err != nil { return } if decorate { decorator, err := readDecorator(component) if err != nil { return nil, err } uf, err = unit.NewUnitFile(s...
go
func NewUnit(component string, templatePaths []string, decorate bool) (uf *unit.UnitFile, err error) { template, err := readTemplate(component, templatePaths) if err != nil { return } if decorate { decorator, err := readDecorator(component) if err != nil { return nil, err } uf, err = unit.NewUnitFile(s...
[ "func", "NewUnit", "(", "component", "string", ",", "templatePaths", "[", "]", "string", ",", "decorate", "bool", ")", "(", "uf", "*", "unit", ".", "UnitFile", ",", "err", "error", ")", "{", "template", ",", "err", ":=", "readTemplate", "(", "component",...
// NewUnit takes a component type and returns a Fleet unit // that includes the relevant systemd service template
[ "NewUnit", "takes", "a", "component", "type", "and", "returns", "a", "Fleet", "unit", "that", "includes", "the", "relevant", "systemd", "service", "template" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/unit.go#L94-L109
142,899
deis/deis
deisctl/backend/fleet/unit.go
formatUnitName
func formatUnitName(component string, num int) (unitName string, err error) { component = strings.TrimPrefix(component, "deis-") if num == 0 { return "deis-" + component + ".service", nil } return "deis-" + component + "@" + strconv.Itoa(num) + ".service", nil }
go
func formatUnitName(component string, num int) (unitName string, err error) { component = strings.TrimPrefix(component, "deis-") if num == 0 { return "deis-" + component + ".service", nil } return "deis-" + component + "@" + strconv.Itoa(num) + ".service", nil }
[ "func", "formatUnitName", "(", "component", "string", ",", "num", "int", ")", "(", "unitName", "string", ",", "err", "error", ")", "{", "component", "=", "strings", ".", "TrimPrefix", "(", "component", ",", "\"", "\"", ")", "\n", "if", "num", "==", "0"...
// formatUnitName returns a properly formatted systemd service name // using the given component type and number
[ "formatUnitName", "returns", "a", "properly", "formatted", "systemd", "service", "name", "using", "the", "given", "component", "type", "and", "number" ]
1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410
https://github.com/deis/deis/blob/1d9e59fbdbfc9d7767f77c2e0097e335b0fcd410/deisctl/backend/fleet/unit.go#L113-L119