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
25,800
beego/bee
generate/swaggergen/g_docs.go
analyseNewNamespace
func analyseNewNamespace(ce *ast.CallExpr) (first string, others []ast.Expr) { for i, p := range ce.Args { if i == 0 { switch pp := p.(type) { case *ast.BasicLit: first = strings.Trim(pp.Value, `"`) } continue } others = append(others, p) } return }
go
func analyseNewNamespace(ce *ast.CallExpr) (first string, others []ast.Expr) { for i, p := range ce.Args { if i == 0 { switch pp := p.(type) { case *ast.BasicLit: first = strings.Trim(pp.Value, `"`) } continue } others = append(others, p) } return }
[ "func", "analyseNewNamespace", "(", "ce", "*", "ast", ".", "CallExpr", ")", "(", "first", "string", ",", "others", "[", "]", "ast", ".", "Expr", ")", "{", "for", "i", ",", "p", ":=", "range", "ce", ".", "Args", "{", "if", "i", "==", "0", "{", "...
// analyseNewNamespace returns version and the others params
[ "analyseNewNamespace", "returns", "version", "and", "the", "others", "params" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/swaggergen/g_docs.go#L347-L359
25,801
beego/bee
generate/g_appcode.go
String
func (tb *Table) String() string { rv := fmt.Sprintf("type %s struct {\n", utils.CamelCase(tb.Name)) for _, v := range tb.Columns { rv += v.String() + "\n" } rv += "}\n" return rv }
go
func (tb *Table) String() string { rv := fmt.Sprintf("type %s struct {\n", utils.CamelCase(tb.Name)) for _, v := range tb.Columns { rv += v.String() + "\n" } rv += "}\n" return rv }
[ "func", "(", "tb", "*", "Table", ")", "String", "(", ")", "string", "{", "rv", ":=", "fmt", ".", "Sprintf", "(", "\"", "\\n", "\"", ",", "utils", ".", "CamelCase", "(", "tb", ".", "Name", ")", ")", "\n", "for", "_", ",", "v", ":=", "range", "...
// String returns the source code string for the Table struct
[ "String", "returns", "the", "source", "code", "string", "for", "the", "Table", "struct" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L190-L197
25,802
beego/bee
generate/g_appcode.go
String
func (tag *OrmTag) String() string { var ormOptions []string if tag.Column != "" { ormOptions = append(ormOptions, fmt.Sprintf("column(%s)", tag.Column)) } if tag.Auto { ormOptions = append(ormOptions, "auto") } if tag.Size != "" { ormOptions = append(ormOptions, fmt.Sprintf("size(%s)", tag.Size)) } if ta...
go
func (tag *OrmTag) String() string { var ormOptions []string if tag.Column != "" { ormOptions = append(ormOptions, fmt.Sprintf("column(%s)", tag.Column)) } if tag.Auto { ormOptions = append(ormOptions, "auto") } if tag.Size != "" { ormOptions = append(ormOptions, fmt.Sprintf("size(%s)", tag.Size)) } if ta...
[ "func", "(", "tag", "*", "OrmTag", ")", "String", "(", ")", "string", "{", "var", "ormOptions", "[", "]", "string", "\n", "if", "tag", ".", "Column", "!=", "\"", "\"", "{", "ormOptions", "=", "append", "(", "ormOptions", ",", "fmt", ".", "Sprintf", ...
// String returns the ORM tag string for a column
[ "String", "returns", "the", "ORM", "tag", "string", "for", "a", "column" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L206-L264
25,803
beego/bee
generate/g_appcode.go
getTableObjects
func getTableObjects(tableNames []string, db *sql.DB, dbTransformer DbTransformer) (tables []*Table) { // if a table has a composite pk or doesn't have pk, we can't use it yet // these tables will be put into blacklist so that other struct will not // reference it. blackList := make(map[string]bool) // process con...
go
func getTableObjects(tableNames []string, db *sql.DB, dbTransformer DbTransformer) (tables []*Table) { // if a table has a composite pk or doesn't have pk, we can't use it yet // these tables will be put into blacklist so that other struct will not // reference it. blackList := make(map[string]bool) // process con...
[ "func", "getTableObjects", "(", "tableNames", "[", "]", "string", ",", "db", "*", "sql", ".", "DB", ",", "dbTransformer", "DbTransformer", ")", "(", "tables", "[", "]", "*", "Table", ")", "{", "// if a table has a composite pk or doesn't have pk, we can't use it yet...
// getTableObjects process each table name
[ "getTableObjects", "process", "each", "table", "name" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L345-L364
25,804
beego/bee
generate/g_appcode.go
GetGoDataType
func (*MysqlDB) GetGoDataType(sqlType string) (string, error) { if v, ok := typeMappingMysql[sqlType]; ok { return v, nil } return "", fmt.Errorf("data type '%s' not found", sqlType) }
go
func (*MysqlDB) GetGoDataType(sqlType string) (string, error) { if v, ok := typeMappingMysql[sqlType]; ok { return v, nil } return "", fmt.Errorf("data type '%s' not found", sqlType) }
[ "func", "(", "*", "MysqlDB", ")", "GetGoDataType", "(", "sqlType", "string", ")", "(", "string", ",", "error", ")", "{", "if", "v", ",", "ok", ":=", "typeMappingMysql", "[", "sqlType", "]", ";", "ok", "{", "return", "v", ",", "nil", "\n", "}", "\n"...
// GetGoDataType maps an SQL data type to Golang data type
[ "GetGoDataType", "maps", "an", "SQL", "data", "type", "to", "Golang", "data", "type" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L518-L523
25,805
beego/bee
generate/g_appcode.go
GetTableNames
func (*PostgresDB) GetTableNames(db *sql.DB) (tables []string) { rows, err := db.Query(` SELECT table_name FROM information_schema.tables WHERE table_catalog = current_database() AND table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema')`) if err != nil { beeLogger.Log.Fatalf...
go
func (*PostgresDB) GetTableNames(db *sql.DB) (tables []string) { rows, err := db.Query(` SELECT table_name FROM information_schema.tables WHERE table_catalog = current_database() AND table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema')`) if err != nil { beeLogger.Log.Fatalf...
[ "func", "(", "*", "PostgresDB", ")", "GetTableNames", "(", "db", "*", "sql", ".", "DB", ")", "(", "tables", "[", "]", "string", ")", "{", "rows", ",", "err", ":=", "db", ".", "Query", "(", "`\n\t\tSELECT table_name FROM information_schema.tables\n\t\tWHERE tab...
// GetTableNames for PostgreSQL
[ "GetTableNames", "for", "PostgreSQL" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L526-L545
25,806
beego/bee
generate/g_appcode.go
GetConstraints
func (*PostgresDB) GetConstraints(db *sql.DB, table *Table, blackList map[string]bool) { rows, err := db.Query( `SELECT c.constraint_type, u.column_name, cu.table_catalog AS referenced_table_catalog, cu.table_name AS referenced_table_name, cu.column_name AS referenced_column_name, u.ordinal_positio...
go
func (*PostgresDB) GetConstraints(db *sql.DB, table *Table, blackList map[string]bool) { rows, err := db.Query( `SELECT c.constraint_type, u.column_name, cu.table_catalog AS referenced_table_catalog, cu.table_name AS referenced_table_name, cu.column_name AS referenced_column_name, u.ordinal_positio...
[ "func", "(", "*", "PostgresDB", ")", "GetConstraints", "(", "db", "*", "sql", ".", "DB", ",", "table", "*", "Table", ",", "blackList", "map", "[", "string", "]", "bool", ")", "{", "rows", ",", "err", ":=", "db", ".", "Query", "(", "`SELECT\n\t\t\tc.c...
// GetConstraints for PostgreSQL
[ "GetConstraints", "for", "PostgreSQL" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L548-L601
25,807
beego/bee
generate/g_appcode.go
GetGoDataType
func (*PostgresDB) GetGoDataType(sqlType string) (string, error) { if v, ok := typeMappingPostgres[sqlType]; ok { return v, nil } return "", fmt.Errorf("data type '%s' not found", sqlType) }
go
func (*PostgresDB) GetGoDataType(sqlType string) (string, error) { if v, ok := typeMappingPostgres[sqlType]; ok { return v, nil } return "", fmt.Errorf("data type '%s' not found", sqlType) }
[ "func", "(", "*", "PostgresDB", ")", "GetGoDataType", "(", "sqlType", "string", ")", "(", "string", ",", "error", ")", "{", "if", "v", ",", "ok", ":=", "typeMappingPostgres", "[", "sqlType", "]", ";", "ok", "{", "return", "v", ",", "nil", "\n", "}", ...
// GetGoDataType returns the Go type from the mapped Postgres type
[ "GetGoDataType", "returns", "the", "Go", "type", "from", "the", "mapped", "Postgres", "type" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L708-L713
25,808
beego/bee
generate/g_appcode.go
createPaths
func createPaths(mode byte, paths *MvcPath) { if (mode & OModel) == OModel { os.Mkdir(paths.ModelPath, 0777) } if (mode & OController) == OController { os.Mkdir(paths.ControllerPath, 0777) } if (mode & ORouter) == ORouter { os.Mkdir(paths.RouterPath, 0777) } }
go
func createPaths(mode byte, paths *MvcPath) { if (mode & OModel) == OModel { os.Mkdir(paths.ModelPath, 0777) } if (mode & OController) == OController { os.Mkdir(paths.ControllerPath, 0777) } if (mode & ORouter) == ORouter { os.Mkdir(paths.RouterPath, 0777) } }
[ "func", "createPaths", "(", "mode", "byte", ",", "paths", "*", "MvcPath", ")", "{", "if", "(", "mode", "&", "OModel", ")", "==", "OModel", "{", "os", ".", "Mkdir", "(", "paths", ".", "ModelPath", ",", "0777", ")", "\n", "}", "\n", "if", "(", "mod...
// deleteAndRecreatePaths removes several directories completely
[ "deleteAndRecreatePaths", "removes", "several", "directories", "completely" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L716-L726
25,809
beego/bee
generate/g_appcode.go
writeModelFiles
func writeModelFiles(tables []*Table, mPath string) { w := colors.NewColorWriter(os.Stdout) for _, tb := range tables { filename := getFileName(tb.Name) fpath := path.Join(mPath, filename+".go") var f *os.File var err error if utils.IsExist(fpath) { beeLogger.Log.Warnf("'%s' already exists. Do you want ...
go
func writeModelFiles(tables []*Table, mPath string) { w := colors.NewColorWriter(os.Stdout) for _, tb := range tables { filename := getFileName(tb.Name) fpath := path.Join(mPath, filename+".go") var f *os.File var err error if utils.IsExist(fpath) { beeLogger.Log.Warnf("'%s' already exists. Do you want ...
[ "func", "writeModelFiles", "(", "tables", "[", "]", "*", "Table", ",", "mPath", "string", ")", "{", "w", ":=", "colors", ".", "NewColorWriter", "(", "os", ".", "Stdout", ")", "\n\n", "for", "_", ",", "tb", ":=", "range", "tables", "{", "filename", ":...
// writeModelFiles generates model files
[ "writeModelFiles", "generates", "model", "files" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L747-L800
25,810
beego/bee
generate/g_appcode.go
writeControllerFiles
func writeControllerFiles(tables []*Table, cPath string, pkgPath string) { w := colors.NewColorWriter(os.Stdout) for _, tb := range tables { if tb.Pk == "" { continue } filename := getFileName(tb.Name) fpath := path.Join(cPath, filename+".go") var f *os.File var err error if utils.IsExist(fpath) { ...
go
func writeControllerFiles(tables []*Table, cPath string, pkgPath string) { w := colors.NewColorWriter(os.Stdout) for _, tb := range tables { if tb.Pk == "" { continue } filename := getFileName(tb.Name) fpath := path.Join(cPath, filename+".go") var f *os.File var err error if utils.IsExist(fpath) { ...
[ "func", "writeControllerFiles", "(", "tables", "[", "]", "*", "Table", ",", "cPath", "string", ",", "pkgPath", "string", ")", "{", "w", ":=", "colors", ".", "NewColorWriter", "(", "os", ".", "Stdout", ")", "\n\n", "for", "_", ",", "tb", ":=", "range", ...
// writeControllerFiles generates controller files
[ "writeControllerFiles", "generates", "controller", "files" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L803-L842
25,811
beego/bee
generate/g_appcode.go
writeRouterFile
func writeRouterFile(tables []*Table, rPath string, pkgPath string) { w := colors.NewColorWriter(os.Stdout) var nameSpaces []string for _, tb := range tables { if tb.Pk == "" { continue } // Add namespaces nameSpace := strings.Replace(NamespaceTPL, "{{nameSpace}}", tb.Name, -1) nameSpace = strings.Repl...
go
func writeRouterFile(tables []*Table, rPath string, pkgPath string) { w := colors.NewColorWriter(os.Stdout) var nameSpaces []string for _, tb := range tables { if tb.Pk == "" { continue } // Add namespaces nameSpace := strings.Replace(NamespaceTPL, "{{nameSpace}}", tb.Name, -1) nameSpace = strings.Repl...
[ "func", "writeRouterFile", "(", "tables", "[", "]", "*", "Table", ",", "rPath", "string", ",", "pkgPath", "string", ")", "{", "w", ":=", "colors", ".", "NewColorWriter", "(", "os", ".", "Stdout", ")", "\n\n", "var", "nameSpaces", "[", "]", "string", "\...
// writeRouterFile generates router file
[ "writeRouterFile", "generates", "router", "file" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/generate/g_appcode.go#L845-L889
25,812
beego/bee
cmd/commands/version/banner.go
InitBanner
func InitBanner(out io.Writer, in io.Reader) { if in == nil { beeLogger.Log.Fatal("The input is nil") } banner, err := ioutil.ReadAll(in) if err != nil { beeLogger.Log.Fatalf("Error while trying to read the banner: %s", err) } show(out, string(banner)) }
go
func InitBanner(out io.Writer, in io.Reader) { if in == nil { beeLogger.Log.Fatal("The input is nil") } banner, err := ioutil.ReadAll(in) if err != nil { beeLogger.Log.Fatalf("Error while trying to read the banner: %s", err) } show(out, string(banner)) }
[ "func", "InitBanner", "(", "out", "io", ".", "Writer", ",", "in", "io", ".", "Reader", ")", "{", "if", "in", "==", "nil", "{", "beeLogger", ".", "Log", ".", "Fatal", "(", "\"", "\"", ")", "\n", "}", "\n\n", "banner", ",", "err", ":=", "ioutil", ...
// InitBanner loads the banner and prints it to output // All errors are ignored, the application will not // print the banner in case of error.
[ "InitBanner", "loads", "the", "banner", "and", "prints", "it", "to", "output", "All", "errors", "are", "ignored", "the", "application", "will", "not", "print", "the", "banner", "in", "case", "of", "error", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/version/banner.go#L31-L42
25,813
beego/bee
cmd/commands/command.go
Out
func (c *Command) Out() io.Writer { if c.output != nil { return *c.output } return colors.NewColorWriter(os.Stderr) }
go
func (c *Command) Out() io.Writer { if c.output != nil { return *c.output } return colors.NewColorWriter(os.Stderr) }
[ "func", "(", "c", "*", "Command", ")", "Out", "(", ")", "io", ".", "Writer", "{", "if", "c", ".", "output", "!=", "nil", "{", "return", "*", "c", ".", "output", "\n", "}", "\n", "return", "colors", ".", "NewColorWriter", "(", "os", ".", "Stderr",...
// Out returns the out writer of the current command. // If cmd.output is nil, os.Stderr is used.
[ "Out", "returns", "the", "out", "writer", "of", "the", "current", "command", ".", "If", "cmd", ".", "output", "is", "nil", "os", ".", "Stderr", "is", "used", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/command.go#L64-L69
25,814
beego/bee
cmd/commands/run/reload.go
readPump
func (c *wsClient) readPump() { defer func() { c.broker.unregister <- c c.conn.Close() }() for { _, _, err := c.conn.ReadMessage() if err != nil { if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) { beeLogger.Log.Errorf("An error happened when reading from the Websocket client: %v", ...
go
func (c *wsClient) readPump() { defer func() { c.broker.unregister <- c c.conn.Close() }() for { _, _, err := c.conn.ReadMessage() if err != nil { if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) { beeLogger.Log.Errorf("An error happened when reading from the Websocket client: %v", ...
[ "func", "(", "c", "*", "wsClient", ")", "readPump", "(", ")", "{", "defer", "func", "(", ")", "{", "c", ".", "broker", ".", "unregister", "<-", "c", "\n", "c", ".", "conn", ".", "Close", "(", ")", "\n", "}", "(", ")", "\n\n", "for", "{", "_",...
// readPump pumps messages from the websocket connection to the broker.
[ "readPump", "pumps", "messages", "from", "the", "websocket", "connection", "to", "the", "broker", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/reload.go#L64-L79
25,815
beego/bee
cmd/commands/run/reload.go
handleWsRequest
func handleWsRequest(broker *wsBroker, w http.ResponseWriter, r *http.Request) { conn, err := upgrader.Upgrade(w, r, nil) if err != nil { beeLogger.Log.Errorf("error while upgrading server connection: %v", err) return } client := &wsClient{ broker: broker, conn: conn, send: make(chan []byte, 256), }...
go
func handleWsRequest(broker *wsBroker, w http.ResponseWriter, r *http.Request) { conn, err := upgrader.Upgrade(w, r, nil) if err != nil { beeLogger.Log.Errorf("error while upgrading server connection: %v", err) return } client := &wsClient{ broker: broker, conn: conn, send: make(chan []byte, 256), }...
[ "func", "handleWsRequest", "(", "broker", "*", "wsBroker", ",", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "conn", ",", "err", ":=", "upgrader", ".", "Upgrade", "(", "w", ",", "r", ",", "nil", ")", "\n", "i...
// handleWsRequest handles websocket requests from the peer.
[ "handleWsRequest", "handles", "websocket", "requests", "from", "the", "peer", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/reload.go#L176-L192
25,816
beego/bee
config/conf.go
LoadConfig
func LoadConfig() { currentPath, err := os.Getwd() if err != nil { beeLogger.Log.Error(err.Error()) } dir, err := os.Open(currentPath) if err != nil { beeLogger.Log.Error(err.Error()) } defer dir.Close() files, err := dir.Readdir(-1) if err != nil { beeLogger.Log.Error(err.Error()) } for _, file := ...
go
func LoadConfig() { currentPath, err := os.Getwd() if err != nil { beeLogger.Log.Error(err.Error()) } dir, err := os.Open(currentPath) if err != nil { beeLogger.Log.Error(err.Error()) } defer dir.Close() files, err := dir.Readdir(-1) if err != nil { beeLogger.Log.Error(err.Error()) } for _, file := ...
[ "func", "LoadConfig", "(", ")", "{", "currentPath", ",", "err", ":=", "os", ".", "Getwd", "(", ")", "\n", "if", "err", "!=", "nil", "{", "beeLogger", ".", "Log", ".", "Error", "(", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n\n", "dir", "...
// LoadConfig loads the bee tool configuration. // It looks for Beefile or bee.json in the current path, // and falls back to default configuration in case not found.
[ "LoadConfig", "loads", "the", "bee", "tool", "configuration", ".", "It", "looks", "for", "Beefile", "or", "bee", ".", "json", "in", "the", "current", "path", "and", "falls", "back", "to", "default", "configuration", "in", "case", "not", "found", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/config/conf.go#L86-L138
25,817
beego/bee
utils/utils.go
IsInGOPATH
func IsInGOPATH(thePath string) bool { for _, gopath := range GetGOPATHs() { if strings.Contains(thePath, filepath.Join(gopath, "src")) { return true } } return false }
go
func IsInGOPATH(thePath string) bool { for _, gopath := range GetGOPATHs() { if strings.Contains(thePath, filepath.Join(gopath, "src")) { return true } } return false }
[ "func", "IsInGOPATH", "(", "thePath", "string", ")", "bool", "{", "for", "_", ",", "gopath", ":=", "range", "GetGOPATHs", "(", ")", "{", "if", "strings", ".", "Contains", "(", "thePath", ",", "filepath", ".", "Join", "(", "gopath", ",", "\"", "\"", "...
// IsInGOPATH checks whether the path is inside of any GOPATH or not
[ "IsInGOPATH", "checks", "whether", "the", "path", "is", "inside", "of", "any", "GOPATH", "or", "not" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L62-L69
25,818
beego/bee
utils/utils.go
IsBeegoProject
func IsBeegoProject(thePath string) bool { mainFiles := []string{} hasBeegoRegex := regexp.MustCompile(`(?s)package main.*?import.*?\(.*?github.com/astaxie/beego".*?\).*func main()`) c := make(chan error) // Walk the application path tree to look for main files. // Main files must satisfy the 'hasBeegoRegex' regul...
go
func IsBeegoProject(thePath string) bool { mainFiles := []string{} hasBeegoRegex := regexp.MustCompile(`(?s)package main.*?import.*?\(.*?github.com/astaxie/beego".*?\).*func main()`) c := make(chan error) // Walk the application path tree to look for main files. // Main files must satisfy the 'hasBeegoRegex' regul...
[ "func", "IsBeegoProject", "(", "thePath", "string", ")", "bool", "{", "mainFiles", ":=", "[", "]", "string", "{", "}", "\n", "hasBeegoRegex", ":=", "regexp", ".", "MustCompile", "(", "`(?s)package main.*?import.*?\\(.*?github.com/astaxie/beego\".*?\\).*func main()`", ")...
// IsBeegoProject checks whether the current path is a Beego application or not
[ "IsBeegoProject", "checks", "whether", "the", "current", "path", "is", "a", "Beego", "application", "or", "not" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L72-L109
25,819
beego/bee
utils/utils.go
SnakeString
func SnakeString(s string) string { data := make([]byte, 0, len(s)*2) j := false num := len(s) for i := 0; i < num; i++ { d := s[i] if i > 0 && d >= 'A' && d <= 'Z' && j { data = append(data, '_') } if d != '_' { j = true } data = append(data, d) } return strings.ToLower(string(data[:])) }
go
func SnakeString(s string) string { data := make([]byte, 0, len(s)*2) j := false num := len(s) for i := 0; i < num; i++ { d := s[i] if i > 0 && d >= 'A' && d <= 'Z' && j { data = append(data, '_') } if d != '_' { j = true } data = append(data, d) } return strings.ToLower(string(data[:])) }
[ "func", "SnakeString", "(", "s", "string", ")", "string", "{", "data", ":=", "make", "(", "[", "]", "byte", ",", "0", ",", "len", "(", "s", ")", "*", "2", ")", "\n", "j", ":=", "false", "\n", "num", ":=", "len", "(", "s", ")", "\n", "for", ...
// snake string, XxYy to xx_yy
[ "snake", "string", "XxYy", "to", "xx_yy" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L170-L185
25,820
beego/bee
utils/utils.go
FormatSourceCode
func FormatSourceCode(filename string) { cmd := exec.Command("gofmt", "-w", filename) if err := cmd.Run(); err != nil { beeLogger.Log.Warnf("Error while running gofmt: %s", err) } }
go
func FormatSourceCode(filename string) { cmd := exec.Command("gofmt", "-w", filename) if err := cmd.Run(); err != nil { beeLogger.Log.Warnf("Error while running gofmt: %s", err) } }
[ "func", "FormatSourceCode", "(", "filename", "string", ")", "{", "cmd", ":=", "exec", ".", "Command", "(", "\"", "\"", ",", "\"", "\"", ",", "filename", ")", "\n", "if", "err", ":=", "cmd", ".", "Run", "(", ")", ";", "err", "!=", "nil", "{", "bee...
// formatSourceCode formats source files
[ "formatSourceCode", "formats", "source", "files" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L222-L227
25,821
beego/bee
utils/utils.go
WriteToFile
func WriteToFile(filename, content string) { f, err := os.Create(filename) MustCheck(err) defer CloseFile(f) _, err = f.WriteString(content) MustCheck(err) }
go
func WriteToFile(filename, content string) { f, err := os.Create(filename) MustCheck(err) defer CloseFile(f) _, err = f.WriteString(content) MustCheck(err) }
[ "func", "WriteToFile", "(", "filename", ",", "content", "string", ")", "{", "f", ",", "err", ":=", "os", ".", "Create", "(", "filename", ")", "\n", "MustCheck", "(", "err", ")", "\n", "defer", "CloseFile", "(", "f", ")", "\n", "_", ",", "err", "=",...
// WriteToFile creates a file and writes content to it
[ "WriteToFile", "creates", "a", "file", "and", "writes", "content", "to", "it" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L244-L250
25,822
beego/bee
utils/utils.go
BeeFuncMap
func BeeFuncMap() template.FuncMap { return template.FuncMap{ "trim": strings.TrimSpace, "bold": colors.Bold, "headline": colors.MagentaBold, "foldername": colors.RedBold, "endline": EndLine, "tmpltostr": TmplToString, } }
go
func BeeFuncMap() template.FuncMap { return template.FuncMap{ "trim": strings.TrimSpace, "bold": colors.Bold, "headline": colors.MagentaBold, "foldername": colors.RedBold, "endline": EndLine, "tmpltostr": TmplToString, } }
[ "func", "BeeFuncMap", "(", ")", "template", ".", "FuncMap", "{", "return", "template", ".", "FuncMap", "{", "\"", "\"", ":", "strings", ".", "TrimSpace", ",", "\"", "\"", ":", "colors", ".", "Bold", ",", "\"", "\"", ":", "colors", ".", "MagentaBold", ...
// BeeFuncMap returns a FuncMap of functions used in different templates.
[ "BeeFuncMap", "returns", "a", "FuncMap", "of", "functions", "used", "in", "different", "templates", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L265-L274
25,823
beego/bee
utils/utils.go
TmplToString
func TmplToString(tmpl string, data interface{}) string { t := template.New("tmpl").Funcs(BeeFuncMap()) template.Must(t.Parse(tmpl)) var doc bytes.Buffer err := t.Execute(&doc, data) MustCheck(err) return doc.String() }
go
func TmplToString(tmpl string, data interface{}) string { t := template.New("tmpl").Funcs(BeeFuncMap()) template.Must(t.Parse(tmpl)) var doc bytes.Buffer err := t.Execute(&doc, data) MustCheck(err) return doc.String() }
[ "func", "TmplToString", "(", "tmpl", "string", ",", "data", "interface", "{", "}", ")", "string", "{", "t", ":=", "template", ".", "New", "(", "\"", "\"", ")", ".", "Funcs", "(", "BeeFuncMap", "(", ")", ")", "\n", "template", ".", "Must", "(", "t",...
// TmplToString parses a text template and return the result as a string.
[ "TmplToString", "parses", "a", "text", "template", "and", "return", "the", "result", "as", "a", "string", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L277-L286
25,824
beego/bee
utils/utils.go
GetFileModTime
func GetFileModTime(path string) int64 { path = strings.Replace(path, "\\", "/", -1) f, err := os.Open(path) if err != nil { beeLogger.Log.Errorf("Failed to open file on '%s': %s", path, err) return time.Now().Unix() } defer f.Close() fi, err := f.Stat() if err != nil { beeLogger.Log.Errorf("Failed to get...
go
func GetFileModTime(path string) int64 { path = strings.Replace(path, "\\", "/", -1) f, err := os.Open(path) if err != nil { beeLogger.Log.Errorf("Failed to open file on '%s': %s", path, err) return time.Now().Unix() } defer f.Close() fi, err := f.Stat() if err != nil { beeLogger.Log.Errorf("Failed to get...
[ "func", "GetFileModTime", "(", "path", "string", ")", "int64", "{", "path", "=", "strings", ".", "Replace", "(", "path", ",", "\"", "\\\\", "\"", ",", "\"", "\"", ",", "-", "1", ")", "\n", "f", ",", "err", ":=", "os", ".", "Open", "(", "path", ...
// GetFileModTime returns unix timestamp of `os.File.ModTime` for the given path.
[ "GetFileModTime", "returns", "unix", "timestamp", "of", "os", ".", "File", ".", "ModTime", "for", "the", "given", "path", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/utils/utils.go#L411-L427
25,825
beego/bee
cmd/commands/migrate/migrate.go
RunMigration
func RunMigration(cmd *commands.Command, args []string) int { currpath, _ := os.Getwd() gps := utils.GetGOPATHs() if len(gps) == 0 { beeLogger.Log.Fatal("GOPATH environment variable is not set or empty") } gopath := gps[0] beeLogger.Log.Debugf("GOPATH: %s", utils.FILE(), utils.LINE(), gopath) // Getting co...
go
func RunMigration(cmd *commands.Command, args []string) int { currpath, _ := os.Getwd() gps := utils.GetGOPATHs() if len(gps) == 0 { beeLogger.Log.Fatal("GOPATH environment variable is not set or empty") } gopath := gps[0] beeLogger.Log.Debugf("GOPATH: %s", utils.FILE(), utils.LINE(), gopath) // Getting co...
[ "func", "RunMigration", "(", "cmd", "*", "commands", ".", "Command", ",", "args", "[", "]", "string", ")", "int", "{", "currpath", ",", "_", ":=", "os", ".", "Getwd", "(", ")", "\n\n", "gps", ":=", "utils", ".", "GetGOPATHs", "(", ")", "\n", "if", ...
// runMigration is the entry point for starting a migration
[ "runMigration", "is", "the", "entry", "point", "for", "starting", "a", "migration" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L71-L140
25,826
beego/bee
cmd/commands/migrate/migrate.go
migrate
func migrate(goal, currpath, driver, connStr, dir string) { if dir == "" { dir = path.Join(currpath, "database", "migrations") } postfix := "" if runtime.GOOS == "windows" { postfix = ".exe" } binary := "m" + postfix source := binary + ".go" // Connect to database db, err := sql.Open(driver, connStr) if ...
go
func migrate(goal, currpath, driver, connStr, dir string) { if dir == "" { dir = path.Join(currpath, "database", "migrations") } postfix := "" if runtime.GOOS == "windows" { postfix = ".exe" } binary := "m" + postfix source := binary + ".go" // Connect to database db, err := sql.Open(driver, connStr) if ...
[ "func", "migrate", "(", "goal", ",", "currpath", ",", "driver", ",", "connStr", ",", "dir", "string", ")", "{", "if", "dir", "==", "\"", "\"", "{", "dir", "=", "path", ".", "Join", "(", "currpath", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "...
// migrate generates source code, build it, and invoke the binary who does the actual migration
[ "migrate", "generates", "source", "code", "build", "it", "and", "invoke", "the", "binary", "who", "does", "the", "actual", "migration" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L143-L168
25,827
beego/bee
cmd/commands/migrate/migrate.go
checkForSchemaUpdateTable
func checkForSchemaUpdateTable(db *sql.DB, driver string) { showTableSQL := showMigrationsTableSQL(driver) if rows, err := db.Query(showTableSQL); err != nil { beeLogger.Log.Fatalf("Could not show migrations table: %s", err) } else if !rows.Next() { // No migrations table, create new ones createTableSQL := cre...
go
func checkForSchemaUpdateTable(db *sql.DB, driver string) { showTableSQL := showMigrationsTableSQL(driver) if rows, err := db.Query(showTableSQL); err != nil { beeLogger.Log.Fatalf("Could not show migrations table: %s", err) } else if !rows.Next() { // No migrations table, create new ones createTableSQL := cre...
[ "func", "checkForSchemaUpdateTable", "(", "db", "*", "sql", ".", "DB", ",", "driver", "string", ")", "{", "showTableSQL", ":=", "showMigrationsTableSQL", "(", "driver", ")", "\n", "if", "rows", ",", "err", ":=", "db", ".", "Query", "(", "showTableSQL", ")"...
// checkForSchemaUpdateTable checks the existence of migrations table. // It checks for the proper table structures and creates the table using MYSQL_MIGRATION_DDL if it does not exist.
[ "checkForSchemaUpdateTable", "checks", "the", "existence", "of", "migrations", "table", ".", "It", "checks", "for", "the", "proper", "table", "structures", "and", "creates", "the", "table", "using", "MYSQL_MIGRATION_DDL", "if", "it", "does", "not", "exist", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L172-L217
25,828
beego/bee
cmd/commands/migrate/migrate.go
writeMigrationSourceFile
func writeMigrationSourceFile(dir, source, driver, connStr string, latestTime int64, latestName string, task string) { changeDir(dir) if f, err := os.OpenFile(source, os.O_CREATE|os.O_EXCL|os.O_RDWR, 0666); err != nil { beeLogger.Log.Fatalf("Could not create file: %s", err) } else { content := strings.Replace(Mi...
go
func writeMigrationSourceFile(dir, source, driver, connStr string, latestTime int64, latestName string, task string) { changeDir(dir) if f, err := os.OpenFile(source, os.O_CREATE|os.O_EXCL|os.O_RDWR, 0666); err != nil { beeLogger.Log.Fatalf("Could not create file: %s", err) } else { content := strings.Replace(Mi...
[ "func", "writeMigrationSourceFile", "(", "dir", ",", "source", ",", "driver", ",", "connStr", "string", ",", "latestTime", "int64", ",", "latestName", "string", ",", "task", "string", ")", "{", "changeDir", "(", "dir", ")", "\n", "if", "f", ",", "err", "...
// writeMigrationSourceFile create the source file based on MIGRATION_MAIN_TPL
[ "writeMigrationSourceFile", "create", "the", "source", "file", "based", "on", "MIGRATION_MAIN_TPL" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L291-L307
25,829
beego/bee
cmd/commands/migrate/migrate.go
changeDir
func changeDir(dir string) { if err := os.Chdir(dir); err != nil { beeLogger.Log.Fatalf("Could not find migration directory: %s", err) } }
go
func changeDir(dir string) { if err := os.Chdir(dir); err != nil { beeLogger.Log.Fatalf("Could not find migration directory: %s", err) } }
[ "func", "changeDir", "(", "dir", "string", ")", "{", "if", "err", ":=", "os", ".", "Chdir", "(", "dir", ")", ";", "err", "!=", "nil", "{", "beeLogger", ".", "Log", ".", "Fatalf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}" ]
// changeDir changes working directory to dir. // It exits the system when encouter an error
[ "changeDir", "changes", "working", "directory", "to", "dir", ".", "It", "exits", "the", "system", "when", "encouter", "an", "error" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L339-L343
25,830
beego/bee
cmd/commands/migrate/migrate.go
removeTempFile
func removeTempFile(dir, file string) { changeDir(dir) if err := os.Remove(file); err != nil { beeLogger.Log.Warnf("Could not remove temporary file: %s", err) } }
go
func removeTempFile(dir, file string) { changeDir(dir) if err := os.Remove(file); err != nil { beeLogger.Log.Warnf("Could not remove temporary file: %s", err) } }
[ "func", "removeTempFile", "(", "dir", ",", "file", "string", ")", "{", "changeDir", "(", "dir", ")", "\n", "if", "err", ":=", "os", ".", "Remove", "(", "file", ")", ";", "err", "!=", "nil", "{", "beeLogger", ".", "Log", ".", "Warnf", "(", "\"", "...
// removeTempFile removes a file in dir
[ "removeTempFile", "removes", "a", "file", "in", "dir" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L346-L351
25,831
beego/bee
cmd/commands/migrate/migrate.go
formatShellErrOutput
func formatShellErrOutput(o string) { for _, line := range strings.Split(o, "\n") { if line != "" { beeLogger.Log.Errorf("|> %s", line) } } }
go
func formatShellErrOutput(o string) { for _, line := range strings.Split(o, "\n") { if line != "" { beeLogger.Log.Errorf("|> %s", line) } } }
[ "func", "formatShellErrOutput", "(", "o", "string", ")", "{", "for", "_", ",", "line", ":=", "range", "strings", ".", "Split", "(", "o", ",", "\"", "\\n", "\"", ")", "{", "if", "line", "!=", "\"", "\"", "{", "beeLogger", ".", "Log", ".", "Errorf", ...
// formatShellErrOutput formats the error shell output
[ "formatShellErrOutput", "formats", "the", "error", "shell", "output" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L354-L360
25,832
beego/bee
cmd/commands/migrate/migrate.go
formatShellOutput
func formatShellOutput(o string) { for _, line := range strings.Split(o, "\n") { if line != "" { beeLogger.Log.Infof("|> %s", line) } } }
go
func formatShellOutput(o string) { for _, line := range strings.Split(o, "\n") { if line != "" { beeLogger.Log.Infof("|> %s", line) } } }
[ "func", "formatShellOutput", "(", "o", "string", ")", "{", "for", "_", ",", "line", ":=", "range", "strings", ".", "Split", "(", "o", ",", "\"", "\\n", "\"", ")", "{", "if", "line", "!=", "\"", "\"", "{", "beeLogger", ".", "Log", ".", "Infof", "(...
// formatShellOutput formats the normal shell output
[ "formatShellOutput", "formats", "the", "normal", "shell", "output" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L363-L369
25,833
beego/bee
cmd/commands/migrate/migrate.go
MigrateUpdate
func MigrateUpdate(currpath, driver, connStr, dir string) { migrate("upgrade", currpath, driver, connStr, dir) }
go
func MigrateUpdate(currpath, driver, connStr, dir string) { migrate("upgrade", currpath, driver, connStr, dir) }
[ "func", "MigrateUpdate", "(", "currpath", ",", "driver", ",", "connStr", ",", "dir", "string", ")", "{", "migrate", "(", "\"", "\"", ",", "currpath", ",", "driver", ",", "connStr", ",", "dir", ")", "\n", "}" ]
// MigrateUpdate does the schema update
[ "MigrateUpdate", "does", "the", "schema", "update" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L438-L440
25,834
beego/bee
cmd/commands/migrate/migrate.go
MigrateRollback
func MigrateRollback(currpath, driver, connStr, dir string) { migrate("rollback", currpath, driver, connStr, dir) }
go
func MigrateRollback(currpath, driver, connStr, dir string) { migrate("rollback", currpath, driver, connStr, dir) }
[ "func", "MigrateRollback", "(", "currpath", ",", "driver", ",", "connStr", ",", "dir", "string", ")", "{", "migrate", "(", "\"", "\"", ",", "currpath", ",", "driver", ",", "connStr", ",", "dir", ")", "\n", "}" ]
// MigrateRollback rolls back the latest migration
[ "MigrateRollback", "rolls", "back", "the", "latest", "migration" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L443-L445
25,835
beego/bee
cmd/commands/migrate/migrate.go
MigrateReset
func MigrateReset(currpath, driver, connStr, dir string) { migrate("reset", currpath, driver, connStr, dir) }
go
func MigrateReset(currpath, driver, connStr, dir string) { migrate("reset", currpath, driver, connStr, dir) }
[ "func", "MigrateReset", "(", "currpath", ",", "driver", ",", "connStr", ",", "dir", "string", ")", "{", "migrate", "(", "\"", "\"", ",", "currpath", ",", "driver", ",", "connStr", ",", "dir", ")", "\n", "}" ]
// MigrateReset rolls back all migrations
[ "MigrateReset", "rolls", "back", "all", "migrations" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L448-L450
25,836
beego/bee
cmd/commands/migrate/migrate.go
MigrateRefresh
func MigrateRefresh(currpath, driver, connStr, dir string) { migrate("refresh", currpath, driver, connStr, dir) }
go
func MigrateRefresh(currpath, driver, connStr, dir string) { migrate("refresh", currpath, driver, connStr, dir) }
[ "func", "MigrateRefresh", "(", "currpath", ",", "driver", ",", "connStr", ",", "dir", "string", ")", "{", "migrate", "(", "\"", "\"", ",", "currpath", ",", "driver", ",", "connStr", ",", "dir", ")", "\n", "}" ]
// MigrateRefresh rolls back all migrations and start over again
[ "MigrateRefresh", "rolls", "back", "all", "migrations", "and", "start", "over", "again" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/migrate/migrate.go#L453-L455
25,837
beego/bee
cmd/commands/run/run.go
isExcluded
func isExcluded(filePath string) bool { for _, p := range excludedPaths { absP, err := path.Abs(p) if err != nil { beeLogger.Log.Errorf("Cannot get absolute path of '%s'", p) continue } absFilePath, err := path.Abs(filePath) if err != nil { beeLogger.Log.Errorf("Cannot get absolute path of '%s'", fi...
go
func isExcluded(filePath string) bool { for _, p := range excludedPaths { absP, err := path.Abs(p) if err != nil { beeLogger.Log.Errorf("Cannot get absolute path of '%s'", p) continue } absFilePath, err := path.Abs(filePath) if err != nil { beeLogger.Log.Errorf("Cannot get absolute path of '%s'", fi...
[ "func", "isExcluded", "(", "filePath", "string", ")", "bool", "{", "for", "_", ",", "p", ":=", "range", "excludedPaths", "{", "absP", ",", "err", ":=", "path", ".", "Abs", "(", "p", ")", "\n", "if", "err", "!=", "nil", "{", "beeLogger", ".", "Log",...
// If a file is excluded
[ "If", "a", "file", "is", "excluded" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/run.go#L235-L253
25,838
beego/bee
logger/colors/color.go
NewModeColorWriter
func NewModeColorWriter(w io.Writer, mode outputMode) io.Writer { if _, ok := w.(*colorWriter); !ok { return &colorWriter{ w: w, mode: mode, } } return w }
go
func NewModeColorWriter(w io.Writer, mode outputMode) io.Writer { if _, ok := w.(*colorWriter); !ok { return &colorWriter{ w: w, mode: mode, } } return w }
[ "func", "NewModeColorWriter", "(", "w", "io", ".", "Writer", ",", "mode", "outputMode", ")", "io", ".", "Writer", "{", "if", "_", ",", "ok", ":=", "w", ".", "(", "*", "colorWriter", ")", ";", "!", "ok", "{", "return", "&", "colorWriter", "{", "w", ...
// NewModeColorWriter create and initializes a new ansiColorWriter // by specifying the outputMode.
[ "NewModeColorWriter", "create", "and", "initializes", "a", "new", "ansiColorWriter", "by", "specifying", "the", "outputMode", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/colors/color.go#L46-L54
25,839
beego/bee
cmd/commands/version/version.go
ShowShortVersionBanner
func ShowShortVersionBanner() { output := colors.NewColorWriter(os.Stdout) InitBanner(output, bytes.NewBufferString(colors.MagentaBold(shortVersionBanner))) }
go
func ShowShortVersionBanner() { output := colors.NewColorWriter(os.Stdout) InitBanner(output, bytes.NewBufferString(colors.MagentaBold(shortVersionBanner))) }
[ "func", "ShowShortVersionBanner", "(", ")", "{", "output", ":=", "colors", ".", "NewColorWriter", "(", "os", ".", "Stdout", ")", "\n", "InitBanner", "(", "output", ",", "bytes", ".", "NewBufferString", "(", "colors", ".", "MagentaBold", "(", "shortVersionBanne...
// ShowShortVersionBanner prints the short version banner.
[ "ShowShortVersionBanner", "prints", "the", "short", "version", "banner", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/version/version.go#L115-L118
25,840
beego/bee
cmd/commands/run/watch.go
NewWatcher
func NewWatcher(paths []string, files []string, isgenerate bool) { watcher, err := fsnotify.NewWatcher() if err != nil { beeLogger.Log.Fatalf("Failed to create watcher: %s", err) } go func() { for { select { case e := <-watcher.Events: isBuild := true if ifStaticFile(e.Name) && config.Conf.Enabl...
go
func NewWatcher(paths []string, files []string, isgenerate bool) { watcher, err := fsnotify.NewWatcher() if err != nil { beeLogger.Log.Fatalf("Failed to create watcher: %s", err) } go func() { for { select { case e := <-watcher.Events: isBuild := true if ifStaticFile(e.Name) && config.Conf.Enabl...
[ "func", "NewWatcher", "(", "paths", "[", "]", "string", ",", "files", "[", "]", "string", ",", "isgenerate", "bool", ")", "{", "watcher", ",", "err", ":=", "fsnotify", ".", "NewWatcher", "(", ")", "\n", "if", "err", "!=", "nil", "{", "beeLogger", "."...
// NewWatcher starts an fsnotify Watcher on the specified paths
[ "NewWatcher", "starts", "an", "fsnotify", "Watcher", "on", "the", "specified", "paths" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/watch.go#L51-L112
25,841
beego/bee
cmd/commands/run/watch.go
AutoBuild
func AutoBuild(files []string, isgenerate bool) { state.Lock() defer state.Unlock() os.Chdir(currpath) cmdName := "go" var ( err error stderr bytes.Buffer ) // For applications use full import path like "github.com/.../.." // are able to use "go install" to reduce build time. if config.Conf.GoInstall...
go
func AutoBuild(files []string, isgenerate bool) { state.Lock() defer state.Unlock() os.Chdir(currpath) cmdName := "go" var ( err error stderr bytes.Buffer ) // For applications use full import path like "github.com/.../.." // are able to use "go install" to reduce build time. if config.Conf.GoInstall...
[ "func", "AutoBuild", "(", "files", "[", "]", "string", ",", "isgenerate", "bool", ")", "{", "state", ".", "Lock", "(", ")", "\n", "defer", "state", ".", "Unlock", "(", ")", "\n\n", "os", ".", "Chdir", "(", "currpath", ")", "\n\n", "cmdName", ":=", ...
// AutoBuild builds the specified set of files
[ "AutoBuild", "builds", "the", "specified", "set", "of", "files" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/watch.go#L115-L176
25,842
beego/bee
cmd/commands/run/watch.go
Kill
func Kill() { defer func() { if e := recover(); e != nil { beeLogger.Log.Infof("Kill recover: %s", e) } }() if cmd != nil && cmd.Process != nil { // Windows does not support Interrupt if runtime.GOOS == "windows" { cmd.Process.Signal(os.Kill) } else { cmd.Process.Signal(os.Interrupt) } ch := ...
go
func Kill() { defer func() { if e := recover(); e != nil { beeLogger.Log.Infof("Kill recover: %s", e) } }() if cmd != nil && cmd.Process != nil { // Windows does not support Interrupt if runtime.GOOS == "windows" { cmd.Process.Signal(os.Kill) } else { cmd.Process.Signal(os.Interrupt) } ch := ...
[ "func", "Kill", "(", ")", "{", "defer", "func", "(", ")", "{", "if", "e", ":=", "recover", "(", ")", ";", "e", "!=", "nil", "{", "beeLogger", ".", "Log", ".", "Infof", "(", "\"", "\"", ",", "e", ")", "\n", "}", "\n", "}", "(", ")", "\n", ...
// Kill kills the running command process
[ "Kill", "kills", "the", "running", "command", "process" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/watch.go#L179-L211
25,843
beego/bee
cmd/commands/run/watch.go
Restart
func Restart(appname string) { beeLogger.Log.Debugf("Kill running process", utils.FILE(), utils.LINE()) Kill() go Start(appname) }
go
func Restart(appname string) { beeLogger.Log.Debugf("Kill running process", utils.FILE(), utils.LINE()) Kill() go Start(appname) }
[ "func", "Restart", "(", "appname", "string", ")", "{", "beeLogger", ".", "Log", ".", "Debugf", "(", "\"", "\"", ",", "utils", ".", "FILE", "(", ")", ",", "utils", ".", "LINE", "(", ")", ")", "\n", "Kill", "(", ")", "\n", "go", "Start", "(", "ap...
// Restart kills the running command process and starts it again
[ "Restart", "kills", "the", "running", "command", "process", "and", "starts", "it", "again" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/watch.go#L214-L218
25,844
beego/bee
cmd/commands/run/watch.go
Start
func Start(appname string) { beeLogger.Log.Infof("Restarting '%s'...", appname) if !strings.Contains(appname, "./") { appname = "./" + appname } cmd = exec.Command(appname) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if runargs != "" { r := regexp.MustCompile("'.+'|\".+\"|\\S+") m := r.FindAllString(run...
go
func Start(appname string) { beeLogger.Log.Infof("Restarting '%s'...", appname) if !strings.Contains(appname, "./") { appname = "./" + appname } cmd = exec.Command(appname) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if runargs != "" { r := regexp.MustCompile("'.+'|\".+\"|\\S+") m := r.FindAllString(run...
[ "func", "Start", "(", "appname", "string", ")", "{", "beeLogger", ".", "Log", ".", "Infof", "(", "\"", "\"", ",", "appname", ")", "\n", "if", "!", "strings", ".", "Contains", "(", "appname", ",", "\"", "\"", ")", "{", "appname", "=", "\"", "\"", ...
// Start starts the command process
[ "Start", "starts", "the", "command", "process" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/watch.go#L221-L242
25,845
beego/bee
cmd/commands/run/watch.go
shouldIgnoreFile
func shouldIgnoreFile(filename string) bool { for _, regex := range ignoredFilesRegExps { r, err := regexp.Compile(regex) if err != nil { beeLogger.Log.Fatalf("Could not compile regular expression: %s", err) } if r.MatchString(filename) { return true } continue } return false }
go
func shouldIgnoreFile(filename string) bool { for _, regex := range ignoredFilesRegExps { r, err := regexp.Compile(regex) if err != nil { beeLogger.Log.Fatalf("Could not compile regular expression: %s", err) } if r.MatchString(filename) { return true } continue } return false }
[ "func", "shouldIgnoreFile", "(", "filename", "string", ")", "bool", "{", "for", "_", ",", "regex", ":=", "range", "ignoredFilesRegExps", "{", "r", ",", "err", ":=", "regexp", ".", "Compile", "(", "regex", ")", "\n", "if", "err", "!=", "nil", "{", "beeL...
// shouldIgnoreFile ignores filenames generated by Emacs, Vim or SublimeText. // It returns true if the file should be ignored, false otherwise.
[ "shouldIgnoreFile", "ignores", "filenames", "generated", "by", "Emacs", "Vim", "or", "SublimeText", ".", "It", "returns", "true", "if", "the", "file", "should", "be", "ignored", "false", "otherwise", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/watch.go#L255-L267
25,846
beego/bee
cmd/commands/run/watch.go
shouldWatchFileWithExtension
func shouldWatchFileWithExtension(name string) bool { for _, s := range watchExts { if strings.HasSuffix(name, s) { return true } } return false }
go
func shouldWatchFileWithExtension(name string) bool { for _, s := range watchExts { if strings.HasSuffix(name, s) { return true } } return false }
[ "func", "shouldWatchFileWithExtension", "(", "name", "string", ")", "bool", "{", "for", "_", ",", "s", ":=", "range", "watchExts", "{", "if", "strings", ".", "HasSuffix", "(", "name", ",", "s", ")", "{", "return", "true", "\n", "}", "\n", "}", "\n", ...
// shouldWatchFileWithExtension returns true if the name of the file // hash a suffix that should be watched.
[ "shouldWatchFileWithExtension", "returns", "true", "if", "the", "name", "of", "the", "file", "hash", "a", "suffix", "that", "should", "be", "watched", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/cmd/commands/run/watch.go#L271-L278
25,847
beego/bee
logger/logger.go
GetBeeLogger
func GetBeeLogger(w io.Writer) *BeeLogger { once.Do(func() { var ( err error simpleLogFormat = `{{Now "2006/01/02 15:04:05"}} {{.Level}} ▶ {{.ID}} {{.Message}}{{EndLine}}` debugLogFormat = `{{Now "2006/01/02 15:04:05"}} {{.Level}} ▶ {{.ID}} {{.Filename}}:{{.LineNo}} {{.Message}}{{EndLine}}` )...
go
func GetBeeLogger(w io.Writer) *BeeLogger { once.Do(func() { var ( err error simpleLogFormat = `{{Now "2006/01/02 15:04:05"}} {{.Level}} ▶ {{.ID}} {{.Message}}{{EndLine}}` debugLogFormat = `{{Now "2006/01/02 15:04:05"}} {{.Level}} ▶ {{.ID}} {{.Filename}}:{{.LineNo}} {{.Message}}{{EndLine}}` )...
[ "func", "GetBeeLogger", "(", "w", "io", ".", "Writer", ")", "*", "BeeLogger", "{", "once", ".", "Do", "(", "func", "(", ")", "{", "var", "(", "err", "error", "\n", "simpleLogFormat", "=", "`{{Now \"2006/01/02 15:04:05\"}} {{.Level}} ▶ {{.ID}} {{.Message}}{{EndLine...
// GetBeeLogger initializes the logger instance with a NewColorWriter output // and returns a singleton
[ "GetBeeLogger", "initializes", "the", "logger", "instance", "with", "a", "NewColorWriter", "output", "and", "returns", "a", "singleton" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L77-L102
25,848
beego/bee
logger/logger.go
SetOutput
func (l *BeeLogger) SetOutput(w io.Writer) { l.mu.Lock() defer l.mu.Unlock() l.output = colors.NewColorWriter(w) }
go
func (l *BeeLogger) SetOutput(w io.Writer) { l.mu.Lock() defer l.mu.Unlock() l.output = colors.NewColorWriter(w) }
[ "func", "(", "l", "*", "BeeLogger", ")", "SetOutput", "(", "w", "io", ".", "Writer", ")", "{", "l", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "l", ".", "mu", ".", "Unlock", "(", ")", "\n", "l", ".", "output", "=", "colors", ".", "NewCo...
// SetOutput sets the logger output destination
[ "SetOutput", "sets", "the", "logger", "output", "destination" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L105-L109
25,849
beego/bee
logger/logger.go
mustLog
func (l *BeeLogger) mustLog(level int, message string, args ...interface{}) { if level > logLevel { return } // Acquire the lock l.mu.Lock() defer l.mu.Unlock() // Create the logging record and pass into the output record := LogRecord{ ID: fmt.Sprintf("%04d", atomic.AddUint64(&sequenceNo, 1)), Level:...
go
func (l *BeeLogger) mustLog(level int, message string, args ...interface{}) { if level > logLevel { return } // Acquire the lock l.mu.Lock() defer l.mu.Unlock() // Create the logging record and pass into the output record := LogRecord{ ID: fmt.Sprintf("%04d", atomic.AddUint64(&sequenceNo, 1)), Level:...
[ "func", "(", "l", "*", "BeeLogger", ")", "mustLog", "(", "level", "int", ",", "message", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "if", "level", ">", "logLevel", "{", "return", "\n", "}", "\n", "// Acquire the lock", "l", ".", "...
// mustLog logs the message according to the specified level and arguments. // It panics in case of an error.
[ "mustLog", "logs", "the", "message", "according", "to", "the", "specified", "level", "and", "arguments", ".", "It", "panics", "in", "case", "of", "an", "error", "." ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L169-L188
25,850
beego/bee
logger/logger.go
mustLogDebug
func (l *BeeLogger) mustLogDebug(message string, file string, line int, args ...interface{}) { if !debugMode { return } // Change the output to Stderr l.SetOutput(os.Stderr) // Create the log record record := LogRecord{ ID: fmt.Sprintf("%04d", atomic.AddUint64(&sequenceNo, 1)), Level: l.getColorL...
go
func (l *BeeLogger) mustLogDebug(message string, file string, line int, args ...interface{}) { if !debugMode { return } // Change the output to Stderr l.SetOutput(os.Stderr) // Create the log record record := LogRecord{ ID: fmt.Sprintf("%04d", atomic.AddUint64(&sequenceNo, 1)), Level: l.getColorL...
[ "func", "(", "l", "*", "BeeLogger", ")", "mustLogDebug", "(", "message", "string", ",", "file", "string", ",", "line", "int", ",", "args", "...", "interface", "{", "}", ")", "{", "if", "!", "debugMode", "{", "return", "\n", "}", "\n\n", "// Change the ...
// mustLogDebug logs a debug message only if debug mode // is enabled. i.e. DEBUG_ENABLED="1"
[ "mustLogDebug", "logs", "a", "debug", "message", "only", "if", "debug", "mode", "is", "enabled", ".", "i", ".", "e", ".", "DEBUG_ENABLED", "=", "1" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L192-L212
25,851
beego/bee
logger/logger.go
Debug
func (l *BeeLogger) Debug(message string, file string, line int) { l.mustLogDebug(message, file, line) }
go
func (l *BeeLogger) Debug(message string, file string, line int) { l.mustLogDebug(message, file, line) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Debug", "(", "message", "string", ",", "file", "string", ",", "line", "int", ")", "{", "l", ".", "mustLogDebug", "(", "message", ",", "file", ",", "line", ")", "\n", "}" ]
// Debug outputs a debug log message
[ "Debug", "outputs", "a", "debug", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L215-L217
25,852
beego/bee
logger/logger.go
Debugf
func (l *BeeLogger) Debugf(message string, file string, line int, vars ...interface{}) { l.mustLogDebug(message, file, line, vars...) }
go
func (l *BeeLogger) Debugf(message string, file string, line int, vars ...interface{}) { l.mustLogDebug(message, file, line, vars...) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Debugf", "(", "message", "string", ",", "file", "string", ",", "line", "int", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLogDebug", "(", "message", ",", "file", ",", "line", ",", "v...
// Debugf outputs a formatted debug log message
[ "Debugf", "outputs", "a", "formatted", "debug", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L220-L222
25,853
beego/bee
logger/logger.go
Infof
func (l *BeeLogger) Infof(message string, vars ...interface{}) { l.mustLog(levelInfo, message, vars...) }
go
func (l *BeeLogger) Infof(message string, vars ...interface{}) { l.mustLog(levelInfo, message, vars...) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Infof", "(", "message", "string", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLog", "(", "levelInfo", ",", "message", ",", "vars", "...", ")", "\n", "}" ]
// Infof outputs a formatted information log message
[ "Infof", "outputs", "a", "formatted", "information", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L230-L232
25,854
beego/bee
logger/logger.go
Warnf
func (l *BeeLogger) Warnf(message string, vars ...interface{}) { l.mustLog(levelWarn, message, vars...) }
go
func (l *BeeLogger) Warnf(message string, vars ...interface{}) { l.mustLog(levelWarn, message, vars...) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Warnf", "(", "message", "string", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLog", "(", "levelWarn", ",", "message", ",", "vars", "...", ")", "\n", "}" ]
// Warnf outputs a formatted warning log message
[ "Warnf", "outputs", "a", "formatted", "warning", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L240-L242
25,855
beego/bee
logger/logger.go
Errorf
func (l *BeeLogger) Errorf(message string, vars ...interface{}) { l.mustLog(levelError, message, vars...) }
go
func (l *BeeLogger) Errorf(message string, vars ...interface{}) { l.mustLog(levelError, message, vars...) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Errorf", "(", "message", "string", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLog", "(", "levelError", ",", "message", ",", "vars", "...", ")", "\n", "}" ]
// Errorf outputs a formatted error log message
[ "Errorf", "outputs", "a", "formatted", "error", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L250-L252
25,856
beego/bee
logger/logger.go
Fatal
func (l *BeeLogger) Fatal(message string) { l.mustLog(levelFatal, message) os.Exit(255) }
go
func (l *BeeLogger) Fatal(message string) { l.mustLog(levelFatal, message) os.Exit(255) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Fatal", "(", "message", "string", ")", "{", "l", ".", "mustLog", "(", "levelFatal", ",", "message", ")", "\n", "os", ".", "Exit", "(", "255", ")", "\n", "}" ]
// Fatal outputs a fatal log message and exists
[ "Fatal", "outputs", "a", "fatal", "log", "message", "and", "exists" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L255-L258
25,857
beego/bee
logger/logger.go
Fatalf
func (l *BeeLogger) Fatalf(message string, vars ...interface{}) { l.mustLog(levelFatal, message, vars...) os.Exit(255) }
go
func (l *BeeLogger) Fatalf(message string, vars ...interface{}) { l.mustLog(levelFatal, message, vars...) os.Exit(255) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Fatalf", "(", "message", "string", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLog", "(", "levelFatal", ",", "message", ",", "vars", "...", ")", "\n", "os", ".", "Exit", "(", "255", ...
// Fatalf outputs a formatted log message and exists
[ "Fatalf", "outputs", "a", "formatted", "log", "message", "and", "exists" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L261-L264
25,858
beego/bee
logger/logger.go
Successf
func (l *BeeLogger) Successf(message string, vars ...interface{}) { l.mustLog(levelSuccess, message, vars...) }
go
func (l *BeeLogger) Successf(message string, vars ...interface{}) { l.mustLog(levelSuccess, message, vars...) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Successf", "(", "message", "string", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLog", "(", "levelSuccess", ",", "message", ",", "vars", "...", ")", "\n", "}" ]
// Successf outputs a formatted success log message
[ "Successf", "outputs", "a", "formatted", "success", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L272-L274
25,859
beego/bee
logger/logger.go
Hintf
func (l *BeeLogger) Hintf(message string, vars ...interface{}) { l.mustLog(levelHint, message, vars...) }
go
func (l *BeeLogger) Hintf(message string, vars ...interface{}) { l.mustLog(levelHint, message, vars...) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Hintf", "(", "message", "string", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLog", "(", "levelHint", ",", "message", ",", "vars", "...", ")", "\n", "}" ]
// Hintf outputs a formatted hint log message
[ "Hintf", "outputs", "a", "formatted", "hint", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L282-L284
25,860
beego/bee
logger/logger.go
Criticalf
func (l *BeeLogger) Criticalf(message string, vars ...interface{}) { l.mustLog(levelCritical, message, vars...) }
go
func (l *BeeLogger) Criticalf(message string, vars ...interface{}) { l.mustLog(levelCritical, message, vars...) }
[ "func", "(", "l", "*", "BeeLogger", ")", "Criticalf", "(", "message", "string", ",", "vars", "...", "interface", "{", "}", ")", "{", "l", ".", "mustLog", "(", "levelCritical", ",", "message", ",", "vars", "...", ")", "\n", "}" ]
// Criticalf outputs a formatted critical log message
[ "Criticalf", "outputs", "a", "formatted", "critical", "log", "message" ]
6a86284cec9a17f9aae6fe82ecf3c436aafed68d
https://github.com/beego/bee/blob/6a86284cec9a17f9aae6fe82ecf3c436aafed68d/logger/logger.go#L292-L294
25,861
cloudfoundry/cli
actor/v3action/organization.go
GetOrganizationByName
func (actor Actor) GetOrganizationByName(name string) (Organization, Warnings, error) { orgs, warnings, err := actor.CloudControllerClient.GetOrganizations( ccv3.Query{Key: ccv3.NameFilter, Values: []string{name}}, ) if err != nil { return Organization{}, Warnings(warnings), err } if len(orgs) == 0 { return...
go
func (actor Actor) GetOrganizationByName(name string) (Organization, Warnings, error) { orgs, warnings, err := actor.CloudControllerClient.GetOrganizations( ccv3.Query{Key: ccv3.NameFilter, Values: []string{name}}, ) if err != nil { return Organization{}, Warnings(warnings), err } if len(orgs) == 0 { return...
[ "func", "(", "actor", "Actor", ")", "GetOrganizationByName", "(", "name", "string", ")", "(", "Organization", ",", "Warnings", ",", "error", ")", "{", "orgs", ",", "warnings", ",", "err", ":=", "actor", ".", "CloudControllerClient", ".", "GetOrganizations", ...
// GetOrganizationByName returns the organization with the given name.
[ "GetOrganizationByName", "returns", "the", "organization", "with", "the", "given", "name", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/organization.go#L14-L27
25,862
cloudfoundry/cli
util/configv3/json_config.go
SetOrganizationInformation
func (config *Config) SetOrganizationInformation(guid string, name string) { config.ConfigFile.TargetedOrganization.GUID = guid config.ConfigFile.TargetedOrganization.Name = name config.ConfigFile.TargetedOrganization.QuotaDefinition = QuotaDefinition{} }
go
func (config *Config) SetOrganizationInformation(guid string, name string) { config.ConfigFile.TargetedOrganization.GUID = guid config.ConfigFile.TargetedOrganization.Name = name config.ConfigFile.TargetedOrganization.QuotaDefinition = QuotaDefinition{} }
[ "func", "(", "config", "*", "Config", ")", "SetOrganizationInformation", "(", "guid", "string", ",", "name", "string", ")", "{", "config", ".", "ConfigFile", ".", "TargetedOrganization", ".", "GUID", "=", "guid", "\n", "config", ".", "ConfigFile", ".", "Targ...
// SetOrganizationInformation sets the currently targeted organization.
[ "SetOrganizationInformation", "sets", "the", "currently", "targeted", "organization", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/json_config.go#L140-L144
25,863
cloudfoundry/cli
util/configv3/json_config.go
SetSpaceInformation
func (config *Config) SetSpaceInformation(guid string, name string, allowSSH bool) { config.V7SetSpaceInformation(guid, name) config.ConfigFile.TargetedSpace.AllowSSH = allowSSH }
go
func (config *Config) SetSpaceInformation(guid string, name string, allowSSH bool) { config.V7SetSpaceInformation(guid, name) config.ConfigFile.TargetedSpace.AllowSSH = allowSSH }
[ "func", "(", "config", "*", "Config", ")", "SetSpaceInformation", "(", "guid", "string", ",", "name", "string", ",", "allowSSH", "bool", ")", "{", "config", ".", "V7SetSpaceInformation", "(", "guid", ",", "name", ")", "\n", "config", ".", "ConfigFile", "."...
// SetSpaceInformation sets the currently targeted space.
[ "SetSpaceInformation", "sets", "the", "currently", "targeted", "space", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/json_config.go#L152-L155
25,864
cloudfoundry/cli
util/configv3/json_config.go
SetTargetInformation
func (config *Config) SetTargetInformation(api string, apiVersion string, auth string, minCLIVersion string, doppler string, routing string, skipSSLValidation bool) { config.ConfigFile.Target = api config.ConfigFile.APIVersion = apiVersion config.ConfigFile.AuthorizationEndpoint = auth config.SetMinCLIVersion(minCL...
go
func (config *Config) SetTargetInformation(api string, apiVersion string, auth string, minCLIVersion string, doppler string, routing string, skipSSLValidation bool) { config.ConfigFile.Target = api config.ConfigFile.APIVersion = apiVersion config.ConfigFile.AuthorizationEndpoint = auth config.SetMinCLIVersion(minCL...
[ "func", "(", "config", "*", "Config", ")", "SetTargetInformation", "(", "api", "string", ",", "apiVersion", "string", ",", "auth", "string", ",", "minCLIVersion", "string", ",", "doppler", "string", ",", "routing", "string", ",", "skipSSLValidation", "bool", "...
// SetTargetInformation sets the currently targeted CC API and related other // related API URLs.
[ "SetTargetInformation", "sets", "the", "currently", "targeted", "CC", "API", "and", "related", "other", "related", "API", "URLs", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/json_config.go#L159-L169
25,865
cloudfoundry/cli
util/configv3/json_config.go
SetUAAClientCredentials
func (config *Config) SetUAAClientCredentials(client string, clientSecret string) { config.ConfigFile.UAAOAuthClient = client config.ConfigFile.UAAOAuthClientSecret = clientSecret }
go
func (config *Config) SetUAAClientCredentials(client string, clientSecret string) { config.ConfigFile.UAAOAuthClient = client config.ConfigFile.UAAOAuthClientSecret = clientSecret }
[ "func", "(", "config", "*", "Config", ")", "SetUAAClientCredentials", "(", "client", "string", ",", "clientSecret", "string", ")", "{", "config", ".", "ConfigFile", ".", "UAAOAuthClient", "=", "client", "\n", "config", ".", "ConfigFile", ".", "UAAOAuthClientSecr...
// SetUAAClientCredentials sets the client credentials.
[ "SetUAAClientCredentials", "sets", "the", "client", "credentials", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/json_config.go#L179-L182
25,866
cloudfoundry/cli
util/configv3/json_config.go
V7SetSpaceInformation
func (config *Config) V7SetSpaceInformation(guid string, name string) { config.ConfigFile.TargetedSpace.GUID = guid config.ConfigFile.TargetedSpace.Name = name }
go
func (config *Config) V7SetSpaceInformation(guid string, name string) { config.ConfigFile.TargetedSpace.GUID = guid config.ConfigFile.TargetedSpace.Name = name }
[ "func", "(", "config", "*", "Config", ")", "V7SetSpaceInformation", "(", "guid", "string", ",", "name", "string", ")", "{", "config", ".", "ConfigFile", ".", "TargetedSpace", ".", "GUID", "=", "guid", "\n", "config", ".", "ConfigFile", ".", "TargetedSpace", ...
// V7SetSpaceInformation sets the currently targeted space.
[ "V7SetSpaceInformation", "sets", "the", "currently", "targeted", "space", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/json_config.go#L268-L271
25,867
cloudfoundry/cli
actor/v3action/actor.go
NewActor
func NewActor(client CloudControllerClient, config Config, sharedActor SharedActor, uaaClient UAAClient) *Actor { return &Actor{ CloudControllerClient: client, Config: config, SharedActor: sharedActor, UAAClient: uaaClient, } }
go
func NewActor(client CloudControllerClient, config Config, sharedActor SharedActor, uaaClient UAAClient) *Actor { return &Actor{ CloudControllerClient: client, Config: config, SharedActor: sharedActor, UAAClient: uaaClient, } }
[ "func", "NewActor", "(", "client", "CloudControllerClient", ",", "config", "Config", ",", "sharedActor", "SharedActor", ",", "uaaClient", "UAAClient", ")", "*", "Actor", "{", "return", "&", "Actor", "{", "CloudControllerClient", ":", "client", ",", "Config", ":"...
// NewActor returns a new V3 actor.
[ "NewActor", "returns", "a", "new", "V3", "actor", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/actor.go#L24-L31
25,868
cloudfoundry/cli
api/cloudcontroller/ccv2/service_binding.go
UnmarshalJSON
func (serviceBinding *ServiceBinding) UnmarshalJSON(data []byte) error { var ccServiceBinding struct { Metadata internal.Metadata Entity struct { AppGUID string `json:"app_guid"` ServiceInstanceGUID string `json:"service_instance_guid"` Name string `json:"...
go
func (serviceBinding *ServiceBinding) UnmarshalJSON(data []byte) error { var ccServiceBinding struct { Metadata internal.Metadata Entity struct { AppGUID string `json:"app_guid"` ServiceInstanceGUID string `json:"service_instance_guid"` Name string `json:"...
[ "func", "(", "serviceBinding", "*", "ServiceBinding", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "ccServiceBinding", "struct", "{", "Metadata", "internal", ".", "Metadata", "\n", "Entity", "struct", "{", "AppGUID", "string",...
// UnmarshalJSON helps unmarshal a Cloud Controller Service Binding response.
[ "UnmarshalJSON", "helps", "unmarshal", "a", "Cloud", "Controller", "Service", "Binding", "response", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_binding.go#L29-L50
25,869
cloudfoundry/cli
api/cloudcontroller/ccv2/service_binding.go
DeleteServiceBinding
func (client *Client) DeleteServiceBinding(serviceBindingGUID string, acceptsIncomplete bool) (ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteServiceBindingRequest, URIParams: map[string]string{"service_binding_guid": serviceBindingGUID}, Qu...
go
func (client *Client) DeleteServiceBinding(serviceBindingGUID string, acceptsIncomplete bool) (ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteServiceBindingRequest, URIParams: map[string]string{"service_binding_guid": serviceBindingGUID}, Qu...
[ "func", "(", "client", "*", "Client", ")", "DeleteServiceBinding", "(", "serviceBindingGUID", "string", ",", "acceptsIncomplete", "bool", ")", "(", "ServiceBinding", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPR...
// DeleteServiceBinding deletes the specified Service Binding. An updated // service binding is returned only if acceptsIncomplete is true.
[ "DeleteServiceBinding", "deletes", "the", "specified", "Service", "Binding", ".", "An", "updated", "service", "binding", "is", "returned", "only", "if", "acceptsIncomplete", "is", "true", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_binding.go#L98-L118
25,870
cloudfoundry/cli
api/cloudcontroller/ccv2/service_binding.go
GetServiceBinding
func (client *Client) GetServiceBinding(guid string) (ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceBindingRequest, URIParams: Params{"service_binding_guid": guid}, }) if err != nil { return ServiceBinding{}, nil, err } var service...
go
func (client *Client) GetServiceBinding(guid string) (ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceBindingRequest, URIParams: Params{"service_binding_guid": guid}, }) if err != nil { return ServiceBinding{}, nil, err } var service...
[ "func", "(", "client", "*", "Client", ")", "GetServiceBinding", "(", "guid", "string", ")", "(", "ServiceBinding", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName...
// GetServiceBinding returns back a service binding with the provided GUID.
[ "GetServiceBinding", "returns", "back", "a", "service", "binding", "with", "the", "provided", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_binding.go#L121-L137
25,871
cloudfoundry/cli
api/cloudcontroller/ccv2/service_binding.go
GetServiceBindings
func (client *Client) GetServiceBindings(filters ...Filter) ([]ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceBindingsRequest, Query: ConvertFilterParameters(filters), }) if err != nil { return nil, nil, err } var fullBindingsLi...
go
func (client *Client) GetServiceBindings(filters ...Filter) ([]ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceBindingsRequest, Query: ConvertFilterParameters(filters), }) if err != nil { return nil, nil, err } var fullBindingsLi...
[ "func", "(", "client", "*", "Client", ")", "GetServiceBindings", "(", "filters", "...", "Filter", ")", "(", "[", "]", "ServiceBinding", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOpti...
// GetServiceBindings returns back a list of Service Bindings based off of the // provided filters.
[ "GetServiceBindings", "returns", "back", "a", "list", "of", "Service", "Bindings", "based", "off", "of", "the", "provided", "filters", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_binding.go#L141-L164
25,872
cloudfoundry/cli
api/cloudcontroller/ccv2/service_binding.go
GetServiceInstanceServiceBindings
func (client *Client) GetServiceInstanceServiceBindings(serviceInstanceGUID string) ([]ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceInstanceServiceBindingsRequest, URIParams: map[string]string{"service_instance_guid": serviceInstanceGUID...
go
func (client *Client) GetServiceInstanceServiceBindings(serviceInstanceGUID string) ([]ServiceBinding, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceInstanceServiceBindingsRequest, URIParams: map[string]string{"service_instance_guid": serviceInstanceGUID...
[ "func", "(", "client", "*", "Client", ")", "GetServiceInstanceServiceBindings", "(", "serviceInstanceGUID", "string", ")", "(", "[", "]", "ServiceBinding", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "...
// GetServiceInstanceServiceBindings returns back a list of Service Bindings for the provided service instance GUID.
[ "GetServiceInstanceServiceBindings", "returns", "back", "a", "list", "of", "Service", "Bindings", "for", "the", "provided", "service", "instance", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_binding.go#L167-L190
25,873
cloudfoundry/cli
api/cloudcontroller/ccv2/feature_flag.go
GetConfigFeatureFlags
func (client Client) GetConfigFeatureFlags() ([]FeatureFlag, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetConfigFeatureFlagsRequest, }) if err != nil { return nil, nil, err } var featureFlags []FeatureFlag response := cloudcontroller.Response{ DecodeJSON...
go
func (client Client) GetConfigFeatureFlags() ([]FeatureFlag, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetConfigFeatureFlagsRequest, }) if err != nil { return nil, nil, err } var featureFlags []FeatureFlag response := cloudcontroller.Response{ DecodeJSON...
[ "func", "(", "client", "Client", ")", "GetConfigFeatureFlags", "(", ")", "(", "[", "]", "FeatureFlag", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ":", "i...
// GetConfigFeatureFlags retrieves a list of FeatureFlag from the Cloud // Controller.
[ "GetConfigFeatureFlags", "retrieves", "a", "list", "of", "FeatureFlag", "from", "the", "Cloud", "Controller", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/feature_flag.go#L21-L36
25,874
cloudfoundry/cli
api/router/connection_wrapper.go
WrapConnection
func (client *Client) WrapConnection(wrapper ConnectionWrapper) { client.connection = wrapper.Wrap(client.connection) }
go
func (client *Client) WrapConnection(wrapper ConnectionWrapper) { client.connection = wrapper.Wrap(client.connection) }
[ "func", "(", "client", "*", "Client", ")", "WrapConnection", "(", "wrapper", "ConnectionWrapper", ")", "{", "client", ".", "connection", "=", "wrapper", ".", "Wrap", "(", "client", ".", "connection", ")", "\n", "}" ]
// WrapConnection wraps the current Client connection in the wrapper.
[ "WrapConnection", "wraps", "the", "current", "Client", "connection", "in", "the", "wrapper", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/router/connection_wrapper.go#L13-L15
25,875
cloudfoundry/cli
actor/v3action/target.go
ClearTarget
func (actor Actor) ClearTarget() { actor.Config.SetTargetInformation("", "", "", "", "", "", false) actor.Config.SetTokenInformation("", "", "") }
go
func (actor Actor) ClearTarget() { actor.Config.SetTargetInformation("", "", "", "", "", "", false) actor.Config.SetTokenInformation("", "", "") }
[ "func", "(", "actor", "Actor", ")", "ClearTarget", "(", ")", "{", "actor", ".", "Config", ".", "SetTargetInformation", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "false", ")", "\n", ...
// ClearTarget clears target information from the actor.
[ "ClearTarget", "clears", "target", "information", "from", "the", "actor", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/v3action/target.go#L43-L46
25,876
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
UnmarshalJSON
func (space *Space) UnmarshalJSON(data []byte) error { var ccSpace struct { Metadata internal.Metadata `json:"metadata"` Entity struct { Name string `json:"name"` AllowSSH bool `json:"allow_ssh"` SpaceQuotaDefinitionGUID string `json:"space_quota_definition_guid"` ...
go
func (space *Space) UnmarshalJSON(data []byte) error { var ccSpace struct { Metadata internal.Metadata `json:"metadata"` Entity struct { Name string `json:"name"` AllowSSH bool `json:"allow_ssh"` SpaceQuotaDefinitionGUID string `json:"space_quota_definition_guid"` ...
[ "func", "(", "space", "*", "Space", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "ccSpace", "struct", "{", "Metadata", "internal", ".", "Metadata", "`json:\"metadata\"`", "\n", "Entity", "struct", "{", "Name", "string", "`...
// UnmarshalJSON helps unmarshal a Cloud Controller Space response.
[ "UnmarshalJSON", "helps", "unmarshal", "a", "Cloud", "Controller", "Space", "response", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L34-L55
25,877
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
CreateSpace
func (client *Client) CreateSpace(spaceName string, orgGUID string) (Space, Warnings, error) { requestBody := createSpaceRequestBody{ Name: spaceName, OrganizationGUID: orgGUID, } bodyBytes, _ := json.Marshal(requestBody) request, err := client.newHTTPRequest(requestOptions{ RequestName: interna...
go
func (client *Client) CreateSpace(spaceName string, orgGUID string) (Space, Warnings, error) { requestBody := createSpaceRequestBody{ Name: spaceName, OrganizationGUID: orgGUID, } bodyBytes, _ := json.Marshal(requestBody) request, err := client.newHTTPRequest(requestOptions{ RequestName: interna...
[ "func", "(", "client", "*", "Client", ")", "CreateSpace", "(", "spaceName", "string", ",", "orgGUID", "string", ")", "(", "Space", ",", "Warnings", ",", "error", ")", "{", "requestBody", ":=", "createSpaceRequestBody", "{", "Name", ":", "spaceName", ",", "...
// CreateSpace creates a new space with the provided spaceName in the org with // the provided orgGUID.
[ "CreateSpace", "creates", "a", "new", "space", "with", "the", "provided", "spaceName", "in", "the", "org", "with", "the", "provided", "orgGUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L64-L89
25,878
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
DeleteSpace
func (client *Client) DeleteSpace(guid string) (Job, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteSpaceRequest, URIParams: Params{"space_guid": guid}, Query: url.Values{ "recursive": {"true"}, "async": {"true"}, }, }) if err != nil { retur...
go
func (client *Client) DeleteSpace(guid string) (Job, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteSpaceRequest, URIParams: Params{"space_guid": guid}, Query: url.Values{ "recursive": {"true"}, "async": {"true"}, }, }) if err != nil { retur...
[ "func", "(", "client", "*", "Client", ")", "DeleteSpace", "(", "guid", "string", ")", "(", "Job", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ":", "inte...
// DeleteSpace deletes the Space associated with the provided // GUID. It will return the Cloud Controller job that is assigned to the // Space deletion.
[ "DeleteSpace", "deletes", "the", "Space", "associated", "with", "the", "provided", "GUID", ".", "It", "will", "return", "the", "Cloud", "Controller", "job", "that", "is", "assigned", "to", "the", "Space", "deletion", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L94-L114
25,879
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
GetSecurityGroupSpaces
func (client *Client) GetSecurityGroupSpaces(securityGroupGUID string) ([]Space, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSecurityGroupSpacesRequest, URIParams: map[string]string{"security_group_guid": securityGroupGUID}, }) if err != nil { return nil,...
go
func (client *Client) GetSecurityGroupSpaces(securityGroupGUID string) ([]Space, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSecurityGroupSpacesRequest, URIParams: map[string]string{"security_group_guid": securityGroupGUID}, }) if err != nil { return nil,...
[ "func", "(", "client", "*", "Client", ")", "GetSecurityGroupSpaces", "(", "securityGroupGUID", "string", ")", "(", "[", "]", "Space", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions"...
// GetSecurityGroupSpaces returns a list of Spaces based on the provided // SecurityGroup GUID.
[ "GetSecurityGroupSpaces", "returns", "a", "list", "of", "Spaces", "based", "on", "the", "provided", "SecurityGroup", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L118-L141
25,880
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
GetSpaces
func (client *Client) GetSpaces(filters ...Filter) ([]Space, Warnings, error) { params := ConvertFilterParameters(filters) params.Add("order-by", "name") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSpacesRequest, Query: params, }) if err != nil { return nil, nil, err ...
go
func (client *Client) GetSpaces(filters ...Filter) ([]Space, Warnings, error) { params := ConvertFilterParameters(filters) params.Add("order-by", "name") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetSpacesRequest, Query: params, }) if err != nil { return nil, nil, err ...
[ "func", "(", "client", "*", "Client", ")", "GetSpaces", "(", "filters", "...", "Filter", ")", "(", "[", "]", "Space", ",", "Warnings", ",", "error", ")", "{", "params", ":=", "ConvertFilterParameters", "(", "filters", ")", "\n", "params", ".", "Add", "...
// GetSpaces returns a list of Spaces based off of the provided filters.
[ "GetSpaces", "returns", "a", "list", "of", "Spaces", "based", "off", "of", "the", "provided", "filters", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L171-L196
25,881
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
UpdateSpaceDeveloper
func (client *Client) UpdateSpaceDeveloper(spaceGUID string, uaaID string) (Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PutSpaceDeveloperRequest, URIParams: map[string]string{ "space_guid": spaceGUID, "developer_guid": uaaID, }, }) if err != nil { ...
go
func (client *Client) UpdateSpaceDeveloper(spaceGUID string, uaaID string) (Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.PutSpaceDeveloperRequest, URIParams: map[string]string{ "space_guid": spaceGUID, "developer_guid": uaaID, }, }) if err != nil { ...
[ "func", "(", "client", "*", "Client", ")", "UpdateSpaceDeveloper", "(", "spaceGUID", "string", ",", "uaaID", "string", ")", "(", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "...
// UpdateSpaceDeveloper grants the space developer role to the user or client // associated with the given UAA ID.
[ "UpdateSpaceDeveloper", "grants", "the", "space", "developer", "role", "to", "the", "user", "or", "client", "associated", "with", "the", "given", "UAA", "ID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L200-L215
25,882
cloudfoundry/cli
api/cloudcontroller/ccv2/space.go
UpdateSpaceManagerByUsername
func (client *Client) UpdateSpaceManagerByUsername(spaceGUID string, username string) (Warnings, error) { requestBody := updateRoleRequestBody{ Username: username, } bodyBytes, err := json.Marshal(requestBody) if err != nil { return Warnings{}, err } request, err := client.newHTTPRequest(requestOptions{ Re...
go
func (client *Client) UpdateSpaceManagerByUsername(spaceGUID string, username string) (Warnings, error) { requestBody := updateRoleRequestBody{ Username: username, } bodyBytes, err := json.Marshal(requestBody) if err != nil { return Warnings{}, err } request, err := client.newHTTPRequest(requestOptions{ Re...
[ "func", "(", "client", "*", "Client", ")", "UpdateSpaceManagerByUsername", "(", "spaceGUID", "string", ",", "username", "string", ")", "(", "Warnings", ",", "error", ")", "{", "requestBody", ":=", "updateRoleRequestBody", "{", "Username", ":", "username", ",", ...
// UpdateSpaceManagerByUsername grants the given username the space manager role.
[ "UpdateSpaceManagerByUsername", "grants", "the", "given", "username", "the", "space", "manager", "role", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/space.go#L267-L291
25,883
cloudfoundry/cli
api/uaa/info.go
NewInfo
func NewInfo(link string) Info { var info Info info.Links.Login = link info.Links.UAA = link return info }
go
func NewInfo(link string) Info { var info Info info.Links.Login = link info.Links.UAA = link return info }
[ "func", "NewInfo", "(", "link", "string", ")", "Info", "{", "var", "info", "Info", "\n", "info", ".", "Links", ".", "Login", "=", "link", "\n", "info", ".", "Links", ".", "UAA", "=", "link", "\n", "return", "info", "\n", "}" ]
// NewInfo returns back a new
[ "NewInfo", "returns", "back", "a", "new" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/uaa/info.go#L35-L40
25,884
cloudfoundry/cli
api/cloudcontroller/ccv2/service_key.go
CreateServiceKey
func (client *Client) CreateServiceKey(serviceInstanceGUID string, keyName string, parameters map[string]interface{}) (ServiceKey, Warnings, error) { requestBody := serviceKeyRequestBody{ ServiceInstanceGUID: serviceInstanceGUID, Name: keyName, Parameters: parameters, } bodyBytes, err ...
go
func (client *Client) CreateServiceKey(serviceInstanceGUID string, keyName string, parameters map[string]interface{}) (ServiceKey, Warnings, error) { requestBody := serviceKeyRequestBody{ ServiceInstanceGUID: serviceInstanceGUID, Name: keyName, Parameters: parameters, } bodyBytes, err ...
[ "func", "(", "client", "*", "Client", ")", "CreateServiceKey", "(", "serviceInstanceGUID", "string", ",", "keyName", "string", ",", "parameters", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "ServiceKey", ",", "Warnings", ",", "error", ")", ...
// CreateServiceKey creates a new service key using the provided name and // parameters for the requested service instance.
[ "CreateServiceKey", "creates", "a", "new", "service", "key", "using", "the", "provided", "name", "and", "parameters", "for", "the", "requested", "service", "instance", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service_key.go#L56-L83
25,885
cloudfoundry/cli
actor/pluginaction/install.go
DownloadExecutableBinaryFromURL
func (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error) { tempFile, err := makeTempFile(tempPluginDir) if err != nil { return "", err } err = actor.client.DownloadPlugin(pluginURL, tempFile.Name(), proxyReader) if err != nil { ...
go
func (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error) { tempFile, err := makeTempFile(tempPluginDir) if err != nil { return "", err } err = actor.client.DownloadPlugin(pluginURL, tempFile.Name(), proxyReader) if err != nil { ...
[ "func", "(", "actor", "Actor", ")", "DownloadExecutableBinaryFromURL", "(", "pluginURL", "string", ",", "tempPluginDir", "string", ",", "proxyReader", "plugin", ".", "ProxyReader", ")", "(", "string", ",", "error", ")", "{", "tempFile", ",", "err", ":=", "make...
// DownloadExecutableBinaryFromURL fetches a plugin binary from the specified // URL, if it exists.
[ "DownloadExecutableBinaryFromURL", "fetches", "a", "plugin", "binary", "from", "the", "specified", "URL", "if", "it", "exists", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/install.go#L63-L75
25,886
cloudfoundry/cli
actor/pluginaction/install.go
FileExists
func (actor Actor) FileExists(path string) bool { _, err := os.Stat(path) return err == nil }
go
func (actor Actor) FileExists(path string) bool { _, err := os.Stat(path) return err == nil }
[ "func", "(", "actor", "Actor", ")", "FileExists", "(", "path", "string", ")", "bool", "{", "_", ",", "err", ":=", "os", ".", "Stat", "(", "path", ")", "\n", "return", "err", "==", "nil", "\n", "}" ]
// FileExists returns true if the file exists. It returns false if the file // doesn't exist or there is an error checking.
[ "FileExists", "returns", "true", "if", "the", "file", "exists", ".", "It", "returns", "false", "if", "the", "file", "doesn", "t", "exist", "or", "there", "is", "an", "error", "checking", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/install.go#L79-L82
25,887
cloudfoundry/cli
util/configv3/plugins_config.go
PluginCommands
func (p Plugin) PluginCommands() []PluginCommand { sort.Slice(p.Commands, func(i, j int) bool { return strings.ToLower(p.Commands[i].Name) < strings.ToLower(p.Commands[j].Name) }) return p.Commands }
go
func (p Plugin) PluginCommands() []PluginCommand { sort.Slice(p.Commands, func(i, j int) bool { return strings.ToLower(p.Commands[i].Name) < strings.ToLower(p.Commands[j].Name) }) return p.Commands }
[ "func", "(", "p", "Plugin", ")", "PluginCommands", "(", ")", "[", "]", "PluginCommand", "{", "sort", ".", "Slice", "(", "p", ".", "Commands", ",", "func", "(", "i", ",", "j", "int", ")", "bool", "{", "return", "strings", ".", "ToLower", "(", "p", ...
// PluginCommands returns the plugin's commands sorted by command name.
[ "PluginCommands", "returns", "the", "plugin", "s", "commands", "sorted", "by", "command", "name", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L43-L48
25,888
cloudfoundry/cli
util/configv3/plugins_config.go
String
func (v PluginVersion) String() string { if v.Major == 0 && v.Minor == 0 && v.Build == 0 { return notApplicable } return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Build) }
go
func (v PluginVersion) String() string { if v.Major == 0 && v.Minor == 0 && v.Build == 0 { return notApplicable } return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Build) }
[ "func", "(", "v", "PluginVersion", ")", "String", "(", ")", "string", "{", "if", "v", ".", "Major", "==", "0", "&&", "v", ".", "Minor", "==", "0", "&&", "v", ".", "Build", "==", "0", "{", "return", "notApplicable", "\n", "}", "\n", "return", "fmt...
// String returns the plugin's version in the format x.y.z.
[ "String", "returns", "the", "plugin", "s", "version", "in", "the", "format", "x", ".", "y", ".", "z", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L58-L63
25,889
cloudfoundry/cli
util/configv3/plugins_config.go
CommandName
func (c PluginCommand) CommandName() string { if c.Name != "" && c.Alias != "" { return fmt.Sprintf("%s, %s", c.Name, c.Alias) } return c.Name }
go
func (c PluginCommand) CommandName() string { if c.Name != "" && c.Alias != "" { return fmt.Sprintf("%s, %s", c.Name, c.Alias) } return c.Name }
[ "func", "(", "c", "PluginCommand", ")", "CommandName", "(", ")", "string", "{", "if", "c", ".", "Name", "!=", "\"", "\"", "&&", "c", ".", "Alias", "!=", "\"", "\"", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "c", ".", "Name", "...
// CommandName returns the name of the plugin. The name is concatenated with // alias if alias is specified.
[ "CommandName", "returns", "the", "name", "of", "the", "plugin", ".", "The", "name", "is", "concatenated", "with", "alias", "if", "alias", "is", "specified", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L75-L80
25,890
cloudfoundry/cli
util/configv3/plugins_config.go
AddPlugin
func (config *Config) AddPlugin(plugin Plugin) { config.pluginsConfig.Plugins[plugin.Name] = plugin }
go
func (config *Config) AddPlugin(plugin Plugin) { config.pluginsConfig.Plugins[plugin.Name] = plugin }
[ "func", "(", "config", "*", "Config", ")", "AddPlugin", "(", "plugin", "Plugin", ")", "{", "config", ".", "pluginsConfig", ".", "Plugins", "[", "plugin", ".", "Name", "]", "=", "plugin", "\n", "}" ]
// AddPlugin adds the specified plugin to PluginsConfig
[ "AddPlugin", "adds", "the", "specified", "plugin", "to", "PluginsConfig" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L89-L91
25,891
cloudfoundry/cli
util/configv3/plugins_config.go
GetPlugin
func (config *Config) GetPlugin(pluginName string) (Plugin, bool) { plugin, exists := config.pluginsConfig.Plugins[pluginName] return plugin, exists }
go
func (config *Config) GetPlugin(pluginName string) (Plugin, bool) { plugin, exists := config.pluginsConfig.Plugins[pluginName] return plugin, exists }
[ "func", "(", "config", "*", "Config", ")", "GetPlugin", "(", "pluginName", "string", ")", "(", "Plugin", ",", "bool", ")", "{", "plugin", ",", "exists", ":=", "config", ".", "pluginsConfig", ".", "Plugins", "[", "pluginName", "]", "\n", "return", "plugin...
// GetPlugin returns the requested plugin and true if it exists.
[ "GetPlugin", "returns", "the", "requested", "plugin", "and", "true", "if", "it", "exists", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L98-L101
25,892
cloudfoundry/cli
util/configv3/plugins_config.go
GetPluginCaseInsensitive
func (config *Config) GetPluginCaseInsensitive(pluginName string) (Plugin, bool) { for name, plugin := range config.pluginsConfig.Plugins { if strings.EqualFold(name, pluginName) { return plugin, true } } return Plugin{}, false }
go
func (config *Config) GetPluginCaseInsensitive(pluginName string) (Plugin, bool) { for name, plugin := range config.pluginsConfig.Plugins { if strings.EqualFold(name, pluginName) { return plugin, true } } return Plugin{}, false }
[ "func", "(", "config", "*", "Config", ")", "GetPluginCaseInsensitive", "(", "pluginName", "string", ")", "(", "Plugin", ",", "bool", ")", "{", "for", "name", ",", "plugin", ":=", "range", "config", ".", "pluginsConfig", ".", "Plugins", "{", "if", "strings"...
// GetPluginCaseInsensitive finds the first matching plugin name case // insensitive and returns true if it exists.
[ "GetPluginCaseInsensitive", "finds", "the", "first", "matching", "plugin", "name", "case", "insensitive", "and", "returns", "true", "if", "it", "exists", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L105-L113
25,893
cloudfoundry/cli
util/configv3/plugins_config.go
RemovePlugin
func (config *Config) RemovePlugin(pluginName string) { delete(config.pluginsConfig.Plugins, pluginName) }
go
func (config *Config) RemovePlugin(pluginName string) { delete(config.pluginsConfig.Plugins, pluginName) }
[ "func", "(", "config", "*", "Config", ")", "RemovePlugin", "(", "pluginName", "string", ")", "{", "delete", "(", "config", ".", "pluginsConfig", ".", "Plugins", ",", "pluginName", ")", "\n", "}" ]
// RemovePlugin removes the specified plugin from PluginsConfig idempotently
[ "RemovePlugin", "removes", "the", "specified", "plugin", "from", "PluginsConfig", "idempotently" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L139-L141
25,894
cloudfoundry/cli
util/configv3/plugins_config.go
WritePluginConfig
func (config *Config) WritePluginConfig() error { // Marshal JSON rawConfig, err := json.MarshalIndent(config.pluginsConfig, "", " ") if err != nil { return err } pluginFileDir := filepath.Join(config.PluginHome()) err = os.MkdirAll(pluginFileDir, 0700) if err != nil { return err } // Write to file ret...
go
func (config *Config) WritePluginConfig() error { // Marshal JSON rawConfig, err := json.MarshalIndent(config.pluginsConfig, "", " ") if err != nil { return err } pluginFileDir := filepath.Join(config.PluginHome()) err = os.MkdirAll(pluginFileDir, 0700) if err != nil { return err } // Write to file ret...
[ "func", "(", "config", "*", "Config", ")", "WritePluginConfig", "(", ")", "error", "{", "// Marshal JSON", "rawConfig", ",", "err", ":=", "json", ".", "MarshalIndent", "(", "config", ".", "pluginsConfig", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "if"...
// WritePluginConfig writes the plugin config to config.json in the plugin home // directory.
[ "WritePluginConfig", "writes", "the", "plugin", "config", "to", "config", ".", "json", "in", "the", "plugin", "home", "directory", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/util/configv3/plugins_config.go#L145-L160
25,895
cloudfoundry/cli
actor/pluginaction/actor.go
NewActor
func NewActor(config Config, client PluginClient) *Actor { return &Actor{config: config, client: client} }
go
func NewActor(config Config, client PluginClient) *Actor { return &Actor{config: config, client: client} }
[ "func", "NewActor", "(", "config", "Config", ",", "client", "PluginClient", ")", "*", "Actor", "{", "return", "&", "Actor", "{", "config", ":", "config", ",", "client", ":", "client", "}", "\n", "}" ]
// NewActor returns a pluginaction Actor
[ "NewActor", "returns", "a", "pluginaction", "Actor" ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/actor/pluginaction/actor.go#L11-L13
25,896
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
DeleteService
func (client *Client) DeleteService(serviceGUID string, purge bool) (Warnings, error) { queryParams := url.Values{} queryParams.Set("purge", strconv.FormatBool(purge)) queryParams.Set("async", "true") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteServiceRequest, Query: ...
go
func (client *Client) DeleteService(serviceGUID string, purge bool) (Warnings, error) { queryParams := url.Values{} queryParams.Set("purge", strconv.FormatBool(purge)) queryParams.Set("async", "true") request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.DeleteServiceRequest, Query: ...
[ "func", "(", "client", "*", "Client", ")", "DeleteService", "(", "serviceGUID", "string", ",", "purge", "bool", ")", "(", "Warnings", ",", "error", ")", "{", "queryParams", ":=", "url", ".", "Values", "{", "}", "\n", "queryParams", ".", "Set", "(", "\"...
// DeleteService deletes the service with the given GUID, and returns any errors and warnings.
[ "DeleteService", "deletes", "the", "service", "with", "the", "given", "GUID", "and", "returns", "any", "errors", "and", "warnings", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L31-L49
25,897
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
UnmarshalJSON
func (service *Service) UnmarshalJSON(data []byte) error { var ccService struct { Metadata internal.Metadata Entity struct { Label string `json:"label"` Description string `json:"description"` DocumentationURL string `json:"documentation_url"` ServiceBrokerName string `json:"servic...
go
func (service *Service) UnmarshalJSON(data []byte) error { var ccService struct { Metadata internal.Metadata Entity struct { Label string `json:"label"` Description string `json:"description"` DocumentationURL string `json:"documentation_url"` ServiceBrokerName string `json:"servic...
[ "func", "(", "service", "*", "Service", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "ccService", "struct", "{", "Metadata", "internal", ".", "Metadata", "\n", "Entity", "struct", "{", "Label", "string", "`json:\"label\"`", ...
// UnmarshalJSON helps unmarshal a Cloud Controller Service response.
[ "UnmarshalJSON", "helps", "unmarshal", "a", "Cloud", "Controller", "Service", "response", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L52-L93
25,898
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
GetService
func (client *Client) GetService(serviceGUID string) (Service, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceRequest, URIParams: Params{"service_guid": serviceGUID}, }) if err != nil { return Service{}, nil, err } var service Service response := ...
go
func (client *Client) GetService(serviceGUID string) (Service, Warnings, error) { request, err := client.newHTTPRequest(requestOptions{ RequestName: internal.GetServiceRequest, URIParams: Params{"service_guid": serviceGUID}, }) if err != nil { return Service{}, nil, err } var service Service response := ...
[ "func", "(", "client", "*", "Client", ")", "GetService", "(", "serviceGUID", "string", ")", "(", "Service", ",", "Warnings", ",", "error", ")", "{", "request", ",", "err", ":=", "client", ".", "newHTTPRequest", "(", "requestOptions", "{", "RequestName", ":...
// GetService returns the service with the given GUID.
[ "GetService", "returns", "the", "service", "with", "the", "given", "GUID", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L96-L112
25,899
cloudfoundry/cli
api/cloudcontroller/ccv2/service.go
GetServices
func (client *Client) GetServices(filters ...Filter) ([]Service, Warnings, error) { opts := requestOptions{ RequestName: internal.GetServicesRequest, Query: ConvertFilterParameters(filters), } return client.makeServicesRequest(opts) }
go
func (client *Client) GetServices(filters ...Filter) ([]Service, Warnings, error) { opts := requestOptions{ RequestName: internal.GetServicesRequest, Query: ConvertFilterParameters(filters), } return client.makeServicesRequest(opts) }
[ "func", "(", "client", "*", "Client", ")", "GetServices", "(", "filters", "...", "Filter", ")", "(", "[", "]", "Service", ",", "Warnings", ",", "error", ")", "{", "opts", ":=", "requestOptions", "{", "RequestName", ":", "internal", ".", "GetServicesRequest...
// GetServices returns a list of Services given the provided filters.
[ "GetServices", "returns", "a", "list", "of", "Services", "given", "the", "provided", "filters", "." ]
5010c000047f246b870475e2c299556078cdad30
https://github.com/cloudfoundry/cli/blob/5010c000047f246b870475e2c299556078cdad30/api/cloudcontroller/ccv2/service.go#L115-L122