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
sequence
docstring
stringlengths
6
2.61k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
85
252
6,000
ivpusic/neo
request.go
JsonBody
func (r *Request) JsonBody(instance interface{}) error { decoder := json.NewDecoder(r.Body) defer r.Body.Close() return decoder.Decode(instance) }
go
func (r *Request) JsonBody(instance interface{}) error { decoder := json.NewDecoder(r.Body) defer r.Body.Close() return decoder.Decode(instance) }
[ "func", "(", "r", "*", "Request", ")", "JsonBody", "(", "instance", "interface", "{", "}", ")", "error", "{", "decoder", ":=", "json", ".", "NewDecoder", "(", "r", ".", "Body", ")", "\n", "defer", "r", ".", "Body", ".", "Close", "(", ")", "\n\n", "return", "decoder", ".", "Decode", "(", "instance", ")", "\n", "}" ]
// Parse incomming Body as JSON
[ "Parse", "incomming", "Body", "as", "JSON" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/request.go#L37-L42
6,001
ivpusic/neo
ebus/ebus.go
On
func (e *EBus) On(event string, fn EvHandler) { log.Debugf("registering event `%s`", event) topic, ok := e.eventList[event] if !ok { topic = list.List{} } topic.PushBack(fn) e.eventList[event] = topic }
go
func (e *EBus) On(event string, fn EvHandler) { log.Debugf("registering event `%s`", event) topic, ok := e.eventList[event] if !ok { topic = list.List{} } topic.PushBack(fn) e.eventList[event] = topic }
[ "func", "(", "e", "*", "EBus", ")", "On", "(", "event", "string", ",", "fn", "EvHandler", ")", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "event", ")", "\n", "topic", ",", "ok", ":=", "e", ".", "eventList", "[", "event", "]", "\n\n", "if", "!", "ok", "{", "topic", "=", "list", ".", "List", "{", "}", "\n", "}", "\n\n", "topic", ".", "PushBack", "(", "fn", ")", "\n", "e", ".", "eventList", "[", "event", "]", "=", "topic", "\n", "}" ]
// Registering listener for provided event.
[ "Registering", "listener", "for", "provided", "event", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/ebus/ebus.go#L25-L35
6,002
ivpusic/neo
ebus/ebus.go
Emit
func (e *EBus) Emit(event string, data interface{}) { go func() { log.Debugf("emmiting event `%s`", event) if topic, ok := e.eventList[event]; ok { log.Debug("found listeners for event " + event) for el := topic.Front(); el != nil; el = el.Next() { fn := el.Value.(EvHandler) fn(data) } } else { log.Debugf("listeners for event %s not found", event) } }() }
go
func (e *EBus) Emit(event string, data interface{}) { go func() { log.Debugf("emmiting event `%s`", event) if topic, ok := e.eventList[event]; ok { log.Debug("found listeners for event " + event) for el := topic.Front(); el != nil; el = el.Next() { fn := el.Value.(EvHandler) fn(data) } } else { log.Debugf("listeners for event %s not found", event) } }() }
[ "func", "(", "e", "*", "EBus", ")", "Emit", "(", "event", "string", ",", "data", "interface", "{", "}", ")", "{", "go", "func", "(", ")", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "event", ")", "\n\n", "if", "topic", ",", "ok", ":=", "e", ".", "eventList", "[", "event", "]", ";", "ok", "{", "log", ".", "Debug", "(", "\"", "\"", "+", "event", ")", "\n\n", "for", "el", ":=", "topic", ".", "Front", "(", ")", ";", "el", "!=", "nil", ";", "el", "=", "el", ".", "Next", "(", ")", "{", "fn", ":=", "el", ".", "Value", ".", "(", "EvHandler", ")", "\n", "fn", "(", "data", ")", "\n", "}", "\n", "}", "else", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "event", ")", "\n", "}", "\n", "}", "(", ")", "\n", "}" ]
// Emitting event with data. One goroutine per emit will be created.
[ "Emitting", "event", "with", "data", ".", "One", "goroutine", "per", "emit", "will", "be", "created", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/ebus/ebus.go#L38-L53
6,003
ivpusic/neo
application.go
init
func (a *Application) init(confFile string) { a.InitEBus() a.initRouter() a.initConf(confFile) // neo logger lvl, err := parseLogLevel(a.Conf.Neo.Logger.Level) if err != nil { log.Warn(err) } else { log.Level = lvl } // application logger lvl, err = parseLogLevel(a.Conf.App.Logger.Level) a.Logger = golog.GetLogger(a.Conf.App.Logger.Name) if err != nil { log.Warn(err) } else { a.Logger.Level = lvl } }
go
func (a *Application) init(confFile string) { a.InitEBus() a.initRouter() a.initConf(confFile) // neo logger lvl, err := parseLogLevel(a.Conf.Neo.Logger.Level) if err != nil { log.Warn(err) } else { log.Level = lvl } // application logger lvl, err = parseLogLevel(a.Conf.App.Logger.Level) a.Logger = golog.GetLogger(a.Conf.App.Logger.Name) if err != nil { log.Warn(err) } else { a.Logger.Level = lvl } }
[ "func", "(", "a", "*", "Application", ")", "init", "(", "confFile", "string", ")", "{", "a", ".", "InitEBus", "(", ")", "\n", "a", ".", "initRouter", "(", ")", "\n", "a", ".", "initConf", "(", "confFile", ")", "\n\n", "// neo logger", "lvl", ",", "err", ":=", "parseLogLevel", "(", "a", ".", "Conf", ".", "Neo", ".", "Logger", ".", "Level", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Warn", "(", "err", ")", "\n", "}", "else", "{", "log", ".", "Level", "=", "lvl", "\n", "}", "\n\n", "// application logger", "lvl", ",", "err", "=", "parseLogLevel", "(", "a", ".", "Conf", ".", "App", ".", "Logger", ".", "Level", ")", "\n", "a", ".", "Logger", "=", "golog", ".", "GetLogger", "(", "a", ".", "Conf", ".", "App", ".", "Logger", ".", "Name", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Warn", "(", "err", ")", "\n", "}", "else", "{", "a", ".", "Logger", ".", "Level", "=", "lvl", "\n", "}", "\n", "}" ]
// Application initialization.
[ "Application", "initialization", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/application.go#L26-L47
6,004
ivpusic/neo
application.go
ServeHTTP
func (a *Application) ServeHTTP(w http.ResponseWriter, req *http.Request) { // log all unhandled panic's defer func() { if r := recover(); r != nil { fmt.Printf("%v", r) a.Emit("error", r) log.Panic(r) } }() ctx := makeCtx(req, w) request := ctx.Req response := ctx.Res defer response.flush() if req.ContentLength > a.Conf.App.MaxBodyBytes { log.Errorf("Received too large body. Size: %d, URL %s, Method: %s", req.ContentLength, req.URL.Path, req.Method) response.Status = http.StatusExpectationFailed response.Json(map[string]string{ "error": "request body too large", }) return } req.Body = http.MaxBytesReader(w, req.Body, a.Conf.App.MaxBodyBytes) /////////////////////////////////////////////////////////////////// // Static File Serving /////////////////////////////////////////////////////////////////// if a.static != nil { // check if file can be served file, err := a.static.match(req.URL.Path) if err == nil { h := func(ctx *Ctx) (int, error) { response.SkipFlush() return 200, response.serveFile(file) } fn := compose(merge(a.middlewares, []appliable{handler(h)})) fn(ctx) return } log.Debug("result not found in static") } /////////////////////////////////////////////////////////////////// // Route Matching /////////////////////////////////////////////////////////////////// route, err := a.match(request) if err != nil { log.Debugf("route %s not found. Error: %s", req.URL.Path, err.Error()) // dummy route handler h := func(ctx *Ctx) (int, error) { return http.StatusNotFound, nil } compose(merge(a.middlewares, []appliable{handler(h)}))(ctx) } else { ctx.Req.ResolvedRoute = route.path route.fnChain(ctx) } }
go
func (a *Application) ServeHTTP(w http.ResponseWriter, req *http.Request) { // log all unhandled panic's defer func() { if r := recover(); r != nil { fmt.Printf("%v", r) a.Emit("error", r) log.Panic(r) } }() ctx := makeCtx(req, w) request := ctx.Req response := ctx.Res defer response.flush() if req.ContentLength > a.Conf.App.MaxBodyBytes { log.Errorf("Received too large body. Size: %d, URL %s, Method: %s", req.ContentLength, req.URL.Path, req.Method) response.Status = http.StatusExpectationFailed response.Json(map[string]string{ "error": "request body too large", }) return } req.Body = http.MaxBytesReader(w, req.Body, a.Conf.App.MaxBodyBytes) /////////////////////////////////////////////////////////////////// // Static File Serving /////////////////////////////////////////////////////////////////// if a.static != nil { // check if file can be served file, err := a.static.match(req.URL.Path) if err == nil { h := func(ctx *Ctx) (int, error) { response.SkipFlush() return 200, response.serveFile(file) } fn := compose(merge(a.middlewares, []appliable{handler(h)})) fn(ctx) return } log.Debug("result not found in static") } /////////////////////////////////////////////////////////////////// // Route Matching /////////////////////////////////////////////////////////////////// route, err := a.match(request) if err != nil { log.Debugf("route %s not found. Error: %s", req.URL.Path, err.Error()) // dummy route handler h := func(ctx *Ctx) (int, error) { return http.StatusNotFound, nil } compose(merge(a.middlewares, []appliable{handler(h)}))(ctx) } else { ctx.Req.ResolvedRoute = route.path route.fnChain(ctx) } }
[ "func", "(", "a", "*", "Application", ")", "ServeHTTP", "(", "w", "http", ".", "ResponseWriter", ",", "req", "*", "http", ".", "Request", ")", "{", "// log all unhandled panic's", "defer", "func", "(", ")", "{", "if", "r", ":=", "recover", "(", ")", ";", "r", "!=", "nil", "{", "fmt", ".", "Printf", "(", "\"", "\"", ",", "r", ")", "\n", "a", ".", "Emit", "(", "\"", "\"", ",", "r", ")", "\n", "log", ".", "Panic", "(", "r", ")", "\n", "}", "\n", "}", "(", ")", "\n\n", "ctx", ":=", "makeCtx", "(", "req", ",", "w", ")", "\n", "request", ":=", "ctx", ".", "Req", "\n", "response", ":=", "ctx", ".", "Res", "\n\n", "defer", "response", ".", "flush", "(", ")", "\n\n", "if", "req", ".", "ContentLength", ">", "a", ".", "Conf", ".", "App", ".", "MaxBodyBytes", "{", "log", ".", "Errorf", "(", "\"", "\"", ",", "req", ".", "ContentLength", ",", "req", ".", "URL", ".", "Path", ",", "req", ".", "Method", ")", "\n\n", "response", ".", "Status", "=", "http", ".", "StatusExpectationFailed", "\n", "response", ".", "Json", "(", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "\"", "\"", ",", "}", ")", "\n\n", "return", "\n", "}", "\n\n", "req", ".", "Body", "=", "http", ".", "MaxBytesReader", "(", "w", ",", "req", ".", "Body", ",", "a", ".", "Conf", ".", "App", ".", "MaxBodyBytes", ")", "\n\n", "///////////////////////////////////////////////////////////////////", "// Static File Serving", "///////////////////////////////////////////////////////////////////", "if", "a", ".", "static", "!=", "nil", "{", "// check if file can be served", "file", ",", "err", ":=", "a", ".", "static", ".", "match", "(", "req", ".", "URL", ".", "Path", ")", "\n\n", "if", "err", "==", "nil", "{", "h", ":=", "func", "(", "ctx", "*", "Ctx", ")", "(", "int", ",", "error", ")", "{", "response", ".", "SkipFlush", "(", ")", "\n", "return", "200", ",", "response", ".", "serveFile", "(", "file", ")", "\n", "}", "\n\n", "fn", ":=", "compose", "(", "merge", "(", "a", ".", "middlewares", ",", "[", "]", "appliable", "{", "handler", "(", "h", ")", "}", ")", ")", "\n", "fn", "(", "ctx", ")", "\n", "return", "\n", "}", "\n\n", "log", ".", "Debug", "(", "\"", "\"", ")", "\n", "}", "\n\n", "///////////////////////////////////////////////////////////////////", "// Route Matching", "///////////////////////////////////////////////////////////////////", "route", ",", "err", ":=", "a", ".", "match", "(", "request", ")", "\n\n", "if", "err", "!=", "nil", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "req", ".", "URL", ".", "Path", ",", "err", ".", "Error", "(", ")", ")", "\n\n", "// dummy route handler", "h", ":=", "func", "(", "ctx", "*", "Ctx", ")", "(", "int", ",", "error", ")", "{", "return", "http", ".", "StatusNotFound", ",", "nil", "\n", "}", "\n\n", "compose", "(", "merge", "(", "a", ".", "middlewares", ",", "[", "]", "appliable", "{", "handler", "(", "h", ")", "}", ")", ")", "(", "ctx", ")", "\n", "}", "else", "{", "ctx", ".", "Req", ".", "ResolvedRoute", "=", "route", ".", "path", "\n", "route", ".", "fnChain", "(", "ctx", ")", "\n", "}", "\n", "}" ]
// Handler interface ``ServeHTTP`` implementation. // Method will accept all incomming HTTP requests, and pass requests to appropriate handlers if they are defined.
[ "Handler", "interface", "ServeHTTP", "implementation", ".", "Method", "will", "accept", "all", "incomming", "HTTP", "requests", "and", "pass", "requests", "to", "appropriate", "handlers", "if", "they", "are", "defined", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/application.go#L51-L119
6,005
ivpusic/neo
application.go
Start
func (a *Application) Start() { a.flush() log.Infof("Starting application on address `%s`", a.Conf.App.Addr) s := &http.Server{ Handler: a, Addr: a.Conf.App.Addr, ReadTimeout: a.Conf.App.ReadTimeout, WriteTimeout: a.Conf.App.WriteTimeout, MaxHeaderBytes: a.Conf.App.MaxHeaderBytes, } err := s.ListenAndServe() if err != nil { panic(err.Error()) } }
go
func (a *Application) Start() { a.flush() log.Infof("Starting application on address `%s`", a.Conf.App.Addr) s := &http.Server{ Handler: a, Addr: a.Conf.App.Addr, ReadTimeout: a.Conf.App.ReadTimeout, WriteTimeout: a.Conf.App.WriteTimeout, MaxHeaderBytes: a.Conf.App.MaxHeaderBytes, } err := s.ListenAndServe() if err != nil { panic(err.Error()) } }
[ "func", "(", "a", "*", "Application", ")", "Start", "(", ")", "{", "a", ".", "flush", "(", ")", "\n\n", "log", ".", "Infof", "(", "\"", "\"", ",", "a", ".", "Conf", ".", "App", ".", "Addr", ")", "\n", "s", ":=", "&", "http", ".", "Server", "{", "Handler", ":", "a", ",", "Addr", ":", "a", ".", "Conf", ".", "App", ".", "Addr", ",", "ReadTimeout", ":", "a", ".", "Conf", ".", "App", ".", "ReadTimeout", ",", "WriteTimeout", ":", "a", ".", "Conf", ".", "App", ".", "WriteTimeout", ",", "MaxHeaderBytes", ":", "a", ".", "Conf", ".", "App", ".", "MaxHeaderBytes", ",", "}", "\n\n", "err", ":=", "s", ".", "ListenAndServe", "(", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n", "}" ]
// Starting application instance. This will run application on port defined by configuration.
[ "Starting", "application", "instance", ".", "This", "will", "run", "application", "on", "port", "defined", "by", "configuration", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/application.go#L122-L138
6,006
ivpusic/neo
static.go
canBeServed
func (s *Static) canBeServed(path string) bool { stat, err := os.Stat(path) if err != nil { log.Debugf("Error while calling os.Stat for path %s. Error: %s", path, err.Error()) } else { if !stat.IsDir() { return true } } return false }
go
func (s *Static) canBeServed(path string) bool { stat, err := os.Stat(path) if err != nil { log.Debugf("Error while calling os.Stat for path %s. Error: %s", path, err.Error()) } else { if !stat.IsDir() { return true } } return false }
[ "func", "(", "s", "*", "Static", ")", "canBeServed", "(", "path", "string", ")", "bool", "{", "stat", ",", "err", ":=", "os", ".", "Stat", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "path", ",", "err", ".", "Error", "(", ")", ")", "\n", "}", "else", "{", "if", "!", "stat", ".", "IsDir", "(", ")", "{", "return", "true", "\n", "}", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
// If path exists, and it is not directory it can be served. // Othervise path cannot be served.
[ "If", "path", "exists", "and", "it", "is", "not", "directory", "it", "can", "be", "served", ".", "Othervise", "path", "cannot", "be", "served", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/static.go#L20-L31
6,007
ivpusic/neo
response.go
makeResponse
func makeResponse(request *http.Request, w http.ResponseWriter) *Response { response := &Response{ request: request, writer: w, Cookie: Cookie{}, } return response }
go
func makeResponse(request *http.Request, w http.ResponseWriter) *Response { response := &Response{ request: request, writer: w, Cookie: Cookie{}, } return response }
[ "func", "makeResponse", "(", "request", "*", "http", ".", "Request", ",", "w", "http", ".", "ResponseWriter", ")", "*", "Response", "{", "response", ":=", "&", "Response", "{", "request", ":", "request", ",", "writer", ":", "w", ",", "Cookie", ":", "Cookie", "{", "}", ",", "}", "\n\n", "return", "response", "\n", "}" ]
// making response representation
[ "making", "response", "representation" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L25-L33
6,008
ivpusic/neo
response.go
Xml
func (r *Response) Xml(obj interface{}) error { res, err := xml.Marshal(obj) if err != nil { return err } r.writer.Header().Set("Content-Type", "application/xml") return r.Raw(res) }
go
func (r *Response) Xml(obj interface{}) error { res, err := xml.Marshal(obj) if err != nil { return err } r.writer.Header().Set("Content-Type", "application/xml") return r.Raw(res) }
[ "func", "(", "r", "*", "Response", ")", "Xml", "(", "obj", "interface", "{", "}", ")", "error", "{", "res", ",", "err", ":=", "xml", ".", "Marshal", "(", "obj", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "r", ".", "writer", ".", "Header", "(", ")", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "r", ".", "Raw", "(", "res", ")", "\n", "}" ]
// Will produce XML string representation of passed object, // and send it to client
[ "Will", "produce", "XML", "string", "representation", "of", "passed", "object", "and", "send", "it", "to", "client" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L53-L61
6,009
ivpusic/neo
response.go
Text
func (r *Response) Text(text string) error { return r.Raw([]byte(text)) }
go
func (r *Response) Text(text string) error { return r.Raw([]byte(text)) }
[ "func", "(", "r", "*", "Response", ")", "Text", "(", "text", "string", ")", "error", "{", "return", "r", ".", "Raw", "(", "[", "]", "byte", "(", "text", ")", ")", "\n", "}" ]
// Will send provided Text to client.
[ "Will", "send", "provided", "Text", "to", "client", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L64-L66
6,010
ivpusic/neo
response.go
Tpl
func (r *Response) Tpl(name string, data interface{}) error { log.Infof("Rendering template %s", name) err := renderTpl(r.writer, name, data) if err != nil { r.Status = http.StatusNotFound return err } r.SkipFlush() return nil }
go
func (r *Response) Tpl(name string, data interface{}) error { log.Infof("Rendering template %s", name) err := renderTpl(r.writer, name, data) if err != nil { r.Status = http.StatusNotFound return err } r.SkipFlush() return nil }
[ "func", "(", "r", "*", "Response", ")", "Tpl", "(", "name", "string", ",", "data", "interface", "{", "}", ")", "error", "{", "log", ".", "Infof", "(", "\"", "\"", ",", "name", ")", "\n\n", "err", ":=", "renderTpl", "(", "r", ".", "writer", ",", "name", ",", "data", ")", "\n", "if", "err", "!=", "nil", "{", "r", ".", "Status", "=", "http", ".", "StatusNotFound", "\n", "return", "err", "\n", "}", "\n\n", "r", ".", "SkipFlush", "(", ")", "\n", "return", "nil", "\n", "}" ]
// Will look for template, render it, and send rendered HTML to client. // Second argument is data which will be passed to client.
[ "Will", "look", "for", "template", "render", "it", "and", "send", "rendered", "HTML", "to", "client", ".", "Second", "argument", "is", "data", "which", "will", "be", "passed", "to", "client", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L70-L81
6,011
ivpusic/neo
response.go
Raw
func (r *Response) Raw(data []byte) error { r.data = data return nil }
go
func (r *Response) Raw(data []byte) error { r.data = data return nil }
[ "func", "(", "r", "*", "Response", ")", "Raw", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ".", "data", "=", "data", "\n", "return", "nil", "\n", "}" ]
// Send Raw data to client.
[ "Send", "Raw", "data", "to", "client", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L84-L87
6,012
ivpusic/neo
response.go
Redirect
func (r *Response) Redirect(url string) error { r.redirect = url return nil }
go
func (r *Response) Redirect(url string) error { r.redirect = url return nil }
[ "func", "(", "r", "*", "Response", ")", "Redirect", "(", "url", "string", ")", "error", "{", "r", ".", "redirect", "=", "url", "\n", "return", "nil", "\n", "}" ]
// Redirect to url with status
[ "Redirect", "to", "url", "with", "status" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L90-L93
6,013
ivpusic/neo
response.go
Write
func (r *Response) Write(b []byte) (int, error) { return r.writer.Write(b) }
go
func (r *Response) Write(b []byte) (int, error) { return r.writer.Write(b) }
[ "func", "(", "r", "*", "Response", ")", "Write", "(", "b", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "return", "r", ".", "writer", ".", "Write", "(", "b", ")", "\n", "}" ]
// Write raw response. Implements ResponseWriter.Write.
[ "Write", "raw", "response", ".", "Implements", "ResponseWriter", ".", "Write", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L96-L98
6,014
ivpusic/neo
response.go
File
func (r *Response) File(path string) error { abspath, err := filepath.Abs(path) if err != nil { return err } if !r.fileExists(abspath) { return err } r.file = abspath return nil }
go
func (r *Response) File(path string) error { abspath, err := filepath.Abs(path) if err != nil { return err } if !r.fileExists(abspath) { return err } r.file = abspath return nil }
[ "func", "(", "r", "*", "Response", ")", "File", "(", "path", "string", ")", "error", "{", "abspath", ",", "err", ":=", "filepath", ".", "Abs", "(", "path", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "!", "r", ".", "fileExists", "(", "abspath", ")", "{", "return", "err", "\n", "}", "\n\n", "r", ".", "file", "=", "abspath", "\n", "return", "nil", "\n", "}" ]
// Find file, and send it to client.
[ "Find", "file", "and", "send", "it", "to", "client", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L128-L141
6,015
ivpusic/neo
response.go
serveFile
func (r *Response) serveFile(file string) error { log.Debugf("serving file %s", file) http.ServeFile(r.writer, r.request, file) return nil }
go
func (r *Response) serveFile(file string) error { log.Debugf("serving file %s", file) http.ServeFile(r.writer, r.request, file) return nil }
[ "func", "(", "r", "*", "Response", ")", "serveFile", "(", "file", "string", ")", "error", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "file", ")", "\n\n", "http", ".", "ServeFile", "(", "r", ".", "writer", ",", "r", ".", "request", ",", "file", ")", "\n", "return", "nil", "\n", "}" ]
// Serving static file.
[ "Serving", "static", "file", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L144-L149
6,016
ivpusic/neo
response.go
sendFile
func (r *Response) sendFile() { log.Debugf("sending file %s", r.file) base := filepath.Base(r.file) r.writer.Header().Set("Content-Disposition", "attachment; filename="+base) http.ServeFile(r.writer, r.request, r.file) }
go
func (r *Response) sendFile() { log.Debugf("sending file %s", r.file) base := filepath.Base(r.file) r.writer.Header().Set("Content-Disposition", "attachment; filename="+base) http.ServeFile(r.writer, r.request, r.file) }
[ "func", "(", "r", "*", "Response", ")", "sendFile", "(", ")", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "r", ".", "file", ")", "\n\n", "base", ":=", "filepath", ".", "Base", "(", "r", ".", "file", ")", "\n", "r", ".", "writer", ".", "Header", "(", ")", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", "+", "base", ")", "\n", "http", ".", "ServeFile", "(", "r", ".", "writer", ",", "r", ".", "request", ",", "r", ".", "file", ")", "\n", "}" ]
// Will be called from ``flush`` Response method if user called ``File`` method.
[ "Will", "be", "called", "from", "flush", "Response", "method", "if", "user", "called", "File", "method", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L152-L158
6,017
ivpusic/neo
response.go
flush
func (r *Response) flush() { if r._skipFlush { log.Debug("Already sent. Skipping flushing") return } // set all cookies to response object for k, v := range r.Cookie { log.Debug(k) http.SetCookie(r.writer, v) } // in case of file call separate function for piping file to client if len(r.file) > 0 { log.Debugf("found file, sending") r.sendFile() } else if len(r.redirect) > 0 { http.Redirect(r.writer, r.request, r.redirect, r.Status) } else { r.writer.WriteHeader(r.Status) r.writer.Write(r.data) } }
go
func (r *Response) flush() { if r._skipFlush { log.Debug("Already sent. Skipping flushing") return } // set all cookies to response object for k, v := range r.Cookie { log.Debug(k) http.SetCookie(r.writer, v) } // in case of file call separate function for piping file to client if len(r.file) > 0 { log.Debugf("found file, sending") r.sendFile() } else if len(r.redirect) > 0 { http.Redirect(r.writer, r.request, r.redirect, r.Status) } else { r.writer.WriteHeader(r.Status) r.writer.Write(r.data) } }
[ "func", "(", "r", "*", "Response", ")", "flush", "(", ")", "{", "if", "r", ".", "_skipFlush", "{", "log", ".", "Debug", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n\n", "// set all cookies to response object", "for", "k", ",", "v", ":=", "range", "r", ".", "Cookie", "{", "log", ".", "Debug", "(", "k", ")", "\n", "http", ".", "SetCookie", "(", "r", ".", "writer", ",", "v", ")", "\n", "}", "\n\n", "// in case of file call separate function for piping file to client", "if", "len", "(", "r", ".", "file", ")", ">", "0", "{", "log", ".", "Debugf", "(", "\"", "\"", ")", "\n", "r", ".", "sendFile", "(", ")", "\n", "}", "else", "if", "len", "(", "r", ".", "redirect", ")", ">", "0", "{", "http", ".", "Redirect", "(", "r", ".", "writer", ",", "r", ".", "request", ",", "r", ".", "redirect", ",", "r", ".", "Status", ")", "\n", "}", "else", "{", "r", ".", "writer", ".", "WriteHeader", "(", "r", ".", "Status", ")", "\n", "r", ".", "writer", ".", "Write", "(", "r", ".", "data", ")", "\n", "}", "\n", "}" ]
// Write result to ResponseWriter.
[ "Write", "result", "to", "ResponseWriter", "." ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/response.go#L172-L194
6,018
ivpusic/neo
methods.go
Get
func (m *methods) Get(path string, fn handler) *Route { return m.add(path, fn, GET) }
go
func (m *methods) Get(path string, fn handler) *Route { return m.add(path, fn, GET) }
[ "func", "(", "m", "*", "methods", ")", "Get", "(", "path", "string", ",", "fn", "handler", ")", "*", "Route", "{", "return", "m", ".", "add", "(", "path", ",", "fn", ",", "GET", ")", "\n", "}" ]
// Registering route handler for ``GET`` request on provided path
[ "Registering", "route", "handler", "for", "GET", "request", "on", "provided", "path" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/methods.go#L52-L54
6,019
ivpusic/neo
methods.go
Post
func (m *methods) Post(path string, fn handler) *Route { return m.add(path, fn, POST) }
go
func (m *methods) Post(path string, fn handler) *Route { return m.add(path, fn, POST) }
[ "func", "(", "m", "*", "methods", ")", "Post", "(", "path", "string", ",", "fn", "handler", ")", "*", "Route", "{", "return", "m", ".", "add", "(", "path", ",", "fn", ",", "POST", ")", "\n", "}" ]
// Registering route handler for ``POST`` request on provided path
[ "Registering", "route", "handler", "for", "POST", "request", "on", "provided", "path" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/methods.go#L57-L59
6,020
ivpusic/neo
methods.go
Put
func (m *methods) Put(path string, fn handler) *Route { return m.add(path, fn, PUT) }
go
func (m *methods) Put(path string, fn handler) *Route { return m.add(path, fn, PUT) }
[ "func", "(", "m", "*", "methods", ")", "Put", "(", "path", "string", ",", "fn", "handler", ")", "*", "Route", "{", "return", "m", ".", "add", "(", "path", ",", "fn", ",", "PUT", ")", "\n", "}" ]
// Registering route handler for ``PUT`` request on provided path
[ "Registering", "route", "handler", "for", "PUT", "request", "on", "provided", "path" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/methods.go#L62-L64
6,021
ivpusic/neo
methods.go
Delete
func (m *methods) Delete(path string, fn handler) *Route { return m.add(path, fn, DELETE) }
go
func (m *methods) Delete(path string, fn handler) *Route { return m.add(path, fn, DELETE) }
[ "func", "(", "m", "*", "methods", ")", "Delete", "(", "path", "string", ",", "fn", "handler", ")", "*", "Route", "{", "return", "m", ".", "add", "(", "path", ",", "fn", ",", "DELETE", ")", "\n", "}" ]
// Registering route handler for ``DELETE`` request on provided path
[ "Registering", "route", "handler", "for", "DELETE", "request", "on", "provided", "path" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/methods.go#L67-L69
6,022
ivpusic/neo
methods.go
Options
func (m *methods) Options(path string, fn handler) *Route { return m.add(path, fn, OPTIONS) }
go
func (m *methods) Options(path string, fn handler) *Route { return m.add(path, fn, OPTIONS) }
[ "func", "(", "m", "*", "methods", ")", "Options", "(", "path", "string", ",", "fn", "handler", ")", "*", "Route", "{", "return", "m", ".", "add", "(", "path", ",", "fn", ",", "OPTIONS", ")", "\n", "}" ]
// Registering route handler for ``OPTIONS`` request on provided path
[ "Registering", "route", "handler", "for", "OPTIONS", "request", "on", "provided", "path" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/methods.go#L72-L74
6,023
ivpusic/neo
methods.go
Head
func (m *methods) Head(path string, fn handler) *Route { return m.add(path, fn, HEAD) }
go
func (m *methods) Head(path string, fn handler) *Route { return m.add(path, fn, HEAD) }
[ "func", "(", "m", "*", "methods", ")", "Head", "(", "path", "string", ",", "fn", "handler", ")", "*", "Route", "{", "return", "m", ".", "add", "(", "path", ",", "fn", ",", "HEAD", ")", "\n", "}" ]
// Registering route handler for ``HEAD`` request on provided path
[ "Registering", "route", "handler", "for", "HEAD", "request", "on", "provided", "path" ]
c81644170eed26e491487d0877d8642a0a84ea8d
https://github.com/ivpusic/neo/blob/c81644170eed26e491487d0877d8642a0a84ea8d/methods.go#L77-L79
6,024
metaleap/go-xsd
elemmakepkg.go
coerceToIdentifierRune
func coerceToIdentifierRune(ch rune) rune { if !unicode.IsLetter(ch) && !unicode.IsNumber(ch) { return '_' } return ch }
go
func coerceToIdentifierRune(ch rune) rune { if !unicode.IsLetter(ch) && !unicode.IsNumber(ch) { return '_' } return ch }
[ "func", "coerceToIdentifierRune", "(", "ch", "rune", ")", "rune", "{", "if", "!", "unicode", ".", "IsLetter", "(", "ch", ")", "&&", "!", "unicode", ".", "IsNumber", "(", "ch", ")", "{", "return", "'_'", "\n", "}", "\n", "return", "ch", "\n", "}" ]
// For any rune, return a rune that is a valid in an identifier
[ "For", "any", "rune", "return", "a", "rune", "that", "is", "a", "valid", "in", "an", "identifier" ]
61f7638f502f1fa73ff76e2f2586410687e9314a
https://github.com/metaleap/go-xsd/blob/61f7638f502f1fa73ff76e2f2586410687e9314a/elemmakepkg.go#L845-L850
6,025
metaleap/go-xsd
elemmakepkg.go
safeIdentifier
func safeIdentifier(s string) string { s = strings.Map(coerceToIdentifierRune, s) if unicode.IsNumber([]rune(s)[0]) { s = fmt.Sprint("_", s) } return s }
go
func safeIdentifier(s string) string { s = strings.Map(coerceToIdentifierRune, s) if unicode.IsNumber([]rune(s)[0]) { s = fmt.Sprint("_", s) } return s }
[ "func", "safeIdentifier", "(", "s", "string", ")", "string", "{", "s", "=", "strings", ".", "Map", "(", "coerceToIdentifierRune", ",", "s", ")", "\n", "if", "unicode", ".", "IsNumber", "(", "[", "]", "rune", "(", "s", ")", "[", "0", "]", ")", "{", "s", "=", "fmt", ".", "Sprint", "(", "\"", "\"", ",", "s", ")", "\n", "}", "\n", "return", "s", "\n", "}" ]
// Take any string and convert it to a valid identifier // Appends an underscore if the first rune is a number
[ "Take", "any", "string", "and", "convert", "it", "to", "a", "valid", "identifier", "Appends", "an", "underscore", "if", "the", "first", "rune", "is", "a", "number" ]
61f7638f502f1fa73ff76e2f2586410687e9314a
https://github.com/metaleap/go-xsd/blob/61f7638f502f1fa73ff76e2f2586410687e9314a/elemmakepkg.go#L854-L860
6,026
apparentlymart/go-cidr
cidr/cidr.go
AddressRange
func AddressRange(network *net.IPNet) (net.IP, net.IP) { // the first IP is easy firstIP := network.IP // the last IP is the network address OR NOT the mask address prefixLen, bits := network.Mask.Size() if prefixLen == bits { // Easy! // But make sure that our two slices are distinct, since they // would be in all other cases. lastIP := make([]byte, len(firstIP)) copy(lastIP, firstIP) return firstIP, lastIP } firstIPInt, bits := ipToInt(firstIP) hostLen := uint(bits) - uint(prefixLen) lastIPInt := big.NewInt(1) lastIPInt.Lsh(lastIPInt, hostLen) lastIPInt.Sub(lastIPInt, big.NewInt(1)) lastIPInt.Or(lastIPInt, firstIPInt) return firstIP, intToIP(lastIPInt, bits) }
go
func AddressRange(network *net.IPNet) (net.IP, net.IP) { // the first IP is easy firstIP := network.IP // the last IP is the network address OR NOT the mask address prefixLen, bits := network.Mask.Size() if prefixLen == bits { // Easy! // But make sure that our two slices are distinct, since they // would be in all other cases. lastIP := make([]byte, len(firstIP)) copy(lastIP, firstIP) return firstIP, lastIP } firstIPInt, bits := ipToInt(firstIP) hostLen := uint(bits) - uint(prefixLen) lastIPInt := big.NewInt(1) lastIPInt.Lsh(lastIPInt, hostLen) lastIPInt.Sub(lastIPInt, big.NewInt(1)) lastIPInt.Or(lastIPInt, firstIPInt) return firstIP, intToIP(lastIPInt, bits) }
[ "func", "AddressRange", "(", "network", "*", "net", ".", "IPNet", ")", "(", "net", ".", "IP", ",", "net", ".", "IP", ")", "{", "// the first IP is easy", "firstIP", ":=", "network", ".", "IP", "\n\n", "// the last IP is the network address OR NOT the mask address", "prefixLen", ",", "bits", ":=", "network", ".", "Mask", ".", "Size", "(", ")", "\n", "if", "prefixLen", "==", "bits", "{", "// Easy!", "// But make sure that our two slices are distinct, since they", "// would be in all other cases.", "lastIP", ":=", "make", "(", "[", "]", "byte", ",", "len", "(", "firstIP", ")", ")", "\n", "copy", "(", "lastIP", ",", "firstIP", ")", "\n", "return", "firstIP", ",", "lastIP", "\n", "}", "\n\n", "firstIPInt", ",", "bits", ":=", "ipToInt", "(", "firstIP", ")", "\n", "hostLen", ":=", "uint", "(", "bits", ")", "-", "uint", "(", "prefixLen", ")", "\n", "lastIPInt", ":=", "big", ".", "NewInt", "(", "1", ")", "\n", "lastIPInt", ".", "Lsh", "(", "lastIPInt", ",", "hostLen", ")", "\n", "lastIPInt", ".", "Sub", "(", "lastIPInt", ",", "big", ".", "NewInt", "(", "1", ")", ")", "\n", "lastIPInt", ".", "Or", "(", "lastIPInt", ",", "firstIPInt", ")", "\n\n", "return", "firstIP", ",", "intToIP", "(", "lastIPInt", ",", "bits", ")", "\n", "}" ]
// AddressRange returns the first and last addresses in the given CIDR range.
[ "AddressRange", "returns", "the", "first", "and", "last", "addresses", "in", "the", "given", "CIDR", "range", "." ]
1755c023625ec3a84979b90841a1ab067ed6c071
https://github.com/apparentlymart/go-cidr/blob/1755c023625ec3a84979b90841a1ab067ed6c071/cidr/cidr.go#L84-L107
6,027
apparentlymart/go-cidr
cidr/cidr.go
AddressCount
func AddressCount(network *net.IPNet) uint64 { prefixLen, bits := network.Mask.Size() return 1 << (uint64(bits) - uint64(prefixLen)) }
go
func AddressCount(network *net.IPNet) uint64 { prefixLen, bits := network.Mask.Size() return 1 << (uint64(bits) - uint64(prefixLen)) }
[ "func", "AddressCount", "(", "network", "*", "net", ".", "IPNet", ")", "uint64", "{", "prefixLen", ",", "bits", ":=", "network", ".", "Mask", ".", "Size", "(", ")", "\n", "return", "1", "<<", "(", "uint64", "(", "bits", ")", "-", "uint64", "(", "prefixLen", ")", ")", "\n", "}" ]
// AddressCount returns the number of distinct host addresses within the given // CIDR range. // // Since the result is a uint64, this function returns meaningful information // only for IPv4 ranges and IPv6 ranges with a prefix size of at least 65.
[ "AddressCount", "returns", "the", "number", "of", "distinct", "host", "addresses", "within", "the", "given", "CIDR", "range", ".", "Since", "the", "result", "is", "a", "uint64", "this", "function", "returns", "meaningful", "information", "only", "for", "IPv4", "ranges", "and", "IPv6", "ranges", "with", "a", "prefix", "size", "of", "at", "least", "65", "." ]
1755c023625ec3a84979b90841a1ab067ed6c071
https://github.com/apparentlymart/go-cidr/blob/1755c023625ec3a84979b90841a1ab067ed6c071/cidr/cidr.go#L114-L117
6,028
apparentlymart/go-cidr
cidr/cidr.go
PreviousSubnet
func PreviousSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { startIP := checkIPv4(network.IP) previousIP := make(net.IP, len(startIP)) copy(previousIP, startIP) cMask := net.CIDRMask(prefixLen, 8*len(previousIP)) previousIP = Dec(previousIP) previous := &net.IPNet{IP: previousIP.Mask(cMask), Mask: cMask} if startIP.Equal(net.IPv4zero) || startIP.Equal(net.IPv6zero) { return previous, true } return previous, false }
go
func PreviousSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { startIP := checkIPv4(network.IP) previousIP := make(net.IP, len(startIP)) copy(previousIP, startIP) cMask := net.CIDRMask(prefixLen, 8*len(previousIP)) previousIP = Dec(previousIP) previous := &net.IPNet{IP: previousIP.Mask(cMask), Mask: cMask} if startIP.Equal(net.IPv4zero) || startIP.Equal(net.IPv6zero) { return previous, true } return previous, false }
[ "func", "PreviousSubnet", "(", "network", "*", "net", ".", "IPNet", ",", "prefixLen", "int", ")", "(", "*", "net", ".", "IPNet", ",", "bool", ")", "{", "startIP", ":=", "checkIPv4", "(", "network", ".", "IP", ")", "\n", "previousIP", ":=", "make", "(", "net", ".", "IP", ",", "len", "(", "startIP", ")", ")", "\n", "copy", "(", "previousIP", ",", "startIP", ")", "\n", "cMask", ":=", "net", ".", "CIDRMask", "(", "prefixLen", ",", "8", "*", "len", "(", "previousIP", ")", ")", "\n", "previousIP", "=", "Dec", "(", "previousIP", ")", "\n", "previous", ":=", "&", "net", ".", "IPNet", "{", "IP", ":", "previousIP", ".", "Mask", "(", "cMask", ")", ",", "Mask", ":", "cMask", "}", "\n", "if", "startIP", ".", "Equal", "(", "net", ".", "IPv4zero", ")", "||", "startIP", ".", "Equal", "(", "net", ".", "IPv6zero", ")", "{", "return", "previous", ",", "true", "\n", "}", "\n", "return", "previous", ",", "false", "\n", "}" ]
// PreviousSubnet returns the subnet of the desired mask in the IP space // just lower than the start of IPNet provided. If the IP space rolls over // then the second return value is true
[ "PreviousSubnet", "returns", "the", "subnet", "of", "the", "desired", "mask", "in", "the", "IP", "space", "just", "lower", "than", "the", "start", "of", "IPNet", "provided", ".", "If", "the", "IP", "space", "rolls", "over", "then", "the", "second", "return", "value", "is", "true" ]
1755c023625ec3a84979b90841a1ab067ed6c071
https://github.com/apparentlymart/go-cidr/blob/1755c023625ec3a84979b90841a1ab067ed6c071/cidr/cidr.go#L150-L161
6,029
apparentlymart/go-cidr
cidr/cidr.go
NextSubnet
func NextSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { _, currentLast := AddressRange(network) mask := net.CIDRMask(prefixLen, 8*len(currentLast)) currentSubnet := &net.IPNet{IP: currentLast.Mask(mask), Mask: mask} _, last := AddressRange(currentSubnet) last = Inc(last) next := &net.IPNet{IP: last.Mask(mask), Mask: mask} if last.Equal(net.IPv4zero) || last.Equal(net.IPv6zero) { return next, true } return next, false }
go
func NextSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { _, currentLast := AddressRange(network) mask := net.CIDRMask(prefixLen, 8*len(currentLast)) currentSubnet := &net.IPNet{IP: currentLast.Mask(mask), Mask: mask} _, last := AddressRange(currentSubnet) last = Inc(last) next := &net.IPNet{IP: last.Mask(mask), Mask: mask} if last.Equal(net.IPv4zero) || last.Equal(net.IPv6zero) { return next, true } return next, false }
[ "func", "NextSubnet", "(", "network", "*", "net", ".", "IPNet", ",", "prefixLen", "int", ")", "(", "*", "net", ".", "IPNet", ",", "bool", ")", "{", "_", ",", "currentLast", ":=", "AddressRange", "(", "network", ")", "\n", "mask", ":=", "net", ".", "CIDRMask", "(", "prefixLen", ",", "8", "*", "len", "(", "currentLast", ")", ")", "\n", "currentSubnet", ":=", "&", "net", ".", "IPNet", "{", "IP", ":", "currentLast", ".", "Mask", "(", "mask", ")", ",", "Mask", ":", "mask", "}", "\n", "_", ",", "last", ":=", "AddressRange", "(", "currentSubnet", ")", "\n", "last", "=", "Inc", "(", "last", ")", "\n", "next", ":=", "&", "net", ".", "IPNet", "{", "IP", ":", "last", ".", "Mask", "(", "mask", ")", ",", "Mask", ":", "mask", "}", "\n", "if", "last", ".", "Equal", "(", "net", ".", "IPv4zero", ")", "||", "last", ".", "Equal", "(", "net", ".", "IPv6zero", ")", "{", "return", "next", ",", "true", "\n", "}", "\n", "return", "next", ",", "false", "\n", "}" ]
// NextSubnet returns the next available subnet of the desired mask size // starting for the maximum IP of the offset subnet // If the IP exceeds the maxium IP then the second return value is true
[ "NextSubnet", "returns", "the", "next", "available", "subnet", "of", "the", "desired", "mask", "size", "starting", "for", "the", "maximum", "IP", "of", "the", "offset", "subnet", "If", "the", "IP", "exceeds", "the", "maxium", "IP", "then", "the", "second", "return", "value", "is", "true" ]
1755c023625ec3a84979b90841a1ab067ed6c071
https://github.com/apparentlymart/go-cidr/blob/1755c023625ec3a84979b90841a1ab067ed6c071/cidr/cidr.go#L166-L177
6,030
domodwyer/mailyak
mime.go
buildMimeWithBoundaries
func (m *MailYak) buildMimeWithBoundaries(mb, ab string) (*bytes.Buffer, error) { var buf bytes.Buffer if err := m.writeHeaders(&buf); err != nil { return nil, err } // Start our multipart/mixed part mixed := multipart.NewWriter(&buf) if err := mixed.SetBoundary(mb); err != nil { return nil, err } defer mixed.Close() fmt.Fprintf(&buf, "Content-Type: multipart/mixed;\r\n\tboundary=\"%s\"; charset=UTF-8\r\n\r\n", mixed.Boundary()) ctype := fmt.Sprintf("multipart/alternative;\r\n\tboundary=\"%s\"", ab) altPart, err := mixed.CreatePart(textproto.MIMEHeader{"Content-Type": {ctype}}) if err != nil { return nil, err } if err := m.writeBody(altPart, ab); err != nil { return nil, err } if err := m.writeAttachments(mixed, lineSplitterBuilder{}); err != nil { return nil, err } return &buf, nil }
go
func (m *MailYak) buildMimeWithBoundaries(mb, ab string) (*bytes.Buffer, error) { var buf bytes.Buffer if err := m.writeHeaders(&buf); err != nil { return nil, err } // Start our multipart/mixed part mixed := multipart.NewWriter(&buf) if err := mixed.SetBoundary(mb); err != nil { return nil, err } defer mixed.Close() fmt.Fprintf(&buf, "Content-Type: multipart/mixed;\r\n\tboundary=\"%s\"; charset=UTF-8\r\n\r\n", mixed.Boundary()) ctype := fmt.Sprintf("multipart/alternative;\r\n\tboundary=\"%s\"", ab) altPart, err := mixed.CreatePart(textproto.MIMEHeader{"Content-Type": {ctype}}) if err != nil { return nil, err } if err := m.writeBody(altPart, ab); err != nil { return nil, err } if err := m.writeAttachments(mixed, lineSplitterBuilder{}); err != nil { return nil, err } return &buf, nil }
[ "func", "(", "m", "*", "MailYak", ")", "buildMimeWithBoundaries", "(", "mb", ",", "ab", "string", ")", "(", "*", "bytes", ".", "Buffer", ",", "error", ")", "{", "var", "buf", "bytes", ".", "Buffer", "\n\n", "if", "err", ":=", "m", ".", "writeHeaders", "(", "&", "buf", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// Start our multipart/mixed part", "mixed", ":=", "multipart", ".", "NewWriter", "(", "&", "buf", ")", "\n", "if", "err", ":=", "mixed", ".", "SetBoundary", "(", "mb", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "mixed", ".", "Close", "(", ")", "\n\n", "fmt", ".", "Fprintf", "(", "&", "buf", ",", "\"", "\\r", "\\n", "\\t", "\\\"", "\\\"", "\\r", "\\n", "\\r", "\\n", "\"", ",", "mixed", ".", "Boundary", "(", ")", ")", "\n\n", "ctype", ":=", "fmt", ".", "Sprintf", "(", "\"", "\\r", "\\n", "\\t", "\\\"", "\\\"", "\"", ",", "ab", ")", "\n\n", "altPart", ",", "err", ":=", "mixed", ".", "CreatePart", "(", "textproto", ".", "MIMEHeader", "{", "\"", "\"", ":", "{", "ctype", "}", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "m", ".", "writeBody", "(", "altPart", ",", "ab", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "m", ".", "writeAttachments", "(", "mixed", ",", "lineSplitterBuilder", "{", "}", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "buf", ",", "nil", "\n", "}" ]
// buildMimeWithBoundaries creates the MIME message using mb and ab as MIME // boundaries, and returns the generated MIME data as a buffer.
[ "buildMimeWithBoundaries", "creates", "the", "MIME", "message", "using", "mb", "and", "ab", "as", "MIME", "boundaries", "and", "returns", "the", "generated", "MIME", "data", "as", "a", "buffer", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/mime.go#L43-L75
6,031
domodwyer/mailyak
mime.go
fromHeader
func (m *MailYak) fromHeader() string { if m.fromName == "" { return fmt.Sprintf("From: %s\r\n", m.fromAddr) } return fmt.Sprintf("From: %s <%s>\r\n", m.fromName, m.fromAddr) }
go
func (m *MailYak) fromHeader() string { if m.fromName == "" { return fmt.Sprintf("From: %s\r\n", m.fromAddr) } return fmt.Sprintf("From: %s <%s>\r\n", m.fromName, m.fromAddr) }
[ "func", "(", "m", "*", "MailYak", ")", "fromHeader", "(", ")", "string", "{", "if", "m", ".", "fromName", "==", "\"", "\"", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\\r", "\\n", "\"", ",", "m", ".", "fromAddr", ")", "\n", "}", "\n\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\\r", "\\n", "\"", ",", "m", ".", "fromName", ",", "m", ".", "fromAddr", ")", "\n", "}" ]
// fromHeader returns a correctly formatted From header, optionally with a name // component.
[ "fromHeader", "returns", "a", "correctly", "formatted", "From", "header", "optionally", "with", "a", "name", "component", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/mime.go#L120-L126
6,032
domodwyer/mailyak
writer.go
Set
func (w *BodyPart) Set(s string) { w.Reset() w.WriteString(s) }
go
func (w *BodyPart) Set(s string) { w.Reset() w.WriteString(s) }
[ "func", "(", "w", "*", "BodyPart", ")", "Set", "(", "s", "string", ")", "{", "w", ".", "Reset", "(", ")", "\n", "w", ".", "WriteString", "(", "s", ")", "\n", "}" ]
// Set accepts a string s as the contents of a BodyPart, replacing any existing // data.
[ "Set", "accepts", "a", "string", "s", "as", "the", "contents", "of", "a", "BodyPart", "replacing", "any", "existing", "data", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/writer.go#L10-L13
6,033
domodwyer/mailyak
setters.go
To
func (m *MailYak) To(addrs ...string) { m.toAddrs = []string{} for _, addr := range addrs { trimmed := m.trimRegex.ReplaceAllString(addr, "") if trimmed == "" { continue } m.toAddrs = append(m.toAddrs, trimmed) } }
go
func (m *MailYak) To(addrs ...string) { m.toAddrs = []string{} for _, addr := range addrs { trimmed := m.trimRegex.ReplaceAllString(addr, "") if trimmed == "" { continue } m.toAddrs = append(m.toAddrs, trimmed) } }
[ "func", "(", "m", "*", "MailYak", ")", "To", "(", "addrs", "...", "string", ")", "{", "m", ".", "toAddrs", "=", "[", "]", "string", "{", "}", "\n\n", "for", "_", ",", "addr", ":=", "range", "addrs", "{", "trimmed", ":=", "m", ".", "trimRegex", ".", "ReplaceAllString", "(", "addr", ",", "\"", "\"", ")", "\n", "if", "trimmed", "==", "\"", "\"", "{", "continue", "\n", "}", "\n\n", "m", ".", "toAddrs", "=", "append", "(", "m", ".", "toAddrs", ",", "trimmed", ")", "\n", "}", "\n", "}" ]
// To sets a list of recipient addresses. // // You can pass one or more addresses to this method, all of which are viewable to the recipients. // // mail.To("[email protected]", "[email protected]") // // or pass a slice of strings: // // tos := []string{ // "[email protected]", // "[email protected]" // } // // mail.To(tos...)
[ "To", "sets", "a", "list", "of", "recipient", "addresses", ".", "You", "can", "pass", "one", "or", "more", "addresses", "to", "this", "method", "all", "of", "which", "are", "viewable", "to", "the", "recipients", ".", "mail", ".", "To", "(", "dom" ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/setters.go#L19-L30
6,034
domodwyer/mailyak
setters.go
ReplyTo
func (m *MailYak) ReplyTo(addr string) { m.replyTo = m.trimRegex.ReplaceAllString(addr, "") }
go
func (m *MailYak) ReplyTo(addr string) { m.replyTo = m.trimRegex.ReplaceAllString(addr, "") }
[ "func", "(", "m", "*", "MailYak", ")", "ReplyTo", "(", "addr", "string", ")", "{", "m", ".", "replyTo", "=", "m", ".", "trimRegex", ".", "ReplaceAllString", "(", "addr", ",", "\"", "\"", ")", "\n", "}" ]
// ReplyTo sets the Reply-To email address. // // Setting a ReplyTo address is optional.
[ "ReplyTo", "sets", "the", "Reply", "-", "To", "email", "address", ".", "Setting", "a", "ReplyTo", "address", "is", "optional", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/setters.go#L128-L130
6,035
domodwyer/mailyak
setters.go
Subject
func (m *MailYak) Subject(sub string) { m.subject = mime.QEncoding.Encode("UTF-8", m.trimRegex.ReplaceAllString(sub, "")) }
go
func (m *MailYak) Subject(sub string) { m.subject = mime.QEncoding.Encode("UTF-8", m.trimRegex.ReplaceAllString(sub, "")) }
[ "func", "(", "m", "*", "MailYak", ")", "Subject", "(", "sub", "string", ")", "{", "m", ".", "subject", "=", "mime", ".", "QEncoding", ".", "Encode", "(", "\"", "\"", ",", "m", ".", "trimRegex", ".", "ReplaceAllString", "(", "sub", ",", "\"", "\"", ")", ")", "\n", "}" ]
// Subject sets the email subject line. // // If sub contains non-ASCII characters, it is Q-encoded according to RFC1342.
[ "Subject", "sets", "the", "email", "subject", "line", ".", "If", "sub", "contains", "non", "-", "ASCII", "characters", "it", "is", "Q", "-", "encoded", "according", "to", "RFC1342", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/setters.go#L135-L137
6,036
domodwyer/mailyak
setters.go
AddHeader
func (m *MailYak) AddHeader(name, value string) { m.headers[m.trimRegex.ReplaceAllString(name, "")] = mime.QEncoding.Encode("UTF-8", m.trimRegex.ReplaceAllString(value, "")) }
go
func (m *MailYak) AddHeader(name, value string) { m.headers[m.trimRegex.ReplaceAllString(name, "")] = mime.QEncoding.Encode("UTF-8", m.trimRegex.ReplaceAllString(value, "")) }
[ "func", "(", "m", "*", "MailYak", ")", "AddHeader", "(", "name", ",", "value", "string", ")", "{", "m", ".", "headers", "[", "m", ".", "trimRegex", ".", "ReplaceAllString", "(", "name", ",", "\"", "\"", ")", "]", "=", "mime", ".", "QEncoding", ".", "Encode", "(", "\"", "\"", ",", "m", ".", "trimRegex", ".", "ReplaceAllString", "(", "value", ",", "\"", "\"", ")", ")", "\n", "}" ]
// AddHeader adds an arbitrary email header. // // If value contains non-ASCII characters, it is Q-encoded according to RFC1342. // As always, validate any user input before adding it to a message, as this // method may enable an attacker to override the standard headers and, for // example, BCC themselves in a password reset email to a different user.
[ "AddHeader", "adds", "an", "arbitrary", "email", "header", ".", "If", "value", "contains", "non", "-", "ASCII", "characters", "it", "is", "Q", "-", "encoded", "according", "to", "RFC1342", ".", "As", "always", "validate", "any", "user", "input", "before", "adding", "it", "to", "a", "message", "as", "this", "method", "may", "enable", "an", "attacker", "to", "override", "the", "standard", "headers", "and", "for", "example", "BCC", "themselves", "in", "a", "password", "reset", "email", "to", "a", "different", "user", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/setters.go#L145-L147
6,037
domodwyer/mailyak
mailyak.go
MimeBuf
func (m *MailYak) MimeBuf() (*bytes.Buffer, error) { buf, err := m.buildMime() if err != nil { return nil, err } return buf, nil }
go
func (m *MailYak) MimeBuf() (*bytes.Buffer, error) { buf, err := m.buildMime() if err != nil { return nil, err } return buf, nil }
[ "func", "(", "m", "*", "MailYak", ")", "MimeBuf", "(", ")", "(", "*", "bytes", ".", "Buffer", ",", "error", ")", "{", "buf", ",", "err", ":=", "m", ".", "buildMime", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "buf", ",", "nil", "\n", "}" ]
// MimeBuf returns the buffer containing all the RAW MIME data. // // MimeBuf is typically used with an API service such as Amazon SES that does // not use an SMTP interface.
[ "MimeBuf", "returns", "the", "buffer", "containing", "all", "the", "RAW", "MIME", "data", ".", "MimeBuf", "is", "typically", "used", "with", "an", "API", "service", "such", "as", "Amazon", "SES", "that", "does", "not", "use", "an", "SMTP", "interface", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/mailyak.go#L82-L88
6,038
domodwyer/mailyak
mailyak.go
String
func (m *MailYak) String() string { var ( att []string custom string ) for _, a := range m.attachments { att = append(att, "{filename: "+a.filename+"}") } if len(m.headers) > 0 { var hdrs []string for k, v := range m.headers { hdrs = append(hdrs, fmt.Sprintf("%s: %q", k, v)) } custom = strings.Join(hdrs, ", ") + ", " } return fmt.Sprintf( "&MailYak{date: %q, from: %q, fromName: %q, html: %v bytes, plain: %v bytes, toAddrs: %v, "+ "bccAddrs: %v, subject: %q, %vhost: %q, attachments (%v): %v, auth set: %v}", m.date, m.fromAddr, m.fromName, len(m.HTML().String()), len(m.Plain().String()), m.toAddrs, m.bccAddrs, m.subject, custom, m.host, len(att), att, m.auth != nil, ) }
go
func (m *MailYak) String() string { var ( att []string custom string ) for _, a := range m.attachments { att = append(att, "{filename: "+a.filename+"}") } if len(m.headers) > 0 { var hdrs []string for k, v := range m.headers { hdrs = append(hdrs, fmt.Sprintf("%s: %q", k, v)) } custom = strings.Join(hdrs, ", ") + ", " } return fmt.Sprintf( "&MailYak{date: %q, from: %q, fromName: %q, html: %v bytes, plain: %v bytes, toAddrs: %v, "+ "bccAddrs: %v, subject: %q, %vhost: %q, attachments (%v): %v, auth set: %v}", m.date, m.fromAddr, m.fromName, len(m.HTML().String()), len(m.Plain().String()), m.toAddrs, m.bccAddrs, m.subject, custom, m.host, len(att), att, m.auth != nil, ) }
[ "func", "(", "m", "*", "MailYak", ")", "String", "(", ")", "string", "{", "var", "(", "att", "[", "]", "string", "\n", "custom", "string", "\n", ")", "\n", "for", "_", ",", "a", ":=", "range", "m", ".", "attachments", "{", "att", "=", "append", "(", "att", ",", "\"", "\"", "+", "a", ".", "filename", "+", "\"", "\"", ")", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "headers", ")", ">", "0", "{", "var", "hdrs", "[", "]", "string", "\n", "for", "k", ",", "v", ":=", "range", "m", ".", "headers", "{", "hdrs", "=", "append", "(", "hdrs", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "k", ",", "v", ")", ")", "\n", "}", "\n", "custom", "=", "strings", ".", "Join", "(", "hdrs", ",", "\"", "\"", ")", "+", "\"", "\"", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", "+", "\"", "\"", ",", "m", ".", "date", ",", "m", ".", "fromAddr", ",", "m", ".", "fromName", ",", "len", "(", "m", ".", "HTML", "(", ")", ".", "String", "(", ")", ")", ",", "len", "(", "m", ".", "Plain", "(", ")", ".", "String", "(", ")", ")", ",", "m", ".", "toAddrs", ",", "m", ".", "bccAddrs", ",", "m", ".", "subject", ",", "custom", ",", "m", ".", "host", ",", "len", "(", "att", ")", ",", "att", ",", "m", ".", "auth", "!=", "nil", ",", ")", "\n", "}" ]
// String returns a redacted description of the email state, typically for // logging or debugging purposes. // // Authentication information is not included in the returned string.
[ "String", "returns", "a", "redacted", "description", "of", "the", "email", "state", "typically", "for", "logging", "or", "debugging", "purposes", ".", "Authentication", "information", "is", "not", "included", "in", "the", "returned", "string", "." ]
89444b05799b115121931b3b6bd05e820e69dc8b
https://github.com/domodwyer/mailyak/blob/89444b05799b115121931b3b6bd05e820e69dc8b/mailyak.go#L94-L127
6,039
containerd/console
console_linux.go
NewEpoller
func NewEpoller() (*Epoller, error) { efd, err := unix.EpollCreate1(unix.EPOLL_CLOEXEC) if err != nil { return nil, err } return &Epoller{ efd: efd, fdMapping: make(map[int]*EpollConsole), }, nil }
go
func NewEpoller() (*Epoller, error) { efd, err := unix.EpollCreate1(unix.EPOLL_CLOEXEC) if err != nil { return nil, err } return &Epoller{ efd: efd, fdMapping: make(map[int]*EpollConsole), }, nil }
[ "func", "NewEpoller", "(", ")", "(", "*", "Epoller", ",", "error", ")", "{", "efd", ",", "err", ":=", "unix", ".", "EpollCreate1", "(", "unix", ".", "EPOLL_CLOEXEC", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "Epoller", "{", "efd", ":", "efd", ",", "fdMapping", ":", "make", "(", "map", "[", "int", "]", "*", "EpollConsole", ")", ",", "}", ",", "nil", "\n", "}" ]
// NewEpoller returns an instance of epoller with a valid epoll fd.
[ "NewEpoller", "returns", "an", "instance", "of", "epoller", "with", "a", "valid", "epoll", "fd", "." ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console_linux.go#L64-L73
6,040
containerd/console
console_linux.go
CloseConsole
func (e *Epoller) CloseConsole(fd int) error { e.mu.Lock() defer e.mu.Unlock() delete(e.fdMapping, fd) return unix.EpollCtl(e.efd, unix.EPOLL_CTL_DEL, fd, &unix.EpollEvent{}) }
go
func (e *Epoller) CloseConsole(fd int) error { e.mu.Lock() defer e.mu.Unlock() delete(e.fdMapping, fd) return unix.EpollCtl(e.efd, unix.EPOLL_CTL_DEL, fd, &unix.EpollEvent{}) }
[ "func", "(", "e", "*", "Epoller", ")", "CloseConsole", "(", "fd", "int", ")", "error", "{", "e", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "e", ".", "mu", ".", "Unlock", "(", ")", "\n", "delete", "(", "e", ".", "fdMapping", ",", "fd", ")", "\n", "return", "unix", ".", "EpollCtl", "(", "e", ".", "efd", ",", "unix", ".", "EPOLL_CTL_DEL", ",", "fd", ",", "&", "unix", ".", "EpollEvent", "{", "}", ")", "\n", "}" ]
// CloseConsole unregisters the console's file descriptor from epoll interface
[ "CloseConsole", "unregisters", "the", "console", "s", "file", "descriptor", "from", "epoll", "interface" ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console_linux.go#L138-L143
6,041
containerd/console
console_linux.go
signalRead
func (ec *EpollConsole) signalRead() { ec.readc.L.Lock() ec.readc.Signal() ec.readc.L.Unlock() }
go
func (ec *EpollConsole) signalRead() { ec.readc.L.Lock() ec.readc.Signal() ec.readc.L.Unlock() }
[ "func", "(", "ec", "*", "EpollConsole", ")", "signalRead", "(", ")", "{", "ec", ".", "readc", ".", "L", ".", "Lock", "(", ")", "\n", "ec", ".", "readc", ".", "Signal", "(", ")", "\n", "ec", ".", "readc", ".", "L", ".", "Unlock", "(", ")", "\n", "}" ]
// signalRead signals that the console is readable.
[ "signalRead", "signals", "that", "the", "console", "is", "readable", "." ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console_linux.go#L264-L268
6,042
containerd/console
console_linux.go
signalWrite
func (ec *EpollConsole) signalWrite() { ec.writec.L.Lock() ec.writec.Signal() ec.writec.L.Unlock() }
go
func (ec *EpollConsole) signalWrite() { ec.writec.L.Lock() ec.writec.Signal() ec.writec.L.Unlock() }
[ "func", "(", "ec", "*", "EpollConsole", ")", "signalWrite", "(", ")", "{", "ec", ".", "writec", ".", "L", ".", "Lock", "(", ")", "\n", "ec", ".", "writec", ".", "Signal", "(", ")", "\n", "ec", ".", "writec", ".", "L", ".", "Unlock", "(", ")", "\n", "}" ]
// signalWrite signals that the console is writable.
[ "signalWrite", "signals", "that", "the", "console", "is", "writable", "." ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console_linux.go#L271-L275
6,043
containerd/console
console.go
Current
func Current() Console { c, err := ConsoleFromFile(os.Stdin) if err != nil { // stdin should always be a console for the design // of this function panic(err) } return c }
go
func Current() Console { c, err := ConsoleFromFile(os.Stdin) if err != nil { // stdin should always be a console for the design // of this function panic(err) } return c }
[ "func", "Current", "(", ")", "Console", "{", "c", ",", "err", ":=", "ConsoleFromFile", "(", "os", ".", "Stdin", ")", "\n", "if", "err", "!=", "nil", "{", "// stdin should always be a console for the design", "// of this function", "panic", "(", "err", ")", "\n", "}", "\n", "return", "c", "\n", "}" ]
// Current returns the current processes console
[ "Current", "returns", "the", "current", "processes", "console" ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console.go#L62-L70
6,044
containerd/console
console.go
ConsoleFromFile
func ConsoleFromFile(f *os.File) (Console, error) { if err := checkConsole(f); err != nil { return nil, err } return newMaster(f) }
go
func ConsoleFromFile(f *os.File) (Console, error) { if err := checkConsole(f); err != nil { return nil, err } return newMaster(f) }
[ "func", "ConsoleFromFile", "(", "f", "*", "os", ".", "File", ")", "(", "Console", ",", "error", ")", "{", "if", "err", ":=", "checkConsole", "(", "f", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "newMaster", "(", "f", ")", "\n", "}" ]
// ConsoleFromFile returns a console using the provided file
[ "ConsoleFromFile", "returns", "a", "console", "using", "the", "provided", "file" ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console.go#L73-L78
6,045
containerd/console
console_unix.go
NewPty
func NewPty() (Console, string, error) { f, err := os.OpenFile("/dev/ptmx", unix.O_RDWR|unix.O_NOCTTY|unix.O_CLOEXEC, 0) if err != nil { return nil, "", err } slave, err := ptsname(f) if err != nil { return nil, "", err } if err := unlockpt(f); err != nil { return nil, "", err } m, err := newMaster(f) if err != nil { return nil, "", err } return m, slave, nil }
go
func NewPty() (Console, string, error) { f, err := os.OpenFile("/dev/ptmx", unix.O_RDWR|unix.O_NOCTTY|unix.O_CLOEXEC, 0) if err != nil { return nil, "", err } slave, err := ptsname(f) if err != nil { return nil, "", err } if err := unlockpt(f); err != nil { return nil, "", err } m, err := newMaster(f) if err != nil { return nil, "", err } return m, slave, nil }
[ "func", "NewPty", "(", ")", "(", "Console", ",", "string", ",", "error", ")", "{", "f", ",", "err", ":=", "os", ".", "OpenFile", "(", "\"", "\"", ",", "unix", ".", "O_RDWR", "|", "unix", ".", "O_NOCTTY", "|", "unix", ".", "O_CLOEXEC", ",", "0", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "slave", ",", "err", ":=", "ptsname", "(", "f", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "if", "err", ":=", "unlockpt", "(", "f", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "m", ",", "err", ":=", "newMaster", "(", "f", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "return", "m", ",", "slave", ",", "nil", "\n", "}" ]
// NewPty creates a new pty pair // The master is returned as the first console and a string // with the path to the pty slave is returned as the second
[ "NewPty", "creates", "a", "new", "pty", "pair", "The", "master", "is", "returned", "as", "the", "first", "console", "and", "a", "string", "with", "the", "path", "to", "the", "pty", "slave", "is", "returned", "as", "the", "second" ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console_unix.go#L30-L47
6,046
containerd/console
console_unix.go
checkConsole
func checkConsole(f *os.File) error { var termios unix.Termios if tcget(f.Fd(), &termios) != nil { return ErrNotAConsole } return nil }
go
func checkConsole(f *os.File) error { var termios unix.Termios if tcget(f.Fd(), &termios) != nil { return ErrNotAConsole } return nil }
[ "func", "checkConsole", "(", "f", "*", "os", ".", "File", ")", "error", "{", "var", "termios", "unix", ".", "Termios", "\n", "if", "tcget", "(", "f", ".", "Fd", "(", ")", ",", "&", "termios", ")", "!=", "nil", "{", "return", "ErrNotAConsole", "\n", "}", "\n", "return", "nil", "\n", "}" ]
// checkConsole checks if the provided file is a console
[ "checkConsole", "checks", "if", "the", "provided", "file", "is", "a", "console" ]
0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
https://github.com/containerd/console/blob/0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f/console_unix.go#L125-L131
6,047
gin-contrib/sentry
recovery.go
Recovery
func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc { return func(c *gin.Context) { defer func() { flags := map[string]string{ "endpoint": c.Request.RequestURI, } if rval := recover(); rval != nil { debug.PrintStack() rvalStr := fmt.Sprint(rval) client.CaptureMessage(rvalStr, flags, raven.NewException(errors.New(rvalStr), raven.NewStacktrace(2, 3, nil)), raven.NewHttp(c.Request)) c.AbortWithStatus(http.StatusInternalServerError) } if !onlyCrashes { for _, item := range c.Errors { client.CaptureMessage(item.Error(), flags, &raven.Message{ Message: item.Error(), Params: []interface{}{item.Meta}, }, raven.NewHttp(c.Request)) } } }() c.Next() } }
go
func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc { return func(c *gin.Context) { defer func() { flags := map[string]string{ "endpoint": c.Request.RequestURI, } if rval := recover(); rval != nil { debug.PrintStack() rvalStr := fmt.Sprint(rval) client.CaptureMessage(rvalStr, flags, raven.NewException(errors.New(rvalStr), raven.NewStacktrace(2, 3, nil)), raven.NewHttp(c.Request)) c.AbortWithStatus(http.StatusInternalServerError) } if !onlyCrashes { for _, item := range c.Errors { client.CaptureMessage(item.Error(), flags, &raven.Message{ Message: item.Error(), Params: []interface{}{item.Meta}, }, raven.NewHttp(c.Request)) } } }() c.Next() } }
[ "func", "Recovery", "(", "client", "*", "raven", ".", "Client", ",", "onlyCrashes", "bool", ")", "gin", ".", "HandlerFunc", "{", "return", "func", "(", "c", "*", "gin", ".", "Context", ")", "{", "defer", "func", "(", ")", "{", "flags", ":=", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "c", ".", "Request", ".", "RequestURI", ",", "}", "\n", "if", "rval", ":=", "recover", "(", ")", ";", "rval", "!=", "nil", "{", "debug", ".", "PrintStack", "(", ")", "\n", "rvalStr", ":=", "fmt", ".", "Sprint", "(", "rval", ")", "\n", "client", ".", "CaptureMessage", "(", "rvalStr", ",", "flags", ",", "raven", ".", "NewException", "(", "errors", ".", "New", "(", "rvalStr", ")", ",", "raven", ".", "NewStacktrace", "(", "2", ",", "3", ",", "nil", ")", ")", ",", "raven", ".", "NewHttp", "(", "c", ".", "Request", ")", ")", "\n", "c", ".", "AbortWithStatus", "(", "http", ".", "StatusInternalServerError", ")", "\n", "}", "\n", "if", "!", "onlyCrashes", "{", "for", "_", ",", "item", ":=", "range", "c", ".", "Errors", "{", "client", ".", "CaptureMessage", "(", "item", ".", "Error", "(", ")", ",", "flags", ",", "&", "raven", ".", "Message", "{", "Message", ":", "item", ".", "Error", "(", ")", ",", "Params", ":", "[", "]", "interface", "{", "}", "{", "item", ".", "Meta", "}", ",", "}", ",", "raven", ".", "NewHttp", "(", "c", ".", "Request", ")", ")", "\n", "}", "\n", "}", "\n", "}", "(", ")", "\n\n", "c", ".", "Next", "(", ")", "\n", "}", "\n", "}" ]
// Recovery middleware for sentry crash reporting
[ "Recovery", "middleware", "for", "sentry", "crash", "reporting" ]
d4eec0a60d7d69922948cb8152f090b179137e2e
https://github.com/gin-contrib/sentry/blob/d4eec0a60d7d69922948cb8152f090b179137e2e/recovery.go#L14-L41
6,048
softlayer/softlayer-go
services/brand.go
CreateCustomerAccount
func (r Brand) CreateCustomerAccount(account *datatypes.Account, bypassDuplicateAccountCheck *bool) (resp datatypes.Account, err error) { params := []interface{}{ account, bypassDuplicateAccountCheck, } err = r.Session.DoRequest("SoftLayer_Brand", "createCustomerAccount", params, &r.Options, &resp) return }
go
func (r Brand) CreateCustomerAccount(account *datatypes.Account, bypassDuplicateAccountCheck *bool) (resp datatypes.Account, err error) { params := []interface{}{ account, bypassDuplicateAccountCheck, } err = r.Session.DoRequest("SoftLayer_Brand", "createCustomerAccount", params, &r.Options, &resp) return }
[ "func", "(", "r", "Brand", ")", "CreateCustomerAccount", "(", "account", "*", "datatypes", ".", "Account", ",", "bypassDuplicateAccountCheck", "*", "bool", ")", "(", "resp", "datatypes", ".", "Account", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "account", ",", "bypassDuplicateAccountCheck", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Create a new customer account record.
[ "Create", "a", "new", "customer", "account", "record", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/brand.go#L75-L82
6,049
softlayer/softlayer-go
services/brand.go
GetAllowAccountCreationFlag
func (r Brand) GetAllowAccountCreationFlag() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Brand", "getAllowAccountCreationFlag", nil, &r.Options, &resp) return }
go
func (r Brand) GetAllowAccountCreationFlag() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Brand", "getAllowAccountCreationFlag", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Brand", ")", "GetAllowAccountCreationFlag", "(", ")", "(", "resp", "bool", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve This flag indicates if creation of accounts is allowed.
[ "Retrieve", "This", "flag", "indicates", "if", "creation", "of", "accounts", "is", "allowed", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/brand.go#L125-L128
6,050
softlayer/softlayer-go
services/brand.go
GetCatalog
func (r Brand) GetCatalog() (resp datatypes.Product_Catalog, err error) { err = r.Session.DoRequest("SoftLayer_Brand", "getCatalog", nil, &r.Options, &resp) return }
go
func (r Brand) GetCatalog() (resp datatypes.Product_Catalog, err error) { err = r.Session.DoRequest("SoftLayer_Brand", "getCatalog", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Brand", ")", "GetCatalog", "(", ")", "(", "resp", "datatypes", ".", "Product_Catalog", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The Product Catalog for the Brand
[ "Retrieve", "The", "Product", "Catalog", "for", "the", "Brand" ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/brand.go#L143-L146
6,051
softlayer/softlayer-go
services/brand.go
GetContacts
func (r Brand) GetContacts() (resp []datatypes.Brand_Contact, err error) { err = r.Session.DoRequest("SoftLayer_Brand", "getContacts", nil, &r.Options, &resp) return }
go
func (r Brand) GetContacts() (resp []datatypes.Brand_Contact, err error) { err = r.Session.DoRequest("SoftLayer_Brand", "getContacts", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Brand", ")", "GetContacts", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Brand_Contact", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The contacts for the brand.
[ "Retrieve", "The", "contacts", "for", "the", "brand", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/brand.go#L155-L158
6,052
softlayer/softlayer-go
services/brand.go
VerifyCanDisableAccount
func (r Brand) VerifyCanDisableAccount(accountId *int) (err error) { var resp datatypes.Void params := []interface{}{ accountId, } err = r.Session.DoRequest("SoftLayer_Brand", "verifyCanDisableAccount", params, &r.Options, &resp) return }
go
func (r Brand) VerifyCanDisableAccount(accountId *int) (err error) { var resp datatypes.Void params := []interface{}{ accountId, } err = r.Session.DoRequest("SoftLayer_Brand", "verifyCanDisableAccount", params, &r.Options, &resp) return }
[ "func", "(", "r", "Brand", ")", "VerifyCanDisableAccount", "(", "accountId", "*", "int", ")", "(", "err", "error", ")", "{", "var", "resp", "datatypes", ".", "Void", "\n", "params", ":=", "[", "]", "interface", "{", "}", "{", "accountId", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Verify that an account may be disabled by a Brand Agent. Anything that would disqualify the account from being disabled will cause an exception to be raised.
[ "Verify", "that", "an", "account", "may", "be", "disabled", "by", "a", "Brand", "Agent", ".", "Anything", "that", "would", "disqualify", "the", "account", "from", "being", "disabled", "will", "cause", "an", "exception", "to", "be", "raised", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/brand.go#L272-L279
6,053
softlayer/softlayer-go
services/metric.go
GetBackboneBandwidthGraph
func (r Metric_Tracking_Object) GetBackboneBandwidthGraph(graphTitle *string) (resp datatypes.Container_Bandwidth_GraphOutputs, err error) { params := []interface{}{ graphTitle, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBackboneBandwidthGraph", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetBackboneBandwidthGraph(graphTitle *string) (resp datatypes.Container_Bandwidth_GraphOutputs, err error) { params := []interface{}{ graphTitle, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBackboneBandwidthGraph", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetBackboneBandwidthGraph", "(", "graphTitle", "*", "string", ")", "(", "resp", "datatypes", ".", "Container_Bandwidth_GraphOutputs", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "graphTitle", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve a PNG image of the last 24 hours of bandwidth usage of one of SoftLayer's network backbones.
[ "Retrieve", "a", "PNG", "image", "of", "the", "last", "24", "hours", "of", "bandwidth", "usage", "of", "one", "of", "SoftLayer", "s", "network", "backbones", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L73-L79
6,054
softlayer/softlayer-go
services/metric.go
GetBandwidthData
func (r Metric_Tracking_Object) GetBandwidthData(startDateTime *datatypes.Time, endDateTime *datatypes.Time, typ *string, rollupSeconds *int) (resp []datatypes.Metric_Tracking_Object_Data, err error) { params := []interface{}{ startDateTime, endDateTime, typ, rollupSeconds, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBandwidthData", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetBandwidthData(startDateTime *datatypes.Time, endDateTime *datatypes.Time, typ *string, rollupSeconds *int) (resp []datatypes.Metric_Tracking_Object_Data, err error) { params := []interface{}{ startDateTime, endDateTime, typ, rollupSeconds, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBandwidthData", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetBandwidthData", "(", "startDateTime", "*", "datatypes", ".", "Time", ",", "endDateTime", "*", "datatypes", ".", "Time", ",", "typ", "*", "string", ",", "rollupSeconds", "*", "int", ")", "(", "resp", "[", "]", "datatypes", ".", "Metric_Tracking_Object_Data", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "startDateTime", ",", "endDateTime", ",", "typ", ",", "rollupSeconds", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve a collection of raw bandwidth data from an individual public or private network tracking object. Raw data is ideal if you with to employ your own traffic storage and graphing systems.
[ "Retrieve", "a", "collection", "of", "raw", "bandwidth", "data", "from", "an", "individual", "public", "or", "private", "network", "tracking", "object", ".", "Raw", "data", "is", "ideal", "if", "you", "with", "to", "employ", "your", "own", "traffic", "storage", "and", "graphing", "systems", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L82-L91
6,055
softlayer/softlayer-go
services/metric.go
GetBandwidthGraph
func (r Metric_Tracking_Object) GetBandwidthGraph(startDateTime *datatypes.Time, endDateTime *datatypes.Time, graphType *string, fontSize *int, graphWidth *int, graphHeight *int, doNotShowTimeZone *bool) (resp datatypes.Container_Bandwidth_GraphOutputs, err error) { params := []interface{}{ startDateTime, endDateTime, graphType, fontSize, graphWidth, graphHeight, doNotShowTimeZone, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBandwidthGraph", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetBandwidthGraph(startDateTime *datatypes.Time, endDateTime *datatypes.Time, graphType *string, fontSize *int, graphWidth *int, graphHeight *int, doNotShowTimeZone *bool) (resp datatypes.Container_Bandwidth_GraphOutputs, err error) { params := []interface{}{ startDateTime, endDateTime, graphType, fontSize, graphWidth, graphHeight, doNotShowTimeZone, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBandwidthGraph", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetBandwidthGraph", "(", "startDateTime", "*", "datatypes", ".", "Time", ",", "endDateTime", "*", "datatypes", ".", "Time", ",", "graphType", "*", "string", ",", "fontSize", "*", "int", ",", "graphWidth", "*", "int", ",", "graphHeight", "*", "int", ",", "doNotShowTimeZone", "*", "bool", ")", "(", "resp", "datatypes", ".", "Container_Bandwidth_GraphOutputs", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "startDateTime", ",", "endDateTime", ",", "graphType", ",", "fontSize", ",", "graphWidth", ",", "graphHeight", ",", "doNotShowTimeZone", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve a PNG image of a bandwidth graph representing the bandwidth usage over time recorded by SofTLayer's bandwidth pollers.
[ "Retrieve", "a", "PNG", "image", "of", "a", "bandwidth", "graph", "representing", "the", "bandwidth", "usage", "over", "time", "recorded", "by", "SofTLayer", "s", "bandwidth", "pollers", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L94-L106
6,056
softlayer/softlayer-go
services/metric.go
GetBandwidthTotal
func (r Metric_Tracking_Object) GetBandwidthTotal(startDateTime *datatypes.Time, endDateTime *datatypes.Time, direction *string, typ *string) (resp uint, err error) { params := []interface{}{ startDateTime, endDateTime, direction, typ, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBandwidthTotal", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetBandwidthTotal(startDateTime *datatypes.Time, endDateTime *datatypes.Time, direction *string, typ *string) (resp uint, err error) { params := []interface{}{ startDateTime, endDateTime, direction, typ, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getBandwidthTotal", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetBandwidthTotal", "(", "startDateTime", "*", "datatypes", ".", "Time", ",", "endDateTime", "*", "datatypes", ".", "Time", ",", "direction", "*", "string", ",", "typ", "*", "string", ")", "(", "resp", "uint", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "startDateTime", ",", "endDateTime", ",", "direction", ",", "typ", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve the total amount of bandwidth recorded by a tracking object within the given date range. This method will only work on SoftLayer_Metric_Tracking_Object for SoftLayer_Hardware objects, and SoftLayer_Virtual_Guest objects.
[ "Retrieve", "the", "total", "amount", "of", "bandwidth", "recorded", "by", "a", "tracking", "object", "within", "the", "given", "date", "range", ".", "This", "method", "will", "only", "work", "on", "SoftLayer_Metric_Tracking_Object", "for", "SoftLayer_Hardware", "objects", "and", "SoftLayer_Virtual_Guest", "objects", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L109-L118
6,057
softlayer/softlayer-go
services/metric.go
GetCustomGraphData
func (r Metric_Tracking_Object) GetCustomGraphData(graphContainer *datatypes.Container_Graph) (resp datatypes.Container_Graph, err error) { params := []interface{}{ graphContainer, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getCustomGraphData", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetCustomGraphData(graphContainer *datatypes.Container_Graph) (resp datatypes.Container_Graph, err error) { params := []interface{}{ graphContainer, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getCustomGraphData", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetCustomGraphData", "(", "graphContainer", "*", "datatypes", ".", "Container_Graph", ")", "(", "resp", "datatypes", ".", "Container_Graph", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "graphContainer", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Returns a graph container instance that is populated with metric data for the tracking object.
[ "Returns", "a", "graph", "container", "instance", "that", "is", "populated", "with", "metric", "data", "for", "the", "tracking", "object", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L121-L127
6,058
softlayer/softlayer-go
services/metric.go
GetDetailsForDateRange
func (r Metric_Tracking_Object) GetDetailsForDateRange(startDate *datatypes.Time, endDate *datatypes.Time, graphType []string) (resp []datatypes.Container_Metric_Tracking_Object_Details, err error) { params := []interface{}{ startDate, endDate, graphType, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getDetailsForDateRange", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetDetailsForDateRange(startDate *datatypes.Time, endDate *datatypes.Time, graphType []string) (resp []datatypes.Container_Metric_Tracking_Object_Details, err error) { params := []interface{}{ startDate, endDate, graphType, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getDetailsForDateRange", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetDetailsForDateRange", "(", "startDate", "*", "datatypes", ".", "Time", ",", "endDate", "*", "datatypes", ".", "Time", ",", "graphType", "[", "]", "string", ")", "(", "resp", "[", "]", "datatypes", ".", "Container_Metric_Tracking_Object_Details", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "startDate", ",", "endDate", ",", "graphType", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve a collection of detailed metric data over a date range. Ideal if you want to employ your own graphing systems. Note not all metrics support this method. Those that do not return null.
[ "Retrieve", "a", "collection", "of", "detailed", "metric", "data", "over", "a", "date", "range", ".", "Ideal", "if", "you", "want", "to", "employ", "your", "own", "graphing", "systems", ".", "Note", "not", "all", "metrics", "support", "this", "method", ".", "Those", "that", "do", "not", "return", "null", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L130-L138
6,059
softlayer/softlayer-go
services/metric.go
GetGraph
func (r Metric_Tracking_Object) GetGraph(startDateTime *datatypes.Time, endDateTime *datatypes.Time, graphType []string) (resp datatypes.Container_Bandwidth_GraphOutputs, err error) { params := []interface{}{ startDateTime, endDateTime, graphType, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getGraph", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetGraph(startDateTime *datatypes.Time, endDateTime *datatypes.Time, graphType []string) (resp datatypes.Container_Bandwidth_GraphOutputs, err error) { params := []interface{}{ startDateTime, endDateTime, graphType, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getGraph", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetGraph", "(", "startDateTime", "*", "datatypes", ".", "Time", ",", "endDateTime", "*", "datatypes", ".", "Time", ",", "graphType", "[", "]", "string", ")", "(", "resp", "datatypes", ".", "Container_Bandwidth_GraphOutputs", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "startDateTime", ",", "endDateTime", ",", "graphType", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve a PNG image of a metric in graph form.
[ "Retrieve", "a", "PNG", "image", "of", "a", "metric", "in", "graph", "form", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L141-L149
6,060
softlayer/softlayer-go
services/metric.go
GetMetricDataTypes
func (r Metric_Tracking_Object) GetMetricDataTypes() (resp []datatypes.Container_Metric_Data_Type, err error) { err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getMetricDataTypes", nil, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetMetricDataTypes() (resp []datatypes.Container_Metric_Data_Type, err error) { err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getMetricDataTypes", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetMetricDataTypes", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Container_Metric_Data_Type", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Returns a collection of metric data types that can be retrieved for a metric tracking object.
[ "Returns", "a", "collection", "of", "metric", "data", "types", "that", "can", "be", "retrieved", "for", "a", "metric", "tracking", "object", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L152-L155
6,061
softlayer/softlayer-go
services/metric.go
GetSummary
func (r Metric_Tracking_Object) GetSummary(graphType *string) (resp datatypes.Container_Metric_Tracking_Object_Summary, err error) { params := []interface{}{ graphType, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getSummary", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetSummary(graphType *string) (resp datatypes.Container_Metric_Tracking_Object_Summary, err error) { params := []interface{}{ graphType, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getSummary", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetSummary", "(", "graphType", "*", "string", ")", "(", "resp", "datatypes", ".", "Container_Metric_Tracking_Object_Summary", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "graphType", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve a metric summary. Ideal if you want to employ your own graphing systems. Note not all metric types contain a summary. These return null.
[ "Retrieve", "a", "metric", "summary", ".", "Ideal", "if", "you", "want", "to", "employ", "your", "own", "graphing", "systems", ".", "Note", "not", "all", "metric", "types", "contain", "a", "summary", ".", "These", "return", "null", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L164-L170
6,062
softlayer/softlayer-go
services/metric.go
GetSummaryData
func (r Metric_Tracking_Object) GetSummaryData(startDateTime *datatypes.Time, endDateTime *datatypes.Time, validTypes []datatypes.Container_Metric_Data_Type, summaryPeriod *int) (resp []datatypes.Metric_Tracking_Object_Data, err error) { params := []interface{}{ startDateTime, endDateTime, validTypes, summaryPeriod, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getSummaryData", params, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetSummaryData(startDateTime *datatypes.Time, endDateTime *datatypes.Time, validTypes []datatypes.Container_Metric_Data_Type, summaryPeriod *int) (resp []datatypes.Metric_Tracking_Object_Data, err error) { params := []interface{}{ startDateTime, endDateTime, validTypes, summaryPeriod, } err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getSummaryData", params, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetSummaryData", "(", "startDateTime", "*", "datatypes", ".", "Time", ",", "endDateTime", "*", "datatypes", ".", "Time", ",", "validTypes", "[", "]", "datatypes", ".", "Container_Metric_Data_Type", ",", "summaryPeriod", "*", "int", ")", "(", "resp", "[", "]", "datatypes", ".", "Metric_Tracking_Object_Data", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "startDateTime", ",", "endDateTime", ",", "validTypes", ",", "summaryPeriod", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Returns summarized metric data for the date range, metric type and summary period provided.
[ "Returns", "summarized", "metric", "data", "for", "the", "date", "range", "metric", "type", "and", "summary", "period", "provided", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L173-L182
6,063
softlayer/softlayer-go
services/metric.go
GetType
func (r Metric_Tracking_Object) GetType() (resp datatypes.Metric_Tracking_Object_Type, err error) { err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getType", nil, &r.Options, &resp) return }
go
func (r Metric_Tracking_Object) GetType() (resp datatypes.Metric_Tracking_Object_Type, err error) { err = r.Session.DoRequest("SoftLayer_Metric_Tracking_Object", "getType", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Metric_Tracking_Object", ")", "GetType", "(", ")", "(", "resp", "datatypes", ".", "Metric_Tracking_Object_Type", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The type of data that a tracking object polls.
[ "Retrieve", "The", "type", "of", "data", "that", "a", "tracking", "object", "polls", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/metric.go#L185-L188
6,064
softlayer/softlayer-go
services/layout.go
GetLayoutContainerType
func (r Layout_Container) GetLayoutContainerType() (resp datatypes.Layout_Container_Type, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Container", "getLayoutContainerType", nil, &r.Options, &resp) return }
go
func (r Layout_Container) GetLayoutContainerType() (resp datatypes.Layout_Container_Type, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Container", "getLayoutContainerType", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Layout_Container", ")", "GetLayoutContainerType", "(", ")", "(", "resp", "datatypes", ".", "Layout_Container_Type", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The type of the layout container object
[ "Retrieve", "The", "type", "of", "the", "layout", "container", "object" ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/layout.go#L79-L82
6,065
softlayer/softlayer-go
services/layout.go
GetLayoutItems
func (r Layout_Container) GetLayoutItems() (resp []datatypes.Layout_Item, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Container", "getLayoutItems", nil, &r.Options, &resp) return }
go
func (r Layout_Container) GetLayoutItems() (resp []datatypes.Layout_Item, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Container", "getLayoutItems", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Layout_Container", ")", "GetLayoutItems", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Layout_Item", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The layout items assigned to this layout container
[ "Retrieve", "The", "layout", "items", "assigned", "to", "this", "layout", "container" ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/layout.go#L85-L88
6,066
softlayer/softlayer-go
services/layout.go
GetLayoutItemPreferences
func (r Layout_Item) GetLayoutItemPreferences() (resp []datatypes.Layout_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Item", "getLayoutItemPreferences", nil, &r.Options, &resp) return }
go
func (r Layout_Item) GetLayoutItemPreferences() (resp []datatypes.Layout_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Item", "getLayoutItemPreferences", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Layout_Item", ")", "GetLayoutItemPreferences", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Layout_Preference", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The layout preferences assigned to this layout item
[ "Retrieve", "The", "layout", "preferences", "assigned", "to", "this", "layout", "item" ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/layout.go#L137-L140
6,067
softlayer/softlayer-go
services/layout.go
GetLayoutItemType
func (r Layout_Item) GetLayoutItemType() (resp datatypes.Layout_Item_Type, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Item", "getLayoutItemType", nil, &r.Options, &resp) return }
go
func (r Layout_Item) GetLayoutItemType() (resp datatypes.Layout_Item_Type, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Item", "getLayoutItemType", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Layout_Item", ")", "GetLayoutItemType", "(", ")", "(", "resp", "datatypes", ".", "Layout_Item_Type", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The type of the layout item object
[ "Retrieve", "The", "type", "of", "the", "layout", "item", "object" ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/layout.go#L143-L146
6,068
softlayer/softlayer-go
services/layout.go
GetLayoutProfile
func (r Layout_Profile_Containers) GetLayoutProfile() (resp datatypes.Layout_Profile, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "getLayoutProfile", nil, &r.Options, &resp) return }
go
func (r Layout_Profile_Containers) GetLayoutProfile() (resp datatypes.Layout_Profile, err error) { err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "getLayoutProfile", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Layout_Profile_Containers", ")", "GetLayoutProfile", "(", ")", "(", "resp", "datatypes", ".", "Layout_Profile", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The profile containing this container
[ "Retrieve", "The", "profile", "containing", "this", "container" ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/layout.go#L323-L326
6,069
softlayer/softlayer-go
services/notification.go
GetRequiredPreferences
func (r Notification) GetRequiredPreferences() (resp []datatypes.Notification_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Notification", "getRequiredPreferences", nil, &r.Options, &resp) return }
go
func (r Notification) GetRequiredPreferences() (resp []datatypes.Notification_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Notification", "getRequiredPreferences", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification", ")", "GetRequiredPreferences", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Notification_Preference", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The required preferences related to the notification. While configurable, the subscriber does not have the option whether to use the preference.
[ "Retrieve", "The", "required", "preferences", "related", "to", "the", "notification", ".", "While", "configurable", "the", "subscriber", "does", "not", "have", "the", "option", "whether", "to", "use", "the", "preference", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L91-L94
6,070
softlayer/softlayer-go
services/notification.go
GetImpactedAccountCount
func (r Notification_Occurrence_Event) GetImpactedAccountCount() (resp int, err error) { err = r.Session.DoRequest("SoftLayer_Notification_Occurrence_Event", "getImpactedAccountCount", nil, &r.Options, &resp) return }
go
func (r Notification_Occurrence_Event) GetImpactedAccountCount() (resp int, err error) { err = r.Session.DoRequest("SoftLayer_Notification_Occurrence_Event", "getImpactedAccountCount", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_Occurrence_Event", ")", "GetImpactedAccountCount", "(", ")", "(", "resp", "int", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method will return the number of impacted owned accounts associated with this event for the current user.
[ "This", "method", "will", "return", "the", "number", "of", "impacted", "owned", "accounts", "associated", "with", "this", "event", "for", "the", "current", "user", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L251-L254
6,071
softlayer/softlayer-go
services/notification.go
GetNotificationOccurrenceEventType
func (r Notification_Occurrence_Event) GetNotificationOccurrenceEventType() (resp datatypes.Notification_Occurrence_Event_Type, err error) { err = r.Session.DoRequest("SoftLayer_Notification_Occurrence_Event", "getNotificationOccurrenceEventType", nil, &r.Options, &resp) return }
go
func (r Notification_Occurrence_Event) GetNotificationOccurrenceEventType() (resp datatypes.Notification_Occurrence_Event_Type, err error) { err = r.Session.DoRequest("SoftLayer_Notification_Occurrence_Event", "getNotificationOccurrenceEventType", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_Occurrence_Event", ")", "GetNotificationOccurrenceEventType", "(", ")", "(", "resp", "datatypes", ".", "Notification_Occurrence_Event_Type", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The type of event such as planned or unplanned maintenance.
[ "Retrieve", "The", "type", "of", "event", "such", "as", "planned", "or", "unplanned", "maintenance", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L293-L296
6,072
softlayer/softlayer-go
services/notification.go
GetUpdates
func (r Notification_Occurrence_Event) GetUpdates() (resp []datatypes.Notification_Occurrence_Update, err error) { err = r.Session.DoRequest("SoftLayer_Notification_Occurrence_Event", "getUpdates", nil, &r.Options, &resp) return }
go
func (r Notification_Occurrence_Event) GetUpdates() (resp []datatypes.Notification_Occurrence_Update, err error) { err = r.Session.DoRequest("SoftLayer_Notification_Occurrence_Event", "getUpdates", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_Occurrence_Event", ")", "GetUpdates", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Notification_Occurrence_Update", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve All updates for this event.
[ "Retrieve", "All", "updates", "for", "this", "event", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L311-L314
6,073
softlayer/softlayer-go
services/notification.go
GetDeliveryMethods
func (r Notification_User_Subscriber_Billing) GetDeliveryMethods() (resp []datatypes.Notification_Delivery_Method, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Billing", "getDeliveryMethods", nil, &r.Options, &resp) return }
go
func (r Notification_User_Subscriber_Billing) GetDeliveryMethods() (resp []datatypes.Notification_Delivery_Method, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Billing", "getDeliveryMethods", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_User_Subscriber_Billing", ")", "GetDeliveryMethods", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Notification_Delivery_Method", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The delivery methods used to send the subscribed notification.
[ "Retrieve", "The", "delivery", "methods", "used", "to", "send", "the", "subscribed", "notification", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L625-L628
6,074
softlayer/softlayer-go
services/notification.go
GetNotification
func (r Notification_User_Subscriber_Mobile) GetNotification() (resp datatypes.Notification, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Mobile", "getNotification", nil, &r.Options, &resp) return }
go
func (r Notification_User_Subscriber_Mobile) GetNotification() (resp datatypes.Notification, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Mobile", "getNotification", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_User_Subscriber_Mobile", ")", "GetNotification", "(", ")", "(", "resp", "datatypes", ".", "Notification", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve Notification subscribed to.
[ "Retrieve", "Notification", "subscribed", "to", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L771-L774
6,075
softlayer/softlayer-go
services/notification.go
GetPreferencesDetails
func (r Notification_User_Subscriber_Mobile) GetPreferencesDetails() (resp []datatypes.Notification_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Mobile", "getPreferencesDetails", nil, &r.Options, &resp) return }
go
func (r Notification_User_Subscriber_Mobile) GetPreferencesDetails() (resp []datatypes.Notification_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Mobile", "getPreferencesDetails", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_User_Subscriber_Mobile", ")", "GetPreferencesDetails", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Notification_Preference", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve Preference details such as description, minimum and maximum limits, default value and unit of measure.
[ "Retrieve", "Preference", "details", "such", "as", "description", "minimum", "and", "maximum", "limits", "default", "value", "and", "unit", "of", "measure", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L789-L792
6,076
softlayer/softlayer-go
services/notification.go
GetResourceRecord
func (r Notification_User_Subscriber_Mobile) GetResourceRecord() (resp datatypes.Notification_User_Subscriber_Resource, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Mobile", "getResourceRecord", nil, &r.Options, &resp) return }
go
func (r Notification_User_Subscriber_Mobile) GetResourceRecord() (resp datatypes.Notification_User_Subscriber_Resource, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Mobile", "getResourceRecord", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_User_Subscriber_Mobile", ")", "GetResourceRecord", "(", ")", "(", "resp", "datatypes", ".", "Notification_User_Subscriber_Resource", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The subscriber id to resource id mapping.
[ "Retrieve", "The", "subscriber", "id", "to", "resource", "id", "mapping", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L795-L798
6,077
softlayer/softlayer-go
services/notification.go
GetDefaultPreference
func (r Notification_User_Subscriber_Preference) GetDefaultPreference() (resp datatypes.Notification_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Preference", "getDefaultPreference", nil, &r.Options, &resp) return }
go
func (r Notification_User_Subscriber_Preference) GetDefaultPreference() (resp datatypes.Notification_Preference, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Preference", "getDefaultPreference", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_User_Subscriber_Preference", ")", "GetDefaultPreference", "(", ")", "(", "resp", "datatypes", ".", "Notification_Preference", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve Details such name, keyname, minimum and maximum values for the preference.
[ "Retrieve", "Details", "such", "name", "keyname", "minimum", "and", "maximum", "values", "for", "the", "preference", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L877-L880
6,078
softlayer/softlayer-go
services/notification.go
GetNotificationUserSubscriber
func (r Notification_User_Subscriber_Preference) GetNotificationUserSubscriber() (resp datatypes.Notification_User_Subscriber, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Preference", "getNotificationUserSubscriber", nil, &r.Options, &resp) return }
go
func (r Notification_User_Subscriber_Preference) GetNotificationUserSubscriber() (resp datatypes.Notification_User_Subscriber, err error) { err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Preference", "getNotificationUserSubscriber", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Notification_User_Subscriber_Preference", ")", "GetNotificationUserSubscriber", "(", ")", "(", "resp", "datatypes", ".", "Notification_User_Subscriber", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve Details of the subscriber tied to the preference.
[ "Retrieve", "Details", "of", "the", "subscriber", "tied", "to", "the", "preference", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/notification.go#L883-L886
6,079
softlayer/softlayer-go
services/monitoring.go
AddConfigurationProfile
func (r Monitoring_Agent) AddConfigurationProfile(configurationValues []datatypes.Monitoring_Agent_Configuration_Value) (resp datatypes.Provisioning_Version1_Transaction, err error) { params := []interface{}{ configurationValues, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "addConfigurationProfile", params, &r.Options, &resp) return }
go
func (r Monitoring_Agent) AddConfigurationProfile(configurationValues []datatypes.Monitoring_Agent_Configuration_Value) (resp datatypes.Provisioning_Version1_Transaction, err error) { params := []interface{}{ configurationValues, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "addConfigurationProfile", params, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "AddConfigurationProfile", "(", "configurationValues", "[", "]", "datatypes", ".", "Monitoring_Agent_Configuration_Value", ")", "(", "resp", "datatypes", ".", "Provisioning_Version1_Transaction", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "configurationValues", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method is used to apply changes to a monitoring agent's configuration for SoftLayer_Configuration_Template_Section with the property sectionType that has a keyName of 'TEMPLATE_SECTION'. Configuration values that are passed in can be new or updated objects but must have a definitionId and profileId defined for both. Existing SoftLayer_Monitoring_Agent_Configuration_Value values can be retrieved as a property of the SoftLayer_Configuration_Template_Section_Definition's from the monitoring agent's configurationTemplate property. New values will follow the structure of SoftLayer_Monitoring_Agent_Configuration_Value. It returns a SoftLayer_Provisioning_Version1_Transaction object to track the progress of the update being applied. Some configuration sections act as a template which helps to create additional monitoring configurations. For instance, Core Resource monitoring agent lets you create monitoring configurations for different disk volumes or disk path.
[ "This", "method", "is", "used", "to", "apply", "changes", "to", "a", "monitoring", "agent", "s", "configuration", "for", "SoftLayer_Configuration_Template_Section", "with", "the", "property", "sectionType", "that", "has", "a", "keyName", "of", "TEMPLATE_SECTION", ".", "Configuration", "values", "that", "are", "passed", "in", "can", "be", "new", "or", "updated", "objects", "but", "must", "have", "a", "definitionId", "and", "profileId", "defined", "for", "both", ".", "Existing", "SoftLayer_Monitoring_Agent_Configuration_Value", "values", "can", "be", "retrieved", "as", "a", "property", "of", "the", "SoftLayer_Configuration_Template_Section_Definition", "s", "from", "the", "monitoring", "agent", "s", "configurationTemplate", "property", ".", "New", "values", "will", "follow", "the", "structure", "of", "SoftLayer_Monitoring_Agent_Configuration_Value", ".", "It", "returns", "a", "SoftLayer_Provisioning_Version1_Transaction", "object", "to", "track", "the", "progress", "of", "the", "update", "being", "applied", ".", "Some", "configuration", "sections", "act", "as", "a", "template", "which", "helps", "to", "create", "additional", "monitoring", "configurations", ".", "For", "instance", "Core", "Resource", "monitoring", "agent", "lets", "you", "create", "monitoring", "configurations", "for", "different", "disk", "volumes", "or", "disk", "path", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L79-L85
6,080
softlayer/softlayer-go
services/monitoring.go
DeleteConfigurationProfile
func (r Monitoring_Agent) DeleteConfigurationProfile(sectionId *int, profileId *int) (resp bool, err error) { params := []interface{}{ sectionId, profileId, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "deleteConfigurationProfile", params, &r.Options, &resp) return }
go
func (r Monitoring_Agent) DeleteConfigurationProfile(sectionId *int, profileId *int) (resp bool, err error) { params := []interface{}{ sectionId, profileId, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "deleteConfigurationProfile", params, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "DeleteConfigurationProfile", "(", "sectionId", "*", "int", ",", "profileId", "*", "int", ")", "(", "resp", "bool", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "sectionId", ",", "profileId", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method will remove a SoftLayer_Configuration_Template_Section_Profile from a SoftLayer_Configuration_Template_Section by passing in the sectionId of the profile object and identifier of the profile. This will execute the action immediately on the server and the SoftLayer_Configuration_Template_Section returning a boolean true if successful.
[ "This", "method", "will", "remove", "a", "SoftLayer_Configuration_Template_Section_Profile", "from", "a", "SoftLayer_Configuration_Template_Section", "by", "passing", "in", "the", "sectionId", "of", "the", "profile", "object", "and", "identifier", "of", "the", "profile", ".", "This", "will", "execute", "the", "action", "immediately", "on", "the", "server", "and", "the", "SoftLayer_Configuration_Template_Section", "returning", "a", "boolean", "true", "if", "successful", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L103-L110
6,081
softlayer/softlayer-go
services/monitoring.go
GetActiveAlarmSubscribers
func (r Monitoring_Agent) GetActiveAlarmSubscribers() (resp []datatypes.Notification_User_Subscriber, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getActiveAlarmSubscribers", nil, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetActiveAlarmSubscribers() (resp []datatypes.Notification_User_Subscriber, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getActiveAlarmSubscribers", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetActiveAlarmSubscribers", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Notification_User_Subscriber", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method retrieves an array of SoftLayer_Notification_User_Subscriber objects belonging to the SoftLayer_Monitoring_Agent which are able to receive alarm notifications.
[ "This", "method", "retrieves", "an", "array", "of", "SoftLayer_Notification_User_Subscriber", "objects", "belonging", "to", "the", "SoftLayer_Monitoring_Agent", "which", "are", "able", "to", "receive", "alarm", "notifications", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L122-L125
6,082
softlayer/softlayer-go
services/monitoring.go
GetAgentStatus
func (r Monitoring_Agent) GetAgentStatus() (resp datatypes.Monitoring_Agent_Status, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getAgentStatus", nil, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetAgentStatus() (resp datatypes.Monitoring_Agent_Status, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getAgentStatus", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetAgentStatus", "(", ")", "(", "resp", "datatypes", ".", "Monitoring_Agent_Status", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The current status of the corresponding agent
[ "Retrieve", "The", "current", "status", "of", "the", "corresponding", "agent" ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L128-L131
6,083
softlayer/softlayer-go
services/monitoring.go
GetAvailableConfigurationTemplates
func (r Monitoring_Agent) GetAvailableConfigurationTemplates() (resp []datatypes.Configuration_Template, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getAvailableConfigurationTemplates", nil, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetAvailableConfigurationTemplates() (resp []datatypes.Configuration_Template, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getAvailableConfigurationTemplates", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetAvailableConfigurationTemplates", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Configuration_Template", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method returns an array of available SoftLayer_Configuration_Template objects for this monitoring agent.
[ "This", "method", "returns", "an", "array", "of", "available", "SoftLayer_Configuration_Template", "objects", "for", "this", "monitoring", "agent", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L134-L137
6,084
softlayer/softlayer-go
services/monitoring.go
GetAvailableConfigurationValues
func (r Monitoring_Agent) GetAvailableConfigurationValues(configurationDefinitionId *int, configValues []datatypes.Monitoring_Agent_Configuration_Value) (resp []datatypes.Monitoring_Agent_Configuration_Value, err error) { params := []interface{}{ configurationDefinitionId, configValues, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getAvailableConfigurationValues", params, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetAvailableConfigurationValues(configurationDefinitionId *int, configValues []datatypes.Monitoring_Agent_Configuration_Value) (resp []datatypes.Monitoring_Agent_Configuration_Value, err error) { params := []interface{}{ configurationDefinitionId, configValues, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getAvailableConfigurationValues", params, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetAvailableConfigurationValues", "(", "configurationDefinitionId", "*", "int", ",", "configValues", "[", "]", "datatypes", ".", "Monitoring_Agent_Configuration_Value", ")", "(", "resp", "[", "]", "datatypes", ".", "Monitoring_Agent_Configuration_Value", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "configurationDefinitionId", ",", "configValues", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Returns an array of available configuration values that are specific to a server or a Virtual that this monitoring agent is running on. For example, invoking this method against "Network Traffic Monitoring Agent" will return all available network adapters on your system.
[ "Returns", "an", "array", "of", "available", "configuration", "values", "that", "are", "specific", "to", "a", "server", "or", "a", "Virtual", "that", "this", "monitoring", "agent", "is", "running", "on", ".", "For", "example", "invoking", "this", "method", "against", "Network", "Traffic", "Monitoring", "Agent", "will", "return", "all", "available", "network", "adapters", "on", "your", "system", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L140-L147
6,085
softlayer/softlayer-go
services/monitoring.go
GetEligibleAlarmSubscibers
func (r Monitoring_Agent) GetEligibleAlarmSubscibers() (resp []datatypes.User_Customer, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getEligibleAlarmSubscibers", nil, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetEligibleAlarmSubscibers() (resp []datatypes.User_Customer, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getEligibleAlarmSubscibers", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetEligibleAlarmSubscibers", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "User_Customer", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method returns an array of SoftLayer_User_Customer objects, representing those who are allowed to be used as alarm subscribers.
[ "This", "method", "returns", "an", "array", "of", "SoftLayer_User_Customer", "objects", "representing", "those", "who", "are", "allowed", "to", "be", "used", "as", "alarm", "subscribers", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L168-L171
6,086
softlayer/softlayer-go
services/monitoring.go
GetGraph
func (r Monitoring_Agent) GetGraph(configurationValues []datatypes.Monitoring_Agent_Configuration_Value, beginDate *datatypes.Time, endDate *datatypes.Time) (resp datatypes.Container_Monitoring_Graph_Outputs, err error) { params := []interface{}{ configurationValues, beginDate, endDate, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getGraph", params, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetGraph(configurationValues []datatypes.Monitoring_Agent_Configuration_Value, beginDate *datatypes.Time, endDate *datatypes.Time) (resp datatypes.Container_Monitoring_Graph_Outputs, err error) { params := []interface{}{ configurationValues, beginDate, endDate, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getGraph", params, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetGraph", "(", "configurationValues", "[", "]", "datatypes", ".", "Monitoring_Agent_Configuration_Value", ",", "beginDate", "*", "datatypes", ".", "Time", ",", "endDate", "*", "datatypes", ".", "Time", ")", "(", "resp", "datatypes", ".", "Container_Monitoring_Graph_Outputs", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "configurationValues", ",", "beginDate", ",", "endDate", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method returns a SoftLayer_Container_Bandwidth_GraphOutputs object containing a base64 PNG string graph of the provided configuration values for the given begin and end dates.
[ "This", "method", "returns", "a", "SoftLayer_Container_Bandwidth_GraphOutputs", "object", "containing", "a", "base64", "PNG", "string", "graph", "of", "the", "provided", "configuration", "values", "for", "the", "given", "begin", "and", "end", "dates", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L174-L182
6,087
softlayer/softlayer-go
services/monitoring.go
GetGraphData
func (r Monitoring_Agent) GetGraphData(metricDataTypes []datatypes.Container_Metric_Data_Type, startDate *datatypes.Time, endDate *datatypes.Time) (resp []datatypes.Metric_Tracking_Object_Data, err error) { params := []interface{}{ metricDataTypes, startDate, endDate, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getGraphData", params, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetGraphData(metricDataTypes []datatypes.Container_Metric_Data_Type, startDate *datatypes.Time, endDate *datatypes.Time) (resp []datatypes.Metric_Tracking_Object_Data, err error) { params := []interface{}{ metricDataTypes, startDate, endDate, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getGraphData", params, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetGraphData", "(", "metricDataTypes", "[", "]", "datatypes", ".", "Container_Metric_Data_Type", ",", "startDate", "*", "datatypes", ".", "Time", ",", "endDate", "*", "datatypes", ".", "Time", ")", "(", "resp", "[", "]", "datatypes", ".", "Metric_Tracking_Object_Data", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "metricDataTypes", ",", "startDate", ",", "endDate", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method returns the metric data for each of the configuration values provided during the given time range.
[ "This", "method", "returns", "the", "metric", "data", "for", "each", "of", "the", "configuration", "values", "provided", "during", "the", "given", "time", "range", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L185-L193
6,088
softlayer/softlayer-go
services/monitoring.go
GetProductItem
func (r Monitoring_Agent) GetProductItem() (resp datatypes.Product_Item, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getProductItem", nil, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetProductItem() (resp datatypes.Product_Item, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getProductItem", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetProductItem", "(", ")", "(", "resp", "datatypes", ".", "Product_Item", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve Contains general information relating to a single SoftLayer product.
[ "Retrieve", "Contains", "general", "information", "relating", "to", "a", "single", "SoftLayer", "product", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L208-L211
6,089
softlayer/softlayer-go
services/monitoring.go
GetStatusName
func (r Monitoring_Agent) GetStatusName() (resp string, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getStatusName", nil, &r.Options, &resp) return }
go
func (r Monitoring_Agent) GetStatusName() (resp string, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "getStatusName", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "GetStatusName", "(", ")", "(", "resp", "string", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve Monitoring agent status name.
[ "Retrieve", "Monitoring", "agent", "status", "name", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L220-L223
6,090
softlayer/softlayer-go
services/monitoring.go
SetActiveAlarmSubscriber
func (r Monitoring_Agent) SetActiveAlarmSubscriber(userRecordId *int) (resp bool, err error) { params := []interface{}{ userRecordId, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "setActiveAlarmSubscriber", params, &r.Options, &resp) return }
go
func (r Monitoring_Agent) SetActiveAlarmSubscriber(userRecordId *int) (resp bool, err error) { params := []interface{}{ userRecordId, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent", "setActiveAlarmSubscriber", params, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent", ")", "SetActiveAlarmSubscriber", "(", "userRecordId", "*", "int", ")", "(", "resp", "bool", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "userRecordId", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method assigns a user to receive the alerts generated by this SoftLayer_Monitoring_Agent.
[ "This", "method", "assigns", "a", "user", "to", "receive", "the", "alerts", "generated", "by", "this", "SoftLayer_Monitoring_Agent", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L253-L259
6,091
softlayer/softlayer-go
services/monitoring.go
GetConfigurationGroups
func (r Monitoring_Agent_Configuration_Template_Group) GetConfigurationGroups(packageId *int) (resp []datatypes.Monitoring_Agent_Configuration_Template_Group, err error) { params := []interface{}{ packageId, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent_Configuration_Template_Group", "getConfigurationGroups", params, &r.Options, &resp) return }
go
func (r Monitoring_Agent_Configuration_Template_Group) GetConfigurationGroups(packageId *int) (resp []datatypes.Monitoring_Agent_Configuration_Template_Group, err error) { params := []interface{}{ packageId, } err = r.Session.DoRequest("SoftLayer_Monitoring_Agent_Configuration_Template_Group", "getConfigurationGroups", params, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent_Configuration_Template_Group", ")", "GetConfigurationGroups", "(", "packageId", "*", "int", ")", "(", "resp", "[", "]", "datatypes", ".", "Monitoring_Agent_Configuration_Template_Group", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "packageId", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// This method retrieves an array of SoftLayer_Monitoring_Agent_Configuration_Template_Group objects that are available to the active user's account. The packageId parameter is not currently used.
[ "This", "method", "retrieves", "an", "array", "of", "SoftLayer_Monitoring_Agent_Configuration_Template_Group", "objects", "that", "are", "available", "to", "the", "active", "user", "s", "account", ".", "The", "packageId", "parameter", "is", "not", "currently", "used", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L338-L344
6,092
softlayer/softlayer-go
services/monitoring.go
GetMetricDataType
func (r Monitoring_Agent_Configuration_Value) GetMetricDataType() (resp datatypes.Container_Metric_Data_Type, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent_Configuration_Value", "getMetricDataType", nil, &r.Options, &resp) return }
go
func (r Monitoring_Agent_Configuration_Value) GetMetricDataType() (resp datatypes.Container_Metric_Data_Type, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Agent_Configuration_Value", "getMetricDataType", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Agent_Configuration_Value", ")", "GetMetricDataType", "(", ")", "(", "resp", "datatypes", ".", "Container_Metric_Data_Type", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The metric data type used to retrieve metric data currently being tracked.
[ "Retrieve", "The", "metric", "data", "type", "used", "to", "retrieve", "metric", "data", "currently", "being", "tracked", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L517-L520
6,093
softlayer/softlayer-go
services/monitoring.go
CheckConnection
func (r Monitoring_Robot) CheckConnection() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "checkConnection", nil, &r.Options, &resp) return }
go
func (r Monitoring_Robot) CheckConnection() (resp bool, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "checkConnection", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Robot", ")", "CheckConnection", "(", ")", "(", "resp", "bool", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Checks if a monitoring robot can communicate with SoftLayer monitoring management system via the private network. // // TCP port 48000 - 48002 must be open on your server or your virtual server in order for this test to succeed.
[ "Checks", "if", "a", "monitoring", "robot", "can", "communicate", "with", "SoftLayer", "monitoring", "management", "system", "via", "the", "private", "network", ".", "TCP", "port", "48000", "-", "48002", "must", "be", "open", "on", "your", "server", "or", "your", "virtual", "server", "in", "order", "for", "this", "test", "to", "succeed", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L629-L632
6,094
softlayer/softlayer-go
services/monitoring.go
GetAvailableConfigurationGroups
func (r Monitoring_Robot) GetAvailableConfigurationGroups() (resp []datatypes.Monitoring_Agent_Configuration_Template_Group, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "getAvailableConfigurationGroups", nil, &r.Options, &resp) return }
go
func (r Monitoring_Robot) GetAvailableConfigurationGroups() (resp []datatypes.Monitoring_Agent_Configuration_Template_Group, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "getAvailableConfigurationGroups", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Robot", ")", "GetAvailableConfigurationGroups", "(", ")", "(", "resp", "[", "]", "datatypes", ".", "Monitoring_Agent_Configuration_Template_Group", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Returns available configuration template groups for this monitoring agent.
[ "Returns", "available", "configuration", "template", "groups", "for", "this", "monitoring", "agent", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L650-L653
6,095
softlayer/softlayer-go
services/monitoring.go
GetRobotStatus
func (r Monitoring_Robot) GetRobotStatus() (resp datatypes.Monitoring_Robot_Status, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "getRobotStatus", nil, &r.Options, &resp) return }
go
func (r Monitoring_Robot) GetRobotStatus() (resp datatypes.Monitoring_Robot_Status, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "getRobotStatus", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Robot", ")", "GetRobotStatus", "(", ")", "(", "resp", "datatypes", ".", "Monitoring_Robot_Status", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The current status of the robot.
[ "Retrieve", "The", "current", "status", "of", "the", "robot", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L668-L671
6,096
softlayer/softlayer-go
services/monitoring.go
GetSoftwareComponent
func (r Monitoring_Robot) GetSoftwareComponent() (resp datatypes.Software_Component, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "getSoftwareComponent", nil, &r.Options, &resp) return }
go
func (r Monitoring_Robot) GetSoftwareComponent() (resp datatypes.Software_Component, err error) { err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "getSoftwareComponent", nil, &r.Options, &resp) return }
[ "func", "(", "r", "Monitoring_Robot", ")", "GetSoftwareComponent", "(", ")", "(", "resp", "datatypes", ".", "Software_Component", ",", "err", "error", ")", "{", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Retrieve The SoftLayer_Software_Component that corresponds to the robot installation on the server.
[ "Retrieve", "The", "SoftLayer_Software_Component", "that", "corresponds", "to", "the", "robot", "installation", "on", "the", "server", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/monitoring.go#L674-L677
6,097
softlayer/softlayer-go
services/dns.go
CreateARecord
func (r Dns_Domain) CreateARecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_AType, err error) { params := []interface{}{ host, data, ttl, } err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createARecord", params, &r.Options, &resp) return }
go
func (r Dns_Domain) CreateARecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_AType, err error) { params := []interface{}{ host, data, ttl, } err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createARecord", params, &r.Options, &resp) return }
[ "func", "(", "r", "Dns_Domain", ")", "CreateARecord", "(", "host", "*", "string", ",", "data", "*", "string", ",", "ttl", "*", "int", ")", "(", "resp", "datatypes", ".", "Dns_Domain_ResourceRecord_AType", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "host", ",", "data", ",", "ttl", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Create an A record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_AType.
[ "Create", "an", "A", "record", "on", "a", "SoftLayer", "domain", ".", "This", "is", "a", "shortcut", "method", "meant", "to", "take", "the", "work", "out", "of", "creating", "a", "SoftLayer_Dns_Domain_ResourceRecord", "if", "you", "already", "have", "a", "domain", "record", "available", ".", "createARecord", "returns", "the", "newly", "created", "SoftLayer_Dns_Domain_ResourceRecord_AType", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/dns.go#L73-L81
6,098
softlayer/softlayer-go
services/dns.go
CreateAaaaRecord
func (r Dns_Domain) CreateAaaaRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_AaaaType, err error) { params := []interface{}{ host, data, ttl, } err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createAaaaRecord", params, &r.Options, &resp) return }
go
func (r Dns_Domain) CreateAaaaRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_AaaaType, err error) { params := []interface{}{ host, data, ttl, } err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createAaaaRecord", params, &r.Options, &resp) return }
[ "func", "(", "r", "Dns_Domain", ")", "CreateAaaaRecord", "(", "host", "*", "string", ",", "data", "*", "string", ",", "ttl", "*", "int", ")", "(", "resp", "datatypes", ".", "Dns_Domain_ResourceRecord_AaaaType", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "host", ",", "data", ",", "ttl", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Create an AAAA record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_AaaaType.
[ "Create", "an", "AAAA", "record", "on", "a", "SoftLayer", "domain", ".", "This", "is", "a", "shortcut", "method", "meant", "to", "take", "the", "work", "out", "of", "creating", "a", "SoftLayer_Dns_Domain_ResourceRecord", "if", "you", "already", "have", "a", "domain", "record", "available", ".", "createARecord", "returns", "the", "newly", "created", "SoftLayer_Dns_Domain_ResourceRecord_AaaaType", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/dns.go#L84-L92
6,099
softlayer/softlayer-go
services/dns.go
CreateCnameRecord
func (r Dns_Domain) CreateCnameRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_CnameType, err error) { params := []interface{}{ host, data, ttl, } err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createCnameRecord", params, &r.Options, &resp) return }
go
func (r Dns_Domain) CreateCnameRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_CnameType, err error) { params := []interface{}{ host, data, ttl, } err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createCnameRecord", params, &r.Options, &resp) return }
[ "func", "(", "r", "Dns_Domain", ")", "CreateCnameRecord", "(", "host", "*", "string", ",", "data", "*", "string", ",", "ttl", "*", "int", ")", "(", "resp", "datatypes", ".", "Dns_Domain_ResourceRecord_CnameType", ",", "err", "error", ")", "{", "params", ":=", "[", "]", "interface", "{", "}", "{", "host", ",", "data", ",", "ttl", ",", "}", "\n", "err", "=", "r", ".", "Session", ".", "DoRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "params", ",", "&", "r", ".", "Options", ",", "&", "resp", ")", "\n", "return", "\n", "}" ]
// Create a CNAME record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createCnameRecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_CnameType.
[ "Create", "a", "CNAME", "record", "on", "a", "SoftLayer", "domain", ".", "This", "is", "a", "shortcut", "method", "meant", "to", "take", "the", "work", "out", "of", "creating", "a", "SoftLayer_Dns_Domain_ResourceRecord", "if", "you", "already", "have", "a", "domain", "record", "available", ".", "createCnameRecord", "returns", "the", "newly", "created", "SoftLayer_Dns_Domain_ResourceRecord_CnameType", "." ]
aa510384a41b6450fa6a50e943ed32f5e838fada
https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/dns.go#L95-L103