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
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
145,000
wercker/journalhook
journalhook.go
stringifyEntries
func stringifyEntries(data map[string]interface{}) map[string]string { entries := make(map[string]string) for k, v := range data { key := stringifyKey(k) entries[key] = fmt.Sprint(v) } return entries }
go
func stringifyEntries(data map[string]interface{}) map[string]string { entries := make(map[string]string) for k, v := range data { key := stringifyKey(k) entries[key] = fmt.Sprint(v) } return entries }
[ "func", "stringifyEntries", "(", "data", "map", "[", "string", "]", "interface", "{", "}", ")", "map", "[", "string", "]", "string", "{", "entries", ":=", "make", "(", "map", "[", "string", "]", "string", ")", "\n", "for", "k", ",", "v", ":=", "ran...
// Journal wants strings but logrus takes anything.
[ "Journal", "wants", "strings", "but", "logrus", "takes", "anything", "." ]
5d0a5ae867b354cbbbd2a9ab8d66b4f96cfaa741
https://github.com/wercker/journalhook/blob/5d0a5ae867b354cbbbd2a9ab8d66b4f96cfaa741/journalhook.go#L51-L59
145,001
wercker/journalhook
journalhook.go
Enable
func Enable() { if !journal.Enabled() { logrus.Warning("Journal not available but user requests we log to it. Ignoring") } else { logrus.AddHook(&JournalHook{}) logrus.SetOutput(ioutil.Discard) } }
go
func Enable() { if !journal.Enabled() { logrus.Warning("Journal not available but user requests we log to it. Ignoring") } else { logrus.AddHook(&JournalHook{}) logrus.SetOutput(ioutil.Discard) } }
[ "func", "Enable", "(", ")", "{", "if", "!", "journal", ".", "Enabled", "(", ")", "{", "logrus", ".", "Warning", "(", "\"", "\"", ")", "\n", "}", "else", "{", "logrus", ".", "AddHook", "(", "&", "JournalHook", "{", "}", ")", "\n", "logrus", ".", ...
// Adds the Journal hook if journal is enabled // Sets log output to ioutil.Discard so stdout isn't captured.
[ "Adds", "the", "Journal", "hook", "if", "journal", "is", "enabled", "Sets", "log", "output", "to", "ioutil", ".", "Discard", "so", "stdout", "isn", "t", "captured", "." ]
5d0a5ae867b354cbbbd2a9ab8d66b4f96cfaa741
https://github.com/wercker/journalhook/blob/5d0a5ae867b354cbbbd2a9ab8d66b4f96cfaa741/journalhook.go#L79-L86
145,002
jagregory/halgo
navigator.go
Follow
func (n navigator) Follow(rel string) navigator { return n.Followf(rel, nil) }
go
func (n navigator) Follow(rel string) navigator { return n.Followf(rel, nil) }
[ "func", "(", "n", "navigator", ")", "Follow", "(", "rel", "string", ")", "navigator", "{", "return", "n", ".", "Followf", "(", "rel", ",", "nil", ")", "\n", "}" ]
// Follow adds a relation to the follow queue of the navigator.
[ "Follow", "adds", "a", "relation", "to", "the", "follow", "queue", "of", "the", "navigator", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L96-L98
145,003
jagregory/halgo
navigator.go
Followf
func (n navigator) Followf(rel string, params P) navigator { relations := append([]relation{}, n.path...) relations = append(relations, relation{rel: rel, params: params}) return navigator{ HttpClient: n.HttpClient, path: relations, rootUri: n.rootUri, } }
go
func (n navigator) Followf(rel string, params P) navigator { relations := append([]relation{}, n.path...) relations = append(relations, relation{rel: rel, params: params}) return navigator{ HttpClient: n.HttpClient, path: relations, rootUri: n.rootUri, } }
[ "func", "(", "n", "navigator", ")", "Followf", "(", "rel", "string", ",", "params", "P", ")", "navigator", "{", "relations", ":=", "append", "(", "[", "]", "relation", "{", "}", ",", "n", ".", "path", "...", ")", "\n", "relations", "=", "append", "...
// Followf adds a relation to the follow queue of the navigator, with a // set of parameters to expand on execution.
[ "Followf", "adds", "a", "relation", "to", "the", "follow", "queue", "of", "the", "navigator", "with", "a", "set", "of", "parameters", "to", "expand", "on", "execution", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L102-L111
145,004
jagregory/halgo
navigator.go
Location
func (n navigator) Location(resp *http.Response) (navigator, error) { _, exists := resp.Header["Location"] if !exists { return n, fmt.Errorf("Response didn't contain a Location header") } loc := resp.Header.Get("Location") lurl, err := makeAbsoluteIfNecessary(loc, n.rootUri) if err != nil { return n, err } ...
go
func (n navigator) Location(resp *http.Response) (navigator, error) { _, exists := resp.Header["Location"] if !exists { return n, fmt.Errorf("Response didn't contain a Location header") } loc := resp.Header.Get("Location") lurl, err := makeAbsoluteIfNecessary(loc, n.rootUri) if err != nil { return n, err } ...
[ "func", "(", "n", "navigator", ")", "Location", "(", "resp", "*", "http", ".", "Response", ")", "(", "navigator", ",", "error", ")", "{", "_", ",", "exists", ":=", "resp", ".", "Header", "[", "\"", "\"", "]", "\n", "if", "!", "exists", "{", "retu...
// Location follows the Location header from a response. It makes the URI // absolute, if necessary.
[ "Location", "follows", "the", "Location", "header", "from", "a", "response", ".", "It", "makes", "the", "URI", "absolute", "if", "necessary", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L115-L130
145,005
jagregory/halgo
navigator.go
url
func (n navigator) url() (string, error) { url := n.rootUri for _, link := range n.path { links, err := n.getLinks(url) if err != nil { return "", fmt.Errorf("Error getting links (%s, %v): %v", url, links, err) } if _, ok := links.Items[link.rel]; !ok { return "", LinkNotFoundError{link.rel, links.Ite...
go
func (n navigator) url() (string, error) { url := n.rootUri for _, link := range n.path { links, err := n.getLinks(url) if err != nil { return "", fmt.Errorf("Error getting links (%s, %v): %v", url, links, err) } if _, ok := links.Items[link.rel]; !ok { return "", LinkNotFoundError{link.rel, links.Ite...
[ "func", "(", "n", "navigator", ")", "url", "(", ")", "(", "string", ",", "error", ")", "{", "url", ":=", "n", ".", "rootUri", "\n\n", "for", "_", ",", "link", ":=", "range", "n", ".", "path", "{", "links", ",", "err", ":=", "n", ".", "getLinks"...
// url returns the URL of the tip of the follow queue. Will follow the // usual pattern of requests.
[ "url", "returns", "the", "URL", "of", "the", "tip", "of", "the", "follow", "queue", ".", "Will", "follow", "the", "usual", "pattern", "of", "requests", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L134-L163
145,006
jagregory/halgo
navigator.go
makeAbsoluteIfNecessary
func makeAbsoluteIfNecessary(current, root string) (string, error) { currentUri, err := url.Parse(current) if err != nil { return "", err } if currentUri.IsAbs() { return current, nil } rootUri, err := url.Parse(root) if err != nil { return "", err } currentUri.Scheme = rootUri.Scheme currentUri.Host...
go
func makeAbsoluteIfNecessary(current, root string) (string, error) { currentUri, err := url.Parse(current) if err != nil { return "", err } if currentUri.IsAbs() { return current, nil } rootUri, err := url.Parse(root) if err != nil { return "", err } currentUri.Scheme = rootUri.Scheme currentUri.Host...
[ "func", "makeAbsoluteIfNecessary", "(", "current", ",", "root", "string", ")", "(", "string", ",", "error", ")", "{", "currentUri", ",", "err", ":=", "url", ".", "Parse", "(", "current", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ...
// makeAbsoluteIfNecessary takes the current url and the root url, and // will make the current URL absolute by using the root's Host, Scheme, // and credentials if current isn't already absolute.
[ "makeAbsoluteIfNecessary", "takes", "the", "current", "url", "and", "the", "root", "url", "and", "will", "make", "the", "current", "URL", "absolute", "by", "using", "the", "root", "s", "Host", "Scheme", "and", "credentials", "if", "current", "isn", "t", "alr...
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L168-L188
145,007
jagregory/halgo
navigator.go
PostForm
func (n navigator) PostForm(data url.Values) (*http.Response, error) { url, err := n.url() if err != nil { return nil, err } req, err := newHalRequest("PATCH", url, strings.NewReader(data.Encode())) if err != nil { return nil, err } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") retu...
go
func (n navigator) PostForm(data url.Values) (*http.Response, error) { url, err := n.url() if err != nil { return nil, err } req, err := newHalRequest("PATCH", url, strings.NewReader(data.Encode())) if err != nil { return nil, err } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") retu...
[ "func", "(", "n", "navigator", ")", "PostForm", "(", "data", "url", ".", "Values", ")", "(", "*", "http", ".", "Response", ",", "error", ")", "{", "url", ",", "err", ":=", "n", ".", "url", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return"...
// PostForm performs a POST request on the tip of the follow queue with // the given form data. // // See GET for a note on how the navigator executes requests.
[ "PostForm", "performs", "a", "POST", "request", "on", "the", "tip", "of", "the", "follow", "queue", "with", "the", "given", "form", "data", ".", "See", "GET", "for", "a", "note", "on", "how", "the", "navigator", "executes", "requests", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L231-L245
145,008
jagregory/halgo
navigator.go
Patch
func (n navigator) Patch(bodyType string, body io.Reader) (*http.Response, error) { url, err := n.url() if err != nil { return nil, err } req, err := newHalRequest("PATCH", url, body) if err != nil { return nil, err } req.Header.Add("Content-Type", bodyType) return n.HttpClient.Do(req) }
go
func (n navigator) Patch(bodyType string, body io.Reader) (*http.Response, error) { url, err := n.url() if err != nil { return nil, err } req, err := newHalRequest("PATCH", url, body) if err != nil { return nil, err } req.Header.Add("Content-Type", bodyType) return n.HttpClient.Do(req) }
[ "func", "(", "n", "navigator", ")", "Patch", "(", "bodyType", "string", ",", "body", "io", ".", "Reader", ")", "(", "*", "http", ".", "Response", ",", "error", ")", "{", "url", ",", "err", ":=", "n", ".", "url", "(", ")", "\n", "if", "err", "!=...
// Patch parforms a PATCH request on the tip of the follow queue with the // given bodyType and body content. // // See GET for a note on how the navigator executes requests.
[ "Patch", "parforms", "a", "PATCH", "request", "on", "the", "tip", "of", "the", "follow", "queue", "with", "the", "given", "bodyType", "and", "body", "content", ".", "See", "GET", "for", "a", "note", "on", "how", "the", "navigator", "executes", "requests", ...
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L251-L265
145,009
jagregory/halgo
navigator.go
Delete
func (n navigator) Delete() (*http.Response, error) { url, err := n.url() if err != nil { return nil, err } req, err := newHalRequest("DELETE", url, nil) if err != nil { return nil, err } return n.HttpClient.Do(req) }
go
func (n navigator) Delete() (*http.Response, error) { url, err := n.url() if err != nil { return nil, err } req, err := newHalRequest("DELETE", url, nil) if err != nil { return nil, err } return n.HttpClient.Do(req) }
[ "func", "(", "n", "navigator", ")", "Delete", "(", ")", "(", "*", "http", ".", "Response", ",", "error", ")", "{", "url", ",", "err", ":=", "n", ".", "url", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}"...
// Delete performs a DELETE request on the tip of the follow queue. // // See GET for a note on how the navigator executes requests.
[ "Delete", "performs", "a", "DELETE", "request", "on", "the", "tip", "of", "the", "follow", "queue", ".", "See", "GET", "for", "a", "note", "on", "how", "the", "navigator", "executes", "requests", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L290-L302
145,010
jagregory/halgo
navigator.go
Unmarshal
func (n navigator) Unmarshal(v interface{}) error { res, err := n.Get() if err != nil { return err } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { return err } return json.Unmarshal(body, &v) }
go
func (n navigator) Unmarshal(v interface{}) error { res, err := n.Get() if err != nil { return err } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { return err } return json.Unmarshal(body, &v) }
[ "func", "(", "n", "navigator", ")", "Unmarshal", "(", "v", "interface", "{", "}", ")", "error", "{", "res", ",", "err", ":=", "n", ".", "Get", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "res", ".",...
// Unmarshal is a shorthand for Get followed by json.Unmarshal. Handles // closing the response body and unmarshalling the body.
[ "Unmarshal", "is", "a", "shorthand", "for", "Get", "followed", "by", "json", ".", "Unmarshal", ".", "Handles", "closing", "the", "response", "body", "and", "unmarshalling", "the", "body", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L306-L319
145,011
jagregory/halgo
navigator.go
getLinks
func (n navigator) getLinks(uri string) (Links, error) { req, err := newHalRequest("GET", uri, nil) if err != nil { return Links{}, err } res, err := n.HttpClient.Do(req) if err != nil { return Links{}, err } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { return Links{}, e...
go
func (n navigator) getLinks(uri string) (Links, error) { req, err := newHalRequest("GET", uri, nil) if err != nil { return Links{}, err } res, err := n.HttpClient.Do(req) if err != nil { return Links{}, err } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { return Links{}, e...
[ "func", "(", "n", "navigator", ")", "getLinks", "(", "uri", "string", ")", "(", "Links", ",", "error", ")", "{", "req", ",", "err", ":=", "newHalRequest", "(", "\"", "\"", ",", "uri", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return"...
// getLinks does a GET on a particular URL and try to deserialise it into // a HAL links collection.
[ "getLinks", "does", "a", "GET", "on", "a", "particular", "URL", "and", "try", "to", "deserialise", "it", "into", "a", "HAL", "links", "collection", "." ]
d1d6fd6cbc6ff4df35f82b03bf93fdade591985d
https://github.com/jagregory/halgo/blob/d1d6fd6cbc6ff4df35f82b03bf93fdade591985d/navigator.go#L334-L358
145,012
ian-kent/goose
goose.go
NewEventStream
func NewEventStream() *EventStream { return &EventStream{ mutex: new(sync.Mutex), receivers: make(map[net.Conn]*EventReceiver), } }
go
func NewEventStream() *EventStream { return &EventStream{ mutex: new(sync.Mutex), receivers: make(map[net.Conn]*EventReceiver), } }
[ "func", "NewEventStream", "(", ")", "*", "EventStream", "{", "return", "&", "EventStream", "{", "mutex", ":", "new", "(", "sync", ".", "Mutex", ")", ",", "receivers", ":", "make", "(", "map", "[", "net", ".", "Conn", "]", "*", "EventReceiver", ")", "...
// NewEventStream creates a new event stream
[ "NewEventStream", "creates", "a", "new", "event", "stream" ]
c3541ea826ad9e0f8a4a8c15ca831e8b0adde58c
https://github.com/ian-kent/goose/blob/c3541ea826ad9e0f8a4a8c15ca831e8b0adde58c/goose.go#L26-L31
145,013
ian-kent/goose
goose.go
Notify
func (es *EventStream) Notify(event string, bytes []byte) { // TODO reader? lines := strings.Split(string(bytes), "\n") data := "" for _, l := range lines { data += event + ": " + l + "\n" } sz := len(data) + 1 size := fmt.Sprintf("%X", sz) for _, er := range es.receivers { go er.send(size, data) } }
go
func (es *EventStream) Notify(event string, bytes []byte) { // TODO reader? lines := strings.Split(string(bytes), "\n") data := "" for _, l := range lines { data += event + ": " + l + "\n" } sz := len(data) + 1 size := fmt.Sprintf("%X", sz) for _, er := range es.receivers { go er.send(size, data) } }
[ "func", "(", "es", "*", "EventStream", ")", "Notify", "(", "event", "string", ",", "bytes", "[", "]", "byte", ")", "{", "// TODO reader?", "lines", ":=", "strings", ".", "Split", "(", "string", "(", "bytes", ")", ",", "\"", "\\n", "\"", ")", "\n\n", ...
// Notify sends the event to all event stream receivers
[ "Notify", "sends", "the", "event", "to", "all", "event", "stream", "receivers" ]
c3541ea826ad9e0f8a4a8c15ca831e8b0adde58c
https://github.com/ian-kent/goose/blob/c3541ea826ad9e0f8a4a8c15ca831e8b0adde58c/goose.go#L41-L57
145,014
ian-kent/goose
goose.go
AddReceiver
func (es *EventStream) AddReceiver(w http.ResponseWriter) (*EventReceiver, error) { w.Header().Set("Content-Type", "text/event-stream") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Connection", "keep-alive") w.WriteHeader(200) hj, ok := w.(http.Hijacker) if !ok { return nil, ErrUnableToHijackRe...
go
func (es *EventStream) AddReceiver(w http.ResponseWriter) (*EventReceiver, error) { w.Header().Set("Content-Type", "text/event-stream") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Connection", "keep-alive") w.WriteHeader(200) hj, ok := w.(http.Hijacker) if !ok { return nil, ErrUnableToHijackRe...
[ "func", "(", "es", "*", "EventStream", ")", "AddReceiver", "(", "w", "http", ".", "ResponseWriter", ")", "(", "*", "EventReceiver", ",", "error", ")", "{", "w", ".", "Header", "(", ")", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "w"...
// AddReceiver hijacks a http.ResponseWriter and attaches it to the event stream
[ "AddReceiver", "hijacks", "a", "http", ".", "ResponseWriter", "and", "attaches", "it", "to", "the", "event", "stream" ]
c3541ea826ad9e0f8a4a8c15ca831e8b0adde58c
https://github.com/ian-kent/goose/blob/c3541ea826ad9e0f8a4a8c15ca831e8b0adde58c/goose.go#L98-L122
145,015
aphistic/golf
log_default.go
Dbgf
func Dbgf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_DBG, format, va...) }
go
func Dbgf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_DBG, format, va...) }
[ "func", "Dbgf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_DBG", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_DBG with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_DBG", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L43-L45
145,016
aphistic/golf
log_default.go
Dbgm
func Dbgm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_DBG, format, va...) }
go
func Dbgm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_DBG, format, va...) }
[ "func", "Dbgm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_DBG", ",", "format", ",", "va", ...
// Log a message at LEVEL_DBG with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_DBG", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "th...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L50-L52
145,017
aphistic/golf
log_default.go
Infof
func Infof(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_INFO, format, va...) }
go
func Infof(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_INFO, format, va...) }
[ "func", "Infof", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_INFO", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_INFO with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_INFO", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L60-L62
145,018
aphistic/golf
log_default.go
Infom
func Infom(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_INFO, format, va...) }
go
func Infom(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_INFO, format, va...) }
[ "func", "Infom", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_INFO", ",", "format", ",", "va", ...
// Log a message at LEVEL_INFO with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_INFO", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "t...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L67-L69
145,019
aphistic/golf
log_default.go
Noticef
func Noticef(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_NOTICE, format, va...) }
go
func Noticef(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_NOTICE, format, va...) }
[ "func", "Noticef", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_NOTICE", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_NOTICE with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_NOTICE", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L77-L79
145,020
aphistic/golf
log_default.go
Noticem
func Noticem(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_NOTICE, format, va...) }
go
func Noticem(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_NOTICE, format, va...) }
[ "func", "Noticem", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_NOTICE", ",", "format", ",", "v...
// Log a message at LEVEL_NOTICE with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_NOTICE", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", ...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L84-L86
145,021
aphistic/golf
log_default.go
Warnf
func Warnf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_WARN, format, va...) }
go
func Warnf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_WARN, format, va...) }
[ "func", "Warnf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_WARN", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_WARN with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_WARN", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L94-L96
145,022
aphistic/golf
log_default.go
Warnm
func Warnm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_WARN, format, va...) }
go
func Warnm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_WARN, format, va...) }
[ "func", "Warnm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_WARN", ",", "format", ",", "va", ...
// Log a message at LEVEL_WARN with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_WARN", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "t...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L101-L103
145,023
aphistic/golf
log_default.go
Errf
func Errf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_ERR, format, va...) }
go
func Errf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_ERR, format, va...) }
[ "func", "Errf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_ERR", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_ERR with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_ERR", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L111-L113
145,024
aphistic/golf
log_default.go
Errm
func Errm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_ERR, format, va...) }
go
func Errm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_ERR, format, va...) }
[ "func", "Errm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_ERR", ",", "format", ",", "va", ...
// Log a message at LEVEL_ERR with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_ERR", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "th...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L118-L120
145,025
aphistic/golf
log_default.go
Critf
func Critf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_CRIT, format, va...) }
go
func Critf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_CRIT, format, va...) }
[ "func", "Critf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_CRIT", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_CRIT with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_CRIT", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L128-L130
145,026
aphistic/golf
log_default.go
Critm
func Critm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_CRIT, format, va...) }
go
func Critm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_CRIT, format, va...) }
[ "func", "Critm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_CRIT", ",", "format", ",", "va", ...
// Log a message at LEVEL_CRIT with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_CRIT", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "t...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L135-L137
145,027
aphistic/golf
log_default.go
Alertf
func Alertf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_ALERT, format, va...) }
go
func Alertf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_ALERT, format, va...) }
[ "func", "Alertf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_ALERT", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_ALERT with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_ALERT", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L145-L147
145,028
aphistic/golf
log_default.go
Alertm
func Alertm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_ALERT, format, va...) }
go
func Alertm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_ALERT, format, va...) }
[ "func", "Alertm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_ALERT", ",", "format", ",", "va"...
// Log a message at LEVEL_ALERT with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_ALERT", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L152-L154
145,029
aphistic/golf
log_default.go
Emergf
func Emergf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_EMERG, format, va...) }
go
func Emergf(format string, va ...interface{}) error { return logDefaultMsg(nil, LEVEL_EMERG, format, va...) }
[ "func", "Emergf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "nil", ",", "LEVEL_EMERG", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_EMERG with 'format' populated with values from 'va' on the default logger
[ "Log", "a", "message", "at", "LEVEL_EMERG", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L162-L164
145,030
aphistic/golf
log_default.go
Emergm
func Emergm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_EMERG, format, va...) }
go
func Emergm(attrs map[string]interface{}, format string, va ...interface{}) error { return logDefaultMsg(attrs, LEVEL_EMERG, format, va...) }
[ "func", "Emergm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "logDefaultMsg", "(", "attrs", ",", "LEVEL_EMERG", ",", "format", ",", "va"...
// Log a message at LEVEL_EMERG with 'format' populated with values from 'va' on the default logger. // The attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_EMERG", "with", "format", "populated", "with", "values", "from", "va", "on", "the", "default", "logger", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log_default.go#L169-L171
145,031
aphistic/golf
log.go
Dbg
func (l *Logger) Dbg(msg string) error { return l.logMsg(nil, LEVEL_DBG, msg) }
go
func (l *Logger) Dbg(msg string) error { return l.logMsg(nil, LEVEL_DBG, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Dbg", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_DBG", ",", "msg", ")", "\n", "}" ]
// Dbg logs message 'msg' at LEVEL_DBG level
[ "Dbg", "logs", "message", "msg", "at", "LEVEL_DBG", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L25-L27
145,032
aphistic/golf
log.go
Dbgf
func (l *Logger) Dbgf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_DBG, format, va...) }
go
func (l *Logger) Dbgf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_DBG, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Dbgf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_DBG", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_DBG with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_DBG", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L30-L32
145,033
aphistic/golf
log.go
Dbgm
func (l *Logger) Dbgm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_DBG, format, va...) }
go
func (l *Logger) Dbgm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_DBG, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Dbgm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", "L...
// Log a message at LEVEL_DBG with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_DBG", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", "...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L37-L39
145,034
aphistic/golf
log.go
Info
func (l *Logger) Info(msg string) error { return l.logMsg(nil, LEVEL_INFO, msg) }
go
func (l *Logger) Info(msg string) error { return l.logMsg(nil, LEVEL_INFO, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Info", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_INFO", ",", "msg", ")", "\n", "}" ]
// Log a message 'msg' at LEVEL_INFO level
[ "Log", "a", "message", "msg", "at", "LEVEL_INFO", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L42-L44
145,035
aphistic/golf
log.go
Infof
func (l *Logger) Infof(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_INFO, format, va...) }
go
func (l *Logger) Infof(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_INFO, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Infof", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_INFO", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_INFO with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_INFO", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L47-L49
145,036
aphistic/golf
log.go
Infom
func (l *Logger) Infom(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_INFO, format, va...) }
go
func (l *Logger) Infom(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_INFO, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Infom", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", "...
// Log a message at LEVEL_INFO with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_INFO", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", ...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L54-L56
145,037
aphistic/golf
log.go
Notice
func (l *Logger) Notice(msg string) error { return l.logMsg(nil, LEVEL_NOTICE, msg) }
go
func (l *Logger) Notice(msg string) error { return l.logMsg(nil, LEVEL_NOTICE, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Notice", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_NOTICE", ",", "msg", ")", "\n", "}" ]
// Log a message 'msg' at LEVEL_NOTICE level
[ "Log", "a", "message", "msg", "at", "LEVEL_NOTICE", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L59-L61
145,038
aphistic/golf
log.go
Noticef
func (l *Logger) Noticef(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_NOTICE, format, va...) }
go
func (l *Logger) Noticef(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_NOTICE, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Noticef", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_NOTICE", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_NOTICE with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_NOTICE", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L64-L66
145,039
aphistic/golf
log.go
Noticem
func (l *Logger) Noticem(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_NOTICE, format, va...) }
go
func (l *Logger) Noticem(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_NOTICE, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Noticem", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", ...
// Log a message at LEVEL_NOTICE with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_NOTICE", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", ...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L71-L73
145,040
aphistic/golf
log.go
Warn
func (l *Logger) Warn(msg string) error { return l.logMsg(nil, LEVEL_WARN, msg) }
go
func (l *Logger) Warn(msg string) error { return l.logMsg(nil, LEVEL_WARN, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Warn", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_WARN", ",", "msg", ")", "\n", "}" ]
// Log a message 'msg' at LEVEL_WARN level
[ "Log", "a", "message", "msg", "at", "LEVEL_WARN", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L76-L78
145,041
aphistic/golf
log.go
Warnf
func (l *Logger) Warnf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_WARN, format, va...) }
go
func (l *Logger) Warnf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_WARN, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Warnf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_WARN", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_WARN with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_WARN", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L81-L83
145,042
aphistic/golf
log.go
Warnm
func (l *Logger) Warnm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_WARN, format, va...) }
go
func (l *Logger) Warnm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_WARN, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Warnm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", "...
// Log a message at LEVEL_WARN with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_WARN", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", ...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L88-L90
145,043
aphistic/golf
log.go
Err
func (l *Logger) Err(msg string) error { return l.logMsg(nil, LEVEL_ERR, msg) }
go
func (l *Logger) Err(msg string) error { return l.logMsg(nil, LEVEL_ERR, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Err", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_ERR", ",", "msg", ")", "\n", "}" ]
// Log a message 'msg' at LEVEL_ERR level
[ "Log", "a", "message", "msg", "at", "LEVEL_ERR", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L93-L95
145,044
aphistic/golf
log.go
Errf
func (l *Logger) Errf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_ERR, format, va...) }
go
func (l *Logger) Errf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_ERR, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Errf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_ERR", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_ERR with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_ERR", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L98-L100
145,045
aphistic/golf
log.go
Errm
func (l *Logger) Errm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_ERR, format, va...) }
go
func (l *Logger) Errm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_ERR, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Errm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", "L...
// Log a message at LEVEL_ERR with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_ERR", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", "...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L105-L107
145,046
aphistic/golf
log.go
Crit
func (l *Logger) Crit(msg string) error { return l.logMsg(nil, LEVEL_CRIT, msg) }
go
func (l *Logger) Crit(msg string) error { return l.logMsg(nil, LEVEL_CRIT, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Crit", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_CRIT", ",", "msg", ")", "\n", "}" ]
// Log a message 'msg' at LEVEL_CRIT level
[ "Log", "a", "message", "msg", "at", "LEVEL_CRIT", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L110-L112
145,047
aphistic/golf
log.go
Critf
func (l *Logger) Critf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_CRIT, format, va...) }
go
func (l *Logger) Critf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_CRIT, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Critf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_CRIT", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_CRIT with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_CRIT", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L115-L117
145,048
aphistic/golf
log.go
Critm
func (l *Logger) Critm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_CRIT, format, va...) }
go
func (l *Logger) Critm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_CRIT, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Critm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", "...
// Log a message at LEVEL_CRIT with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_CRIT", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", ...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L122-L124
145,049
aphistic/golf
log.go
Alert
func (l *Logger) Alert(msg string) error { return l.logMsg(nil, LEVEL_ALERT, msg) }
go
func (l *Logger) Alert(msg string) error { return l.logMsg(nil, LEVEL_ALERT, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Alert", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_ALERT", ",", "msg", ")", "\n", "}" ]
// Log a message 'msg' at LEVEL_ALERT level
[ "Log", "a", "message", "msg", "at", "LEVEL_ALERT", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L127-L129
145,050
aphistic/golf
log.go
Alertf
func (l *Logger) Alertf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_ALERT, format, va...) }
go
func (l *Logger) Alertf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_ALERT, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Alertf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_ALERT", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_ALERT with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_ALERT", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L132-L134
145,051
aphistic/golf
log.go
Alertm
func (l *Logger) Alertm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_ALERT, format, va...) }
go
func (l *Logger) Alertm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_ALERT, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Alertm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", ...
// Log a message at LEVEL_ALERT with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_ALERT", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", ...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L139-L141
145,052
aphistic/golf
log.go
Emerg
func (l *Logger) Emerg(msg string) error { return l.logMsg(nil, LEVEL_EMERG, msg) }
go
func (l *Logger) Emerg(msg string) error { return l.logMsg(nil, LEVEL_EMERG, msg) }
[ "func", "(", "l", "*", "Logger", ")", "Emerg", "(", "msg", "string", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_EMERG", ",", "msg", ")", "\n", "}" ]
// Log a message 'msg' at LEVEL_EMERG level
[ "Log", "a", "message", "msg", "at", "LEVEL_EMERG", "level" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L144-L146
145,053
aphistic/golf
log.go
Emergf
func (l *Logger) Emergf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_EMERG, format, va...) }
go
func (l *Logger) Emergf(format string, va ...interface{}) error { return l.logMsg(nil, LEVEL_EMERG, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Emergf", "(", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "nil", ",", "LEVEL_EMERG", ",", "format", ",", "va", "...", ")", "\n", "}" ]
// Log a message at LEVEL_EMERG with 'format' populated with values from 'va'
[ "Log", "a", "message", "at", "LEVEL_EMERG", "with", "format", "populated", "with", "values", "from", "va" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L149-L151
145,054
aphistic/golf
log.go
Emergm
func (l *Logger) Emergm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_EMERG, format, va...) }
go
func (l *Logger) Emergm(attrs map[string]interface{}, format string, va ...interface{}) error { return l.logMsg(attrs, LEVEL_EMERG, format, va...) }
[ "func", "(", "l", "*", "Logger", ")", "Emergm", "(", "attrs", "map", "[", "string", "]", "interface", "{", "}", ",", "format", "string", ",", "va", "...", "interface", "{", "}", ")", "error", "{", "return", "l", ".", "logMsg", "(", "attrs", ",", ...
// Log a message at LEVEL_EMERG with 'format' populated with values from 'va'. The // attributes from 'attrs' will be included with the message, overriding any that may // be set at the Logger level
[ "Log", "a", "message", "at", "LEVEL_EMERG", "with", "format", "populated", "with", "values", "from", "va", ".", "The", "attributes", "from", "attrs", "will", "be", "included", "with", "the", "message", "overriding", "any", "that", "may", "be", "set", "at", ...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/log.go#L156-L158
145,055
aphistic/golf
logger.go
Clone
func (l *Logger) Clone() *Logger { newLogger, _ := l.client.NewLogger() for attrKey, attrVal := range l.attrs { newLogger.SetAttr(attrKey, attrVal) } return newLogger }
go
func (l *Logger) Clone() *Logger { newLogger, _ := l.client.NewLogger() for attrKey, attrVal := range l.attrs { newLogger.SetAttr(attrKey, attrVal) } return newLogger }
[ "func", "(", "l", "*", "Logger", ")", "Clone", "(", ")", "*", "Logger", "{", "newLogger", ",", "_", ":=", "l", ".", "client", ".", "NewLogger", "(", ")", "\n\n", "for", "attrKey", ",", "attrVal", ":=", "range", "l", ".", "attrs", "{", "newLogger", ...
// Create a new Logger with a shallow copy of the original Logger's attributes
[ "Create", "a", "new", "Logger", "with", "a", "shallow", "copy", "of", "the", "original", "Logger", "s", "attributes" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/logger.go#L29-L37
145,056
aphistic/golf
logger.go
Attr
func (l *Logger) Attr(name string) interface{} { val, ok := l.attrs[name] if !ok { return nil } return val }
go
func (l *Logger) Attr(name string) interface{} { val, ok := l.attrs[name] if !ok { return nil } return val }
[ "func", "(", "l", "*", "Logger", ")", "Attr", "(", "name", "string", ")", "interface", "{", "}", "{", "val", ",", "ok", ":=", "l", ".", "attrs", "[", "name", "]", "\n", "if", "!", "ok", "{", "return", "nil", "\n", "}", "\n", "return", "val", ...
// Retrieve the current value of the Logger level attribute named 'name'. // Returns nil if the attribute was not found
[ "Retrieve", "the", "current", "value", "of", "the", "Logger", "level", "attribute", "named", "name", ".", "Returns", "nil", "if", "the", "attribute", "was", "not", "found" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/logger.go#L41-L47
145,057
aphistic/golf
logger.go
SetAttr
func (l *Logger) SetAttr(name string, val interface{}) { l.attrs[name] = val }
go
func (l *Logger) SetAttr(name string, val interface{}) { l.attrs[name] = val }
[ "func", "(", "l", "*", "Logger", ")", "SetAttr", "(", "name", "string", ",", "val", "interface", "{", "}", ")", "{", "l", ".", "attrs", "[", "name", "]", "=", "val", "\n", "}" ]
// Set an attribute named 'name' to the value 'val' at the Logger // level of attributes
[ "Set", "an", "attribute", "named", "name", "to", "the", "value", "val", "at", "the", "Logger", "level", "of", "attributes" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/logger.go#L51-L53
145,058
giantswarm/micrologger
loggermeta/logger_meta.go
NewContext
func NewContext(ctx context.Context, v *LoggerMeta) context.Context { if v == nil { return ctx } return context.WithValue(ctx, loggerMetaKey, v) }
go
func NewContext(ctx context.Context, v *LoggerMeta) context.Context { if v == nil { return ctx } return context.WithValue(ctx, loggerMetaKey, v) }
[ "func", "NewContext", "(", "ctx", "context", ".", "Context", ",", "v", "*", "LoggerMeta", ")", "context", ".", "Context", "{", "if", "v", "==", "nil", "{", "return", "ctx", "\n", "}", "\n\n", "return", "context", ".", "WithValue", "(", "ctx", ",", "l...
// NewContext returns a new context.Context that carries value v.
[ "NewContext", "returns", "a", "new", "context", ".", "Context", "that", "carries", "value", "v", "." ]
0926d9b7c5419173936b4556411a103bdf8d5966
https://github.com/giantswarm/micrologger/blob/0926d9b7c5419173936b4556411a103bdf8d5966/loggermeta/logger_meta.go#L33-L39
145,059
giantswarm/micrologger
loggermeta/logger_meta.go
FromContext
func FromContext(ctx context.Context) (*LoggerMeta, bool) { v, ok := ctx.Value(loggerMetaKey).(*LoggerMeta) return v, ok }
go
func FromContext(ctx context.Context) (*LoggerMeta, bool) { v, ok := ctx.Value(loggerMetaKey).(*LoggerMeta) return v, ok }
[ "func", "FromContext", "(", "ctx", "context", ".", "Context", ")", "(", "*", "LoggerMeta", ",", "bool", ")", "{", "v", ",", "ok", ":=", "ctx", ".", "Value", "(", "loggerMetaKey", ")", ".", "(", "*", "LoggerMeta", ")", "\n", "return", "v", ",", "ok"...
// FromContext returns the logger struct, if any.
[ "FromContext", "returns", "the", "logger", "struct", "if", "any", "." ]
0926d9b7c5419173936b4556411a103bdf8d5966
https://github.com/giantswarm/micrologger/blob/0926d9b7c5419173936b4556411a103bdf8d5966/loggermeta/logger_meta.go#L42-L45
145,060
aphistic/golf
message.go
NewMessage
func (l *Logger) NewMessage() *Message { msg := newMessage() msg.logger = l msg.Hostname = l.client.hostname return msg }
go
func (l *Logger) NewMessage() *Message { msg := newMessage() msg.logger = l msg.Hostname = l.client.hostname return msg }
[ "func", "(", "l", "*", "Logger", ")", "NewMessage", "(", ")", "*", "Message", "{", "msg", ":=", "newMessage", "(", ")", "\n", "msg", ".", "logger", "=", "l", "\n", "msg", ".", "Hostname", "=", "l", ".", "client", ".", "hostname", "\n", "return", ...
// Create a new message associated with a Logger. When the message is sent, it // will use the attributes associated with the Logger it was created from in addition // to its own
[ "Create", "a", "new", "message", "associated", "with", "a", "Logger", ".", "When", "the", "message", "is", "sent", "it", "will", "use", "the", "attributes", "associated", "with", "the", "Logger", "it", "was", "created", "from", "in", "addition", "to", "its...
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/message.go#L36-L41
145,061
aphistic/golf
client.go
NewClientWithConfig
func NewClientWithConfig(config ClientConfig) (*Client, error) { c := &Client{ config: config, queue: make([]*Message, 0), msgChan: make(chan *Message, 500), queueCtl: make(chan int), sendCtl: make(chan int), } host, err := os.Hostname() if err != nil { return nil, err } c.hostname = host retur...
go
func NewClientWithConfig(config ClientConfig) (*Client, error) { c := &Client{ config: config, queue: make([]*Message, 0), msgChan: make(chan *Message, 500), queueCtl: make(chan int), sendCtl: make(chan int), } host, err := os.Hostname() if err != nil { return nil, err } c.hostname = host retur...
[ "func", "NewClientWithConfig", "(", "config", "ClientConfig", ")", "(", "*", "Client", ",", "error", ")", "{", "c", ":=", "&", "Client", "{", "config", ":", "config", ",", "queue", ":", "make", "(", "[", "]", "*", "Message", ",", "0", ")", ",", "ms...
// Create a new Client instance with the given ClientConfig
[ "Create", "a", "new", "Client", "instance", "with", "the", "given", "ClientConfig" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/client.go#L61-L78
145,062
aphistic/golf
client.go
Dial
func (c *Client) Dial(uri string) error { parsedUri, err := url.Parse(uri) if err != nil { return err } if !strings.Contains(parsedUri.Host, ":") { parsedUri.Host = parsedUri.Host + ":12201" } switch parsedUri.Scheme { case "udp": case "tcp": default: return errors.New("Unsupported scheme provided") }...
go
func (c *Client) Dial(uri string) error { parsedUri, err := url.Parse(uri) if err != nil { return err } if !strings.Contains(parsedUri.Host, ":") { parsedUri.Host = parsedUri.Host + ":12201" } switch parsedUri.Scheme { case "udp": case "tcp": default: return errors.New("Unsupported scheme provided") }...
[ "func", "(", "c", "*", "Client", ")", "Dial", "(", "uri", "string", ")", "error", "{", "parsedUri", ",", "err", ":=", "url", ".", "Parse", "(", "uri", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "!", "str...
// Connect to a GELF server at the given URI.
[ "Connect", "to", "a", "GELF", "server", "at", "the", "given", "URI", "." ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/client.go#L81-L117
145,063
aphistic/golf
client.go
Close
func (c *Client) Close() error { if c.conn == nil { // Already shut down so it doesn't need to run again return nil } // First quit the queue and wait for it to respond // that it's quit c.queueCtl <- 1 for { quitVal := <-c.queueCtl if quitVal == 2 { break } c.queueCtl <- quitVal } // Then quit...
go
func (c *Client) Close() error { if c.conn == nil { // Already shut down so it doesn't need to run again return nil } // First quit the queue and wait for it to respond // that it's quit c.queueCtl <- 1 for { quitVal := <-c.queueCtl if quitVal == 2 { break } c.queueCtl <- quitVal } // Then quit...
[ "func", "(", "c", "*", "Client", ")", "Close", "(", ")", "error", "{", "if", "c", ".", "conn", "==", "nil", "{", "// Already shut down so it doesn't need to run again", "return", "nil", "\n", "}", "\n\n", "// First quit the queue and wait for it to respond", "// tha...
// Close the connection to the server. This call will block until all the // currently queued messages for the client are sent.
[ "Close", "the", "connection", "to", "the", "server", ".", "This", "call", "will", "block", "until", "all", "the", "currently", "queued", "messages", "for", "the", "client", "are", "sent", "." ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/client.go#L121-L156
145,064
aphistic/golf
client.go
QueueMsg
func (c *Client) QueueMsg(msg *Message) error { if msg.Timestamp == nil { curTime := time.Now() msg.Timestamp = &curTime } c.msgChan <- msg return nil }
go
func (c *Client) QueueMsg(msg *Message) error { if msg.Timestamp == nil { curTime := time.Now() msg.Timestamp = &curTime } c.msgChan <- msg return nil }
[ "func", "(", "c", "*", "Client", ")", "QueueMsg", "(", "msg", "*", "Message", ")", "error", "{", "if", "msg", ".", "Timestamp", "==", "nil", "{", "curTime", ":=", "time", ".", "Now", "(", ")", "\n", "msg", ".", "Timestamp", "=", "&", "curTime", "...
// Queue the given message at the end of the message queue
[ "Queue", "the", "given", "message", "at", "the", "end", "of", "the", "message", "queue" ]
02c07f170c5a8a0300a199a10bb04a55c721c017
https://github.com/aphistic/golf/blob/02c07f170c5a8a0300a199a10bb04a55c721c017/client.go#L159-L167
145,065
mbndr/logo
logger.go
NewLogger
func NewLogger(recs ...*Receiver) *Logger { l := &Logger{ Active: true, // Every logger is active by default Receivers: recs, } return l }
go
func NewLogger(recs ...*Receiver) *Logger { l := &Logger{ Active: true, // Every logger is active by default Receivers: recs, } return l }
[ "func", "NewLogger", "(", "recs", "...", "*", "Receiver", ")", "*", "Logger", "{", "l", ":=", "&", "Logger", "{", "Active", ":", "true", ",", "// Every logger is active by default", "Receivers", ":", "recs", ",", "}", "\n", "return", "l", "\n", "}" ]
// NewLogger returns a new Logger filled with given Receivers
[ "NewLogger", "returns", "a", "new", "Logger", "filled", "with", "given", "Receivers" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L16-L22
145,066
mbndr/logo
logger.go
NewSimpleLogger
func NewSimpleLogger(w io.Writer, lvl Level, prefix string, color bool) *Logger { l := &Logger{} r := NewReceiver(w, prefix) r.Color = color r.Level = lvl l.Receivers = []*Receiver{r} l.Active = true return l }
go
func NewSimpleLogger(w io.Writer, lvl Level, prefix string, color bool) *Logger { l := &Logger{} r := NewReceiver(w, prefix) r.Color = color r.Level = lvl l.Receivers = []*Receiver{r} l.Active = true return l }
[ "func", "NewSimpleLogger", "(", "w", "io", ".", "Writer", ",", "lvl", "Level", ",", "prefix", "string", ",", "color", "bool", ")", "*", "Logger", "{", "l", ":=", "&", "Logger", "{", "}", "\n", "r", ":=", "NewReceiver", "(", "w", ",", "prefix", ")",...
// NewSimpleLogger returns a logger with one simple Receiver
[ "NewSimpleLogger", "returns", "a", "logger", "with", "one", "simple", "Receiver" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L25-L33
145,067
mbndr/logo
logger.go
SetLevel
func (l *Logger) SetLevel(lvl Level) { for _, r := range l.Receivers { r.Level = lvl } }
go
func (l *Logger) SetLevel(lvl Level) { for _, r := range l.Receivers { r.Level = lvl } }
[ "func", "(", "l", "*", "Logger", ")", "SetLevel", "(", "lvl", "Level", ")", "{", "for", "_", ",", "r", ":=", "range", "l", ".", "Receivers", "{", "r", ".", "Level", "=", "lvl", "\n", "}", "\n", "}" ]
// SetLevel sets the log level of ALL receivers
[ "SetLevel", "sets", "the", "log", "level", "of", "ALL", "receivers" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L36-L40
145,068
mbndr/logo
logger.go
SetPrefix
func (l *Logger) SetPrefix(prefix string) { for _, r := range l.Receivers { r.SetPrefix(prefix) } }
go
func (l *Logger) SetPrefix(prefix string) { for _, r := range l.Receivers { r.SetPrefix(prefix) } }
[ "func", "(", "l", "*", "Logger", ")", "SetPrefix", "(", "prefix", "string", ")", "{", "for", "_", ",", "r", ":=", "range", "l", ".", "Receivers", "{", "r", ".", "SetPrefix", "(", "prefix", ")", "\n", "}", "\n", "}" ]
// SetPrefix sets the prefix of ALL receivers
[ "SetPrefix", "sets", "the", "prefix", "of", "ALL", "receivers" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L43-L47
145,069
mbndr/logo
logger.go
logAll
func (l *Logger) logAll(opt *levelOptions, s string) { // Skip everything if logger is disabled if !l.Active { return } // Log to all receivers for _, r := range l.Receivers { r.log(opt, s) } }
go
func (l *Logger) logAll(opt *levelOptions, s string) { // Skip everything if logger is disabled if !l.Active { return } // Log to all receivers for _, r := range l.Receivers { r.log(opt, s) } }
[ "func", "(", "l", "*", "Logger", ")", "logAll", "(", "opt", "*", "levelOptions", ",", "s", "string", ")", "{", "// Skip everything if logger is disabled", "if", "!", "l", ".", "Active", "{", "return", "\n", "}", "\n", "// Log to all receivers", "for", "_", ...
// Write to all Receivers
[ "Write", "to", "all", "Receivers" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L50-L59
145,070
mbndr/logo
logger.go
Debug
func (l *Logger) Debug(a ...interface{}) { l.logAll(optDebug, fmt.Sprint(a...)) }
go
func (l *Logger) Debug(a ...interface{}) { l.logAll(optDebug, fmt.Sprint(a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Debug", "(", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optDebug", ",", "fmt", ".", "Sprint", "(", "a", "...", ")", ")", "\n", "}" ]
// Debug logs arguments
[ "Debug", "logs", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L62-L64
145,071
mbndr/logo
logger.go
Info
func (l *Logger) Info(a ...interface{}) { l.logAll(optInfo, fmt.Sprint(a...)) }
go
func (l *Logger) Info(a ...interface{}) { l.logAll(optInfo, fmt.Sprint(a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Info", "(", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optInfo", ",", "fmt", ".", "Sprint", "(", "a", "...", ")", ")", "\n", "}" ]
// Info logs arguments
[ "Info", "logs", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L67-L69
145,072
mbndr/logo
logger.go
Warn
func (l *Logger) Warn(a ...interface{}) { l.logAll(optWarn, fmt.Sprint(a...)) }
go
func (l *Logger) Warn(a ...interface{}) { l.logAll(optWarn, fmt.Sprint(a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Warn", "(", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optWarn", ",", "fmt", ".", "Sprint", "(", "a", "...", ")", ")", "\n", "}" ]
// Warn logs arguments
[ "Warn", "logs", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L72-L74
145,073
mbndr/logo
logger.go
Error
func (l *Logger) Error(a ...interface{}) { l.logAll(optError, fmt.Sprint(a...)) }
go
func (l *Logger) Error(a ...interface{}) { l.logAll(optError, fmt.Sprint(a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Error", "(", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optError", ",", "fmt", ".", "Sprint", "(", "a", "...", ")", ")", "\n", "}" ]
// Error logs arguments
[ "Error", "logs", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L77-L79
145,074
mbndr/logo
logger.go
Fatal
func (l *Logger) Fatal(a ...interface{}) { l.logAll(optFatal, fmt.Sprint(a...)) os.Exit(1) }
go
func (l *Logger) Fatal(a ...interface{}) { l.logAll(optFatal, fmt.Sprint(a...)) os.Exit(1) }
[ "func", "(", "l", "*", "Logger", ")", "Fatal", "(", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optFatal", ",", "fmt", ".", "Sprint", "(", "a", "...", ")", ")", "\n", "os", ".", "Exit", "(", "1", ")", "\n", "}" ]
// Fatal logs arguments
[ "Fatal", "logs", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L82-L85
145,075
mbndr/logo
logger.go
Debugf
func (l *Logger) Debugf(format string, a ...interface{}) { l.logAll(optDebug, fmt.Sprintf(format, a...)) }
go
func (l *Logger) Debugf(format string, a ...interface{}) { l.logAll(optDebug, fmt.Sprintf(format, a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Debugf", "(", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optDebug", ",", "fmt", ".", "Sprintf", "(", "format", ",", "a", "...", ")", ")", "\n", "}" ]
// Debugf logs formated arguments
[ "Debugf", "logs", "formated", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L88-L90
145,076
mbndr/logo
logger.go
Infof
func (l *Logger) Infof(format string, a ...interface{}) { l.logAll(optInfo, fmt.Sprintf(format, a...)) }
go
func (l *Logger) Infof(format string, a ...interface{}) { l.logAll(optInfo, fmt.Sprintf(format, a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Infof", "(", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optInfo", ",", "fmt", ".", "Sprintf", "(", "format", ",", "a", "...", ")", ")", "\n", "}" ]
// Infof logs formated arguments
[ "Infof", "logs", "formated", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L93-L95
145,077
mbndr/logo
logger.go
Warnf
func (l *Logger) Warnf(format string, a ...interface{}) { l.logAll(optWarn, fmt.Sprintf(format, a...)) }
go
func (l *Logger) Warnf(format string, a ...interface{}) { l.logAll(optWarn, fmt.Sprintf(format, a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Warnf", "(", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optWarn", ",", "fmt", ".", "Sprintf", "(", "format", ",", "a", "...", ")", ")", "\n", "}" ]
// Warnf logs formated arguments
[ "Warnf", "logs", "formated", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L98-L100
145,078
mbndr/logo
logger.go
Errorf
func (l *Logger) Errorf(format string, a ...interface{}) { l.logAll(optError, fmt.Sprintf(format, a...)) }
go
func (l *Logger) Errorf(format string, a ...interface{}) { l.logAll(optError, fmt.Sprintf(format, a...)) }
[ "func", "(", "l", "*", "Logger", ")", "Errorf", "(", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optError", ",", "fmt", ".", "Sprintf", "(", "format", ",", "a", "...", ")", ")", "\n", "}" ]
// Errorf logs formated arguments
[ "Errorf", "logs", "formated", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L103-L105
145,079
mbndr/logo
logger.go
Fatalf
func (l *Logger) Fatalf(format string, a ...interface{}) { l.logAll(optFatal, fmt.Sprintf(format, a...)) os.Exit(1) }
go
func (l *Logger) Fatalf(format string, a ...interface{}) { l.logAll(optFatal, fmt.Sprintf(format, a...)) os.Exit(1) }
[ "func", "(", "l", "*", "Logger", ")", "Fatalf", "(", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "{", "l", ".", "logAll", "(", "optFatal", ",", "fmt", ".", "Sprintf", "(", "format", ",", "a", "...", ")", ")", "\n", "os", "....
// Fatalf logs formated arguments
[ "Fatalf", "logs", "formated", "arguments" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L108-L111
145,080
mbndr/logo
logger.go
Open
func Open(path string) (*os.File, error) { return os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0660) }
go
func Open(path string) (*os.File, error) { return os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0660) }
[ "func", "Open", "(", "path", "string", ")", "(", "*", "os", ".", "File", ",", "error", ")", "{", "return", "os", ".", "OpenFile", "(", "path", ",", "os", ".", "O_RDWR", "|", "os", ".", "O_CREATE", "|", "os", ".", "O_APPEND", ",", "0660", ")", "...
// Open is a short function to open a file with needed options
[ "Open", "is", "a", "short", "function", "to", "open", "a", "file", "with", "needed", "options" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/logger.go#L114-L116
145,081
mbndr/logo
receiver.go
SetPrefix
func (r *Receiver) SetPrefix(prefix string) { if prefix != "" && !strings.HasSuffix(prefix, " ") { prefix += " " } r.logger.SetPrefix(prefix) }
go
func (r *Receiver) SetPrefix(prefix string) { if prefix != "" && !strings.HasSuffix(prefix, " ") { prefix += " " } r.logger.SetPrefix(prefix) }
[ "func", "(", "r", "*", "Receiver", ")", "SetPrefix", "(", "prefix", "string", ")", "{", "if", "prefix", "!=", "\"", "\"", "&&", "!", "strings", ".", "HasSuffix", "(", "prefix", ",", "\"", "\"", ")", "{", "prefix", "+=", "\"", "\"", "\n", "}", "\n...
// SetPrefix sets the prefix of the logger. // If a prefix is set and no trailing space is written, write one
[ "SetPrefix", "sets", "the", "prefix", "of", "the", "logger", ".", "If", "a", "prefix", "is", "set", "and", "no", "trailing", "space", "is", "written", "write", "one" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/receiver.go#L23-L28
145,082
mbndr/logo
receiver.go
log
func (r *Receiver) log(opt *levelOptions, s string) { // Don't do anything if not wanted if !r.Active || opt.Level < r.Level { return } // Pre- and suffix prefix := "" suffix := "\n" // Add colors if wanted if r.Color { prefix += fmt.Sprintf("\x1b[0;%sm", strconv.Itoa(opt.Color)) suffix = "\x1b[0m" + su...
go
func (r *Receiver) log(opt *levelOptions, s string) { // Don't do anything if not wanted if !r.Active || opt.Level < r.Level { return } // Pre- and suffix prefix := "" suffix := "\n" // Add colors if wanted if r.Color { prefix += fmt.Sprintf("\x1b[0;%sm", strconv.Itoa(opt.Color)) suffix = "\x1b[0m" + su...
[ "func", "(", "r", "*", "Receiver", ")", "log", "(", "opt", "*", "levelOptions", ",", "s", "string", ")", "{", "// Don't do anything if not wanted", "if", "!", "r", ".", "Active", "||", "opt", ".", "Level", "<", "r", ".", "Level", "{", "return", "\n", ...
// Logs to the logger
[ "Logs", "to", "the", "logger" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/receiver.go#L31-L49
145,083
mbndr/logo
receiver.go
NewReceiver
func NewReceiver(w io.Writer, prefix string) *Receiver { logger := log.New(w, "", log.LstdFlags) r := &Receiver{ logger: logger, } // Default options r.Active = true r.Level = INFO r.Format = "[%s] ▶ %s" r.SetPrefix(prefix) return r }
go
func NewReceiver(w io.Writer, prefix string) *Receiver { logger := log.New(w, "", log.LstdFlags) r := &Receiver{ logger: logger, } // Default options r.Active = true r.Level = INFO r.Format = "[%s] ▶ %s" r.SetPrefix(prefix) return r }
[ "func", "NewReceiver", "(", "w", "io", ".", "Writer", ",", "prefix", "string", ")", "*", "Receiver", "{", "logger", ":=", "log", ".", "New", "(", "w", ",", "\"", "\"", ",", "log", ".", "LstdFlags", ")", "\n", "r", ":=", "&", "Receiver", "{", "log...
// NewReceiver returns a new Receiver object with a given Writer // and sets default values
[ "NewReceiver", "returns", "a", "new", "Receiver", "object", "with", "a", "given", "Writer", "and", "sets", "default", "values" ]
06195deb9d538fc3057ce7cc6d61c4776996ebad
https://github.com/mbndr/logo/blob/06195deb9d538fc3057ce7cc6d61c4776996ebad/receiver.go#L53-L68
145,084
coreos/go-omaha
omaha/client/error.go
expNetBackoff
func expNetBackoff(f func() error) error { var ( backoff = backoffStart tries = backoffTries ) for { err := f() tries-- if tries <= 0 { return err } if neterr, ok := err.(net.Error); !ok || !neterr.Temporary() { return err } FuzzySleep(backoff, backoff) backoff *= 2 } }
go
func expNetBackoff(f func() error) error { var ( backoff = backoffStart tries = backoffTries ) for { err := f() tries-- if tries <= 0 { return err } if neterr, ok := err.(net.Error); !ok || !neterr.Temporary() { return err } FuzzySleep(backoff, backoff) backoff *= 2 } }
[ "func", "expNetBackoff", "(", "f", "func", "(", ")", "error", ")", "error", "{", "var", "(", "backoff", "=", "backoffStart", "\n", "tries", "=", "backoffTries", "\n", ")", "\n", "for", "{", "err", ":=", "f", "(", ")", "\n", "tries", "--", "\n", "if...
// retries and exponentially backs off for temporary network errors
[ "retries", "and", "exponentially", "backs", "off", "for", "temporary", "network", "errors" ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/error.go#L44-L61
145,085
coreos/go-omaha
omaha/client/error.go
isUnexpectedEOF
func isUnexpectedEOF(err error) bool { if xerr, ok := err.(*xml.SyntaxError); ok { return xerr.Msg == "unexpected EOF" } return err == io.ErrUnexpectedEOF }
go
func isUnexpectedEOF(err error) bool { if xerr, ok := err.(*xml.SyntaxError); ok { return xerr.Msg == "unexpected EOF" } return err == io.ErrUnexpectedEOF }
[ "func", "isUnexpectedEOF", "(", "err", "error", ")", "bool", "{", "if", "xerr", ",", "ok", ":=", "err", ".", "(", "*", "xml", ".", "SyntaxError", ")", ";", "ok", "{", "return", "xerr", ".", "Msg", "==", "\"", "\"", "\n", "}", "\n", "return", "err...
// xml doesn't return the standard io.ErrUnexpectedEOF so check for both.
[ "xml", "doesn", "t", "return", "the", "standard", "io", ".", "ErrUnexpectedEOF", "so", "check", "for", "both", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/error.go#L64-L69
145,086
coreos/go-omaha
omaha/client/fuzzytime.go
FuzzyAfter
func FuzzyAfter(d, fuzz time.Duration) <-chan time.Time { return time.After(FuzzyDuration(d, fuzz)) }
go
func FuzzyAfter(d, fuzz time.Duration) <-chan time.Time { return time.After(FuzzyDuration(d, fuzz)) }
[ "func", "FuzzyAfter", "(", "d", ",", "fuzz", "time", ".", "Duration", ")", "<-", "chan", "time", ".", "Time", "{", "return", "time", ".", "After", "(", "FuzzyDuration", "(", "d", ",", "fuzz", ")", ")", "\n", "}" ]
// FuzzyAfter waits for the fuzzy duration to elapse and then sends the // current time on the returned channel. See FuzzyDuration.
[ "FuzzyAfter", "waits", "for", "the", "fuzzy", "duration", "to", "elapse", "and", "then", "sends", "the", "current", "time", "on", "the", "returned", "channel", ".", "See", "FuzzyDuration", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/fuzzytime.go#L45-L47
145,087
coreos/go-omaha
omaha/client/fuzzytime.go
FuzzySleep
func FuzzySleep(d, fuzz time.Duration) { time.Sleep(FuzzyDuration(d, fuzz)) }
go
func FuzzySleep(d, fuzz time.Duration) { time.Sleep(FuzzyDuration(d, fuzz)) }
[ "func", "FuzzySleep", "(", "d", ",", "fuzz", "time", ".", "Duration", ")", "{", "time", ".", "Sleep", "(", "FuzzyDuration", "(", "d", ",", "fuzz", ")", ")", "\n", "}" ]
// FuzzySleep pauses the current goroutine for the fuzzy duration d. // See FuzzyDuration.
[ "FuzzySleep", "pauses", "the", "current", "goroutine", "for", "the", "fuzzy", "duration", "d", ".", "See", "FuzzyDuration", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/fuzzytime.go#L51-L53
145,088
coreos/go-omaha
omaha/trivial_server.go
AddPackage
func (ts *TrivialServer) AddPackage(file, name string) error { // name may not include any path components if path.Base(name) != name || name[0] == '.' { return fmt.Errorf("invalid package name %q", name) } pkg, err := ts.tu.Manifest.AddPackageFromPath(file) if err != nil { return err } pkg.Name = name //...
go
func (ts *TrivialServer) AddPackage(file, name string) error { // name may not include any path components if path.Base(name) != name || name[0] == '.' { return fmt.Errorf("invalid package name %q", name) } pkg, err := ts.tu.Manifest.AddPackageFromPath(file) if err != nil { return err } pkg.Name = name //...
[ "func", "(", "ts", "*", "TrivialServer", ")", "AddPackage", "(", "file", ",", "name", "string", ")", "error", "{", "// name may not include any path components", "if", "path", ".", "Base", "(", "name", ")", "!=", "name", "||", "name", "[", "0", "]", "==", ...
// AddPackage adds a new file to the update response. // file is the local filesystem path, name is the final URL component.
[ "AddPackage", "adds", "a", "new", "file", "to", "the", "update", "response", ".", "file", "is", "the", "local", "filesystem", "path", "name", "is", "the", "final", "URL", "component", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/trivial_server.go#L95-L117
145,089
coreos/go-omaha
omaha/trivial_server.go
SetVersion
func (ts *TrivialServer) SetVersion(version string) { ts.tu.Manifest.Version = version }
go
func (ts *TrivialServer) SetVersion(version string) { ts.tu.Manifest.Version = version }
[ "func", "(", "ts", "*", "TrivialServer", ")", "SetVersion", "(", "version", "string", ")", "{", "ts", ".", "tu", ".", "Manifest", ".", "Version", "=", "version", "\n", "}" ]
// SetVersion sets the manifest's version with the provided one.
[ "SetVersion", "sets", "the", "manifest", "s", "version", "with", "the", "provided", "one", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/trivial_server.go#L120-L122
145,090
coreos/go-omaha
omaha/parse.go
checkContentType
func checkContentType(contentType string) error { if contentType == "" { return nil } mType, mParams, err := mime.ParseMediaType(contentType) if err != nil { return err } if mType != "text/xml" && mType != "application/xml" { return fmt.Errorf("unsupported content type %q", mType) } charset, _ := mPara...
go
func checkContentType(contentType string) error { if contentType == "" { return nil } mType, mParams, err := mime.ParseMediaType(contentType) if err != nil { return err } if mType != "text/xml" && mType != "application/xml" { return fmt.Errorf("unsupported content type %q", mType) } charset, _ := mPara...
[ "func", "checkContentType", "(", "contentType", "string", ")", "error", "{", "if", "contentType", "==", "\"", "\"", "{", "return", "nil", "\n", "}", "\n\n", "mType", ",", "mParams", ",", "err", ":=", "mime", ".", "ParseMediaType", "(", "contentType", ")", ...
// checkContentType verifies the HTTP Content-Type header properly // declares the document is XML and UTF-8. Blank is assumed OK.
[ "checkContentType", "verifies", "the", "HTTP", "Content", "-", "Type", "header", "properly", "declares", "the", "document", "is", "XML", "and", "UTF", "-", "8", ".", "Blank", "is", "assumed", "OK", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/parse.go#L27-L47
145,091
coreos/go-omaha
omaha/parse.go
parseReqOrResp
func parseReqOrResp(r io.Reader, v interface{}) error { decoder := xml.NewDecoder(r) if err := decoder.Decode(v); err != nil { return err } var protocol string switch v := v.(type) { case *Request: protocol = v.Protocol case *Response: protocol = v.Protocol default: panic(fmt.Errorf("unexpected type %T...
go
func parseReqOrResp(r io.Reader, v interface{}) error { decoder := xml.NewDecoder(r) if err := decoder.Decode(v); err != nil { return err } var protocol string switch v := v.(type) { case *Request: protocol = v.Protocol case *Response: protocol = v.Protocol default: panic(fmt.Errorf("unexpected type %T...
[ "func", "parseReqOrResp", "(", "r", "io", ".", "Reader", ",", "v", "interface", "{", "}", ")", "error", "{", "decoder", ":=", "xml", ".", "NewDecoder", "(", "r", ")", "\n", "if", "err", ":=", "decoder", ".", "Decode", "(", "v", ")", ";", "err", "...
// parseReqOrResp parses Request and Response objects.
[ "parseReqOrResp", "parses", "Request", "and", "Response", "objects", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/parse.go#L50-L71
145,092
coreos/go-omaha
omaha/client/client.go
New
func New(serverURL, userID string) (*Client, error) { if userID == "" { return nil, errors.New("omaha: empty user identifier") } c := &Client{ apiClient: newHTTPClient(), clientVersion: defaultClientVersion, userID: userID, sessionID: uuid.NewV4().String(), apps: make(map[string]...
go
func New(serverURL, userID string) (*Client, error) { if userID == "" { return nil, errors.New("omaha: empty user identifier") } c := &Client{ apiClient: newHTTPClient(), clientVersion: defaultClientVersion, userID: userID, sessionID: uuid.NewV4().String(), apps: make(map[string]...
[ "func", "New", "(", "serverURL", ",", "userID", "string", ")", "(", "*", "Client", ",", "error", ")", "{", "if", "userID", "==", "\"", "\"", "{", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "c", ":=", "&...
// New creates an omaha client for updating one or more applications. // userID must be a persistent unique identifier of this update client.
[ "New", "creates", "an", "omaha", "client", "for", "updating", "one", "or", "more", "applications", ".", "userID", "must", "be", "a", "persistent", "unique", "identifier", "of", "this", "update", "client", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L61-L79
145,093
coreos/go-omaha
omaha/client/client.go
NextPing
func (c *Client) NextPing() <-chan time.Time { d := pingDelay if c.sentPing { d = pingInterval } return FuzzyAfter(d, pingFuzz) }
go
func (c *Client) NextPing() <-chan time.Time { d := pingDelay if c.sentPing { d = pingInterval } return FuzzyAfter(d, pingFuzz) }
[ "func", "(", "c", "*", "Client", ")", "NextPing", "(", ")", "<-", "chan", "time", ".", "Time", "{", "d", ":=", "pingDelay", "\n", "if", "c", ".", "sentPing", "{", "d", "=", "pingInterval", "\n", "}", "\n", "return", "FuzzyAfter", "(", "d", ",", "...
// NextPing returns a timer channel that will fire when the next update // check or ping should be sent.
[ "NextPing", "returns", "a", "timer", "channel", "that", "will", "fire", "when", "the", "next", "update", "check", "or", "ping", "should", "be", "sent", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L110-L116
145,094
coreos/go-omaha
omaha/client/client.go
AppClient
func (c *Client) AppClient(appID string) (*AppClient, error) { if app, ok := c.apps[appID]; ok { return app, nil } return nil, fmt.Errorf("omaha: missing app client %q", appID) }
go
func (c *Client) AppClient(appID string) (*AppClient, error) { if app, ok := c.apps[appID]; ok { return app, nil } return nil, fmt.Errorf("omaha: missing app client %q", appID) }
[ "func", "(", "c", "*", "Client", ")", "AppClient", "(", "appID", "string", ")", "(", "*", "AppClient", ",", "error", ")", "{", "if", "app", ",", "ok", ":=", "c", ".", "apps", "[", "appID", "]", ";", "ok", "{", "return", "app", ",", "nil", "\n",...
// AppClient gets the application client for the given application ID.
[ "AppClient", "gets", "the", "application", "client", "for", "the", "given", "application", "ID", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L119-L125
145,095
coreos/go-omaha
omaha/client/client.go
NewAppClient
func (c *Client) NewAppClient(appID, appVersion string) (*AppClient, error) { if _, ok := c.apps[appID]; ok { return nil, fmt.Errorf("omaha: duplicate app client %q", appID) } ac := &AppClient{ Client: c, appID: appID, } c.apps[appID] = ac return ac, nil }
go
func (c *Client) NewAppClient(appID, appVersion string) (*AppClient, error) { if _, ok := c.apps[appID]; ok { return nil, fmt.Errorf("omaha: duplicate app client %q", appID) } ac := &AppClient{ Client: c, appID: appID, } c.apps[appID] = ac return ac, nil }
[ "func", "(", "c", "*", "Client", ")", "NewAppClient", "(", "appID", ",", "appVersion", "string", ")", "(", "*", "AppClient", ",", "error", ")", "{", "if", "_", ",", "ok", ":=", "c", ".", "apps", "[", "appID", "]", ";", "ok", "{", "return", "nil",...
// NewAppClient creates a new application client.
[ "NewAppClient", "creates", "a", "new", "application", "client", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L128-L140
145,096
coreos/go-omaha
omaha/client/client.go
SetVersion
func (ac *AppClient) SetVersion(version string) error { if version == "" { return errors.New("omaha: empty application version") } ac.version = version return nil }
go
func (ac *AppClient) SetVersion(version string) error { if version == "" { return errors.New("omaha: empty application version") } ac.version = version return nil }
[ "func", "(", "ac", "*", "AppClient", ")", "SetVersion", "(", "version", "string", ")", "error", "{", "if", "version", "==", "\"", "\"", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "ac", ".", "version", "=", "versio...
// SetVersion changes the application version.
[ "SetVersion", "changes", "the", "application", "version", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L174-L181
145,097
coreos/go-omaha
omaha/client/client.go
Event
func (ac *AppClient) Event(event *omaha.EventRequest) <-chan error { errc := make(chan error, 1) url := ac.apiEndpoint req := ac.NewAppRequest() app := req.Apps[0] app.Events = append(app.Events, event) go func() { appResp, err := ac.doReq(url, req) if err != nil { errc <- err return } // BUG: Cor...
go
func (ac *AppClient) Event(event *omaha.EventRequest) <-chan error { errc := make(chan error, 1) url := ac.apiEndpoint req := ac.NewAppRequest() app := req.Apps[0] app.Events = append(app.Events, event) go func() { appResp, err := ac.doReq(url, req) if err != nil { errc <- err return } // BUG: Cor...
[ "func", "(", "ac", "*", "AppClient", ")", "Event", "(", "event", "*", "omaha", ".", "EventRequest", ")", "<-", "chan", "error", "{", "errc", ":=", "make", "(", "chan", "error", ",", "1", ")", "\n", "url", ":=", "ac", ".", "apiEndpoint", "\n", "req"...
// Event asynchronously sends the given omaha event. // Reading the error channel is optional.
[ "Event", "asynchronously", "sends", "the", "given", "omaha", "event", ".", "Reading", "the", "error", "channel", "is", "optional", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L271-L302
145,098
coreos/go-omaha
omaha/client/client.go
NewAppRequest
func (ac *AppClient) NewAppRequest() *omaha.Request { req := omaha.NewRequest() req.Version = ac.clientVersion req.UserID = ac.userID req.SessionID = ac.sessionID if ac.isMachine { req.IsMachine = 1 } app := req.AddApp(ac.appID, ac.version) app.Track = ac.track app.OEM = ac.oem // MachineID and BootID are...
go
func (ac *AppClient) NewAppRequest() *omaha.Request { req := omaha.NewRequest() req.Version = ac.clientVersion req.UserID = ac.userID req.SessionID = ac.sessionID if ac.isMachine { req.IsMachine = 1 } app := req.AddApp(ac.appID, ac.version) app.Track = ac.track app.OEM = ac.oem // MachineID and BootID are...
[ "func", "(", "ac", "*", "AppClient", ")", "NewAppRequest", "(", ")", "*", "omaha", ".", "Request", "{", "req", ":=", "omaha", ".", "NewRequest", "(", ")", "\n", "req", ".", "Version", "=", "ac", ".", "clientVersion", "\n", "req", ".", "UserID", "=", ...
// NewAppRequest creates a Request object containing one application.
[ "NewAppRequest", "creates", "a", "Request", "object", "containing", "one", "application", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L305-L326
145,099
coreos/go-omaha
omaha/client/client.go
SendAppRequest
func (ac *AppClient) SendAppRequest(req *omaha.Request) (*omaha.AppResponse, error) { resp, err := ac.doReq(ac.apiEndpoint, req) if _, ok := err.(omaha.AppStatus); ok { // No point to sending an error if we got a well-formed // non-ok application status in the response. } else if err, ok := err.(ErrorEvent); ok ...
go
func (ac *AppClient) SendAppRequest(req *omaha.Request) (*omaha.AppResponse, error) { resp, err := ac.doReq(ac.apiEndpoint, req) if _, ok := err.(omaha.AppStatus); ok { // No point to sending an error if we got a well-formed // non-ok application status in the response. } else if err, ok := err.(ErrorEvent); ok ...
[ "func", "(", "ac", "*", "AppClient", ")", "SendAppRequest", "(", "req", "*", "omaha", ".", "Request", ")", "(", "*", "omaha", ".", "AppResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "ac", ".", "doReq", "(", "ac", ".", "apiEndpoint", "...
// SendAppRequest sends a Request object and validates the response. // On failure an error event is automatically sent to the server.
[ "SendAppRequest", "sends", "a", "Request", "object", "and", "validates", "the", "response", ".", "On", "failure", "an", "error", "event", "is", "automatically", "sent", "to", "the", "server", "." ]
e409d983eb60842452f0fb6245137458ca45201a
https://github.com/coreos/go-omaha/blob/e409d983eb60842452f0fb6245137458ca45201a/omaha/client/client.go#L330-L341