repo stringlengths 5 67 | path stringlengths 4 218 | func_name stringlengths 0 151 | original_string stringlengths 52 373k | language stringclasses 6
values | code stringlengths 52 373k | code_tokens listlengths 10 512 | docstring stringlengths 3 47.2k | docstring_tokens listlengths 3 234 | sha stringlengths 40 40 | url stringlengths 85 339 | partition stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
TheThingsNetwork/go-utils | grpc/streambuffer/streambuffer.go | CloseRecv | func (s *Stream) CloseRecv() {
s.mu.Lock()
if s.recvBuffer != nil {
close(s.recvBuffer)
s.recvBuffer = nil
}
s.mu.Unlock()
} | go | func (s *Stream) CloseRecv() {
s.mu.Lock()
if s.recvBuffer != nil {
close(s.recvBuffer)
s.recvBuffer = nil
}
s.mu.Unlock()
} | [
"func",
"(",
"s",
"*",
"Stream",
")",
"CloseRecv",
"(",
")",
"{",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"if",
"s",
".",
"recvBuffer",
"!=",
"nil",
"{",
"close",
"(",
"s",
".",
"recvBuffer",
")",
"\n",
"s",
".",
"recvBuffer",
"=",
"nil",
... | // CloseRecv closes the receive channel | [
"CloseRecv",
"closes",
"the",
"receive",
"channel"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/streambuffer/streambuffer.go#L73-L80 | test |
TheThingsNetwork/go-utils | grpc/streambuffer/streambuffer.go | Stats | func (s *Stream) Stats() (sent, dropped uint64) {
return atomic.LoadUint64(&s.sent), atomic.LoadUint64(&s.dropped)
} | go | func (s *Stream) Stats() (sent, dropped uint64) {
return atomic.LoadUint64(&s.sent), atomic.LoadUint64(&s.dropped)
} | [
"func",
"(",
"s",
"*",
"Stream",
")",
"Stats",
"(",
")",
"(",
"sent",
",",
"dropped",
"uint64",
")",
"{",
"return",
"atomic",
".",
"LoadUint64",
"(",
"&",
"s",
".",
"sent",
")",
",",
"atomic",
".",
"LoadUint64",
"(",
"&",
"s",
".",
"dropped",
")"... | // Stats of the stream | [
"Stats",
"of",
"the",
"stream"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/streambuffer/streambuffer.go#L83-L85 | test |
TheThingsNetwork/go-utils | grpc/streambuffer/streambuffer.go | Run | func (s *Stream) Run() (err error) {
s.mu.RLock()
defer s.mu.RUnlock()
defer func() {
if err != nil {
if grpc.Code(err) == codes.Canceled {
s.log.Debug("streambuffer: context canceled")
err = context.Canceled
return
}
if grpc.Code(err) == codes.DeadlineExceeded {
s.log.Debug("streambuffer... | go | func (s *Stream) Run() (err error) {
s.mu.RLock()
defer s.mu.RUnlock()
defer func() {
if err != nil {
if grpc.Code(err) == codes.Canceled {
s.log.Debug("streambuffer: context canceled")
err = context.Canceled
return
}
if grpc.Code(err) == codes.DeadlineExceeded {
s.log.Debug("streambuffer... | [
"func",
"(",
"s",
"*",
"Stream",
")",
"Run",
"(",
")",
"(",
"err",
"error",
")",
"{",
"s",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"s",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"defer",
"func",
"(",
")",
"{",
"if",
"err",
"!=",
... | // Run the stream.
//
// This calls the underlying grpc.ClientStreams methods to send and receive messages over the stream.
// Run returns the error returned by any of those functions, or context.Canceled if the context is canceled. | [
"Run",
"the",
"stream",
".",
"This",
"calls",
"the",
"underlying",
"grpc",
".",
"ClientStreams",
"methods",
"to",
"send",
"and",
"receive",
"messages",
"over",
"the",
"stream",
".",
"Run",
"returns",
"the",
"error",
"returned",
"by",
"any",
"of",
"those",
... | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/streambuffer/streambuffer.go#L131-L201 | test |
TheThingsNetwork/go-utils | grpc/rpclog/grpc.go | ServerOptions | func ServerOptions(log ttnlog.Interface) []grpc.ServerOption {
return []grpc.ServerOption{
grpc.UnaryInterceptor(UnaryServerInterceptor(log)),
grpc.StreamInterceptor(StreamServerInterceptor(log)),
}
} | go | func ServerOptions(log ttnlog.Interface) []grpc.ServerOption {
return []grpc.ServerOption{
grpc.UnaryInterceptor(UnaryServerInterceptor(log)),
grpc.StreamInterceptor(StreamServerInterceptor(log)),
}
} | [
"func",
"ServerOptions",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"[",
"]",
"grpc",
".",
"ServerOption",
"{",
"return",
"[",
"]",
"grpc",
".",
"ServerOption",
"{",
"grpc",
".",
"UnaryInterceptor",
"(",
"UnaryServerInterceptor",
"(",
"log",
")",
")",
",... | // ServerOptions for logging RPCs | [
"ServerOptions",
"for",
"logging",
"RPCs"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/rpclog/grpc.go#L23-L28 | test |
TheThingsNetwork/go-utils | grpc/rpclog/grpc.go | ClientOptions | func ClientOptions(log ttnlog.Interface) []grpc.DialOption {
return []grpc.DialOption{
grpc.WithUnaryInterceptor(UnaryClientInterceptor(log)),
grpc.WithStreamInterceptor(StreamClientInterceptor(log)),
}
} | go | func ClientOptions(log ttnlog.Interface) []grpc.DialOption {
return []grpc.DialOption{
grpc.WithUnaryInterceptor(UnaryClientInterceptor(log)),
grpc.WithStreamInterceptor(StreamClientInterceptor(log)),
}
} | [
"func",
"ClientOptions",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"[",
"]",
"grpc",
".",
"DialOption",
"{",
"return",
"[",
"]",
"grpc",
".",
"DialOption",
"{",
"grpc",
".",
"WithUnaryInterceptor",
"(",
"UnaryClientInterceptor",
"(",
"log",
")",
")",
",... | // ClientOptions for logging RPCs | [
"ClientOptions",
"for",
"logging",
"RPCs"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/rpclog/grpc.go#L31-L36 | test |
TheThingsNetwork/go-utils | grpc/rpclog/grpc.go | UnaryServerInterceptor | func UnaryServerInterceptor(log ttnlog.Interface) grpc.UnaryServerInterceptor {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
log := getLog(log).WithField("method", info.FullMethod)
log = log.WithFields(FieldsFromIncomingCon... | go | func UnaryServerInterceptor(log ttnlog.Interface) grpc.UnaryServerInterceptor {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
log := getLog(log).WithField("method", info.FullMethod)
log = log.WithFields(FieldsFromIncomingCon... | [
"func",
"UnaryServerInterceptor",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"grpc",
".",
"UnaryServerInterceptor",
"{",
"return",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"interface",
"{",
"}",
",",
"info",
"*",
"grpc",
".",
"UnaryServer... | // UnaryServerInterceptor logs unary RPCs on the server side | [
"UnaryServerInterceptor",
"logs",
"unary",
"RPCs",
"on",
"the",
"server",
"side"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/rpclog/grpc.go#L39-L53 | test |
TheThingsNetwork/go-utils | grpc/rpclog/grpc.go | StreamServerInterceptor | func StreamServerInterceptor(log ttnlog.Interface) grpc.StreamServerInterceptor {
return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) {
log := getLog(log).WithField("method", info.FullMethod)
log = log.WithFields(FieldsFromIncomingContext(ss.Conte... | go | func StreamServerInterceptor(log ttnlog.Interface) grpc.StreamServerInterceptor {
return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) {
log := getLog(log).WithField("method", info.FullMethod)
log = log.WithFields(FieldsFromIncomingContext(ss.Conte... | [
"func",
"StreamServerInterceptor",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"grpc",
".",
"StreamServerInterceptor",
"{",
"return",
"func",
"(",
"srv",
"interface",
"{",
"}",
",",
"ss",
"grpc",
".",
"ServerStream",
",",
"info",
"*",
"grpc",
".",
"StreamSe... | // StreamServerInterceptor logs streaming RPCs on the server side | [
"StreamServerInterceptor",
"logs",
"streaming",
"RPCs",
"on",
"the",
"server",
"side"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/rpclog/grpc.go#L56-L75 | test |
TheThingsNetwork/go-utils | grpc/rpclog/grpc.go | UnaryClientInterceptor | func UnaryClientInterceptor(log ttnlog.Interface) grpc.UnaryClientInterceptor {
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error) {
log := getLog(log).WithField("method", method)
log = log.WithFields(FieldsFr... | go | func UnaryClientInterceptor(log ttnlog.Interface) grpc.UnaryClientInterceptor {
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error) {
log := getLog(log).WithField("method", method)
log = log.WithFields(FieldsFr... | [
"func",
"UnaryClientInterceptor",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"grpc",
".",
"UnaryClientInterceptor",
"{",
"return",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"method",
"string",
",",
"req",
",",
"reply",
"interface",
"{",
"}",
",",... | // UnaryClientInterceptor logs unary RPCs on the client side | [
"UnaryClientInterceptor",
"logs",
"unary",
"RPCs",
"on",
"the",
"client",
"side"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/rpclog/grpc.go#L78-L92 | test |
TheThingsNetwork/go-utils | grpc/rpclog/grpc.go | StreamClientInterceptor | func StreamClientInterceptor(log ttnlog.Interface) grpc.StreamClientInterceptor {
return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (stream grpc.ClientStream, err error) {
log := getLog(log).WithField("method", method)
log =... | go | func StreamClientInterceptor(log ttnlog.Interface) grpc.StreamClientInterceptor {
return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (stream grpc.ClientStream, err error) {
log := getLog(log).WithField("method", method)
log =... | [
"func",
"StreamClientInterceptor",
"(",
"log",
"ttnlog",
".",
"Interface",
")",
"grpc",
".",
"StreamClientInterceptor",
"{",
"return",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"desc",
"*",
"grpc",
".",
"StreamDesc",
",",
"cc",
"*",
"grpc",
".",
... | // StreamClientInterceptor logs streaming RPCs on the client side | [
"StreamClientInterceptor",
"logs",
"streaming",
"RPCs",
"on",
"the",
"client",
"side"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/grpc/rpclog/grpc.go#L95-L118 | test |
TheThingsNetwork/go-utils | handlers/elasticsearch/elasticsearch.go | defaults | func (c *Config) defaults() {
if c.BufferSize == 0 {
c.BufferSize = 100
}
if c.Prefix == "" {
c.Prefix = "logs"
}
} | go | func (c *Config) defaults() {
if c.BufferSize == 0 {
c.BufferSize = 100
}
if c.Prefix == "" {
c.Prefix = "logs"
}
} | [
"func",
"(",
"c",
"*",
"Config",
")",
"defaults",
"(",
")",
"{",
"if",
"c",
".",
"BufferSize",
"==",
"0",
"{",
"c",
".",
"BufferSize",
"=",
"100",
"\n",
"}",
"\n",
"if",
"c",
".",
"Prefix",
"==",
"\"\"",
"{",
"c",
".",
"Prefix",
"=",
"\"logs\""... | // defaults applies defaults to the config. | [
"defaults",
"applies",
"defaults",
"to",
"the",
"config",
"."
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/handlers/elasticsearch/elasticsearch.go#L30-L38 | test |
TheThingsNetwork/go-utils | handlers/elasticsearch/elasticsearch.go | Flush | func (h *Handler) Flush() {
h.mu.Lock()
defer h.mu.Unlock()
if h.batch != nil {
go h.flush(h.batch)
h.batch = nil
}
} | go | func (h *Handler) Flush() {
h.mu.Lock()
defer h.mu.Unlock()
if h.batch != nil {
go h.flush(h.batch)
h.batch = nil
}
} | [
"func",
"(",
"h",
"*",
"Handler",
")",
"Flush",
"(",
")",
"{",
"h",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"h",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"h",
".",
"batch",
"!=",
"nil",
"{",
"go",
"h",
".",
"flush",
"(",
"... | // Flush the current `batch`. | [
"Flush",
"the",
"current",
"batch",
"."
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/handlers/elasticsearch/elasticsearch.go#L96-L103 | test |
TheThingsNetwork/go-utils | handlers/cli/cli.go | New | func New(w io.Writer) *Handler {
var useColor bool
if os.Getenv("COLORTERM") != "" {
useColor = true
}
if term := os.Getenv("TERM"); term != "" {
for _, substring := range colorTermSubstrings {
if strings.Contains(term, substring) {
useColor = true
break
}
}
}
return &Handler{
Writer: w,
... | go | func New(w io.Writer) *Handler {
var useColor bool
if os.Getenv("COLORTERM") != "" {
useColor = true
}
if term := os.Getenv("TERM"); term != "" {
for _, substring := range colorTermSubstrings {
if strings.Contains(term, substring) {
useColor = true
break
}
}
}
return &Handler{
Writer: w,
... | [
"func",
"New",
"(",
"w",
"io",
".",
"Writer",
")",
"*",
"Handler",
"{",
"var",
"useColor",
"bool",
"\n",
"if",
"os",
".",
"Getenv",
"(",
"\"COLORTERM\"",
")",
"!=",
"\"\"",
"{",
"useColor",
"=",
"true",
"\n",
"}",
"\n",
"if",
"term",
":=",
"os",
... | // New handler. | [
"New",
"handler",
"."
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/handlers/cli/cli.go#L72-L89 | test |
TheThingsNetwork/go-utils | handlers/cli/cli.go | HandleLog | func (h *Handler) HandleLog(e *log.Entry) error {
color := Colors[e.Level]
level := Strings[e.Level]
var fields []field
for k, v := range e.Fields {
fields = append(fields, field{k, v})
}
sort.Sort(byName(fields))
h.mu.Lock()
defer h.mu.Unlock()
if h.UseColor {
fmt.Fprintf(h.Writer, "\033[%dm%6s\033[0... | go | func (h *Handler) HandleLog(e *log.Entry) error {
color := Colors[e.Level]
level := Strings[e.Level]
var fields []field
for k, v := range e.Fields {
fields = append(fields, field{k, v})
}
sort.Sort(byName(fields))
h.mu.Lock()
defer h.mu.Unlock()
if h.UseColor {
fmt.Fprintf(h.Writer, "\033[%dm%6s\033[0... | [
"func",
"(",
"h",
"*",
"Handler",
")",
"HandleLog",
"(",
"e",
"*",
"log",
".",
"Entry",
")",
"error",
"{",
"color",
":=",
"Colors",
"[",
"e",
".",
"Level",
"]",
"\n",
"level",
":=",
"Strings",
"[",
"e",
".",
"Level",
"]",
"\n",
"var",
"fields",
... | // HandleLog implements log.Handler. | [
"HandleLog",
"implements",
"log",
".",
"Handler",
"."
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/handlers/cli/cli.go#L92-L135 | test |
TheThingsNetwork/go-utils | pseudorandom/random.go | New | func New(seed int64) random.Interface {
return &TTNRandom{
Interface: &random.TTNRandom{
Source: rand.New(rand.NewSource(seed)),
},
}
} | go | func New(seed int64) random.Interface {
return &TTNRandom{
Interface: &random.TTNRandom{
Source: rand.New(rand.NewSource(seed)),
},
}
} | [
"func",
"New",
"(",
"seed",
"int64",
")",
"random",
".",
"Interface",
"{",
"return",
"&",
"TTNRandom",
"{",
"Interface",
":",
"&",
"random",
".",
"TTNRandom",
"{",
"Source",
":",
"rand",
".",
"New",
"(",
"rand",
".",
"NewSource",
"(",
"seed",
")",
")... | // New returns a new Random, in most cases you can also just use the global funcs | [
"New",
"returns",
"a",
"new",
"Random",
"in",
"most",
"cases",
"you",
"can",
"also",
"just",
"use",
"the",
"global",
"funcs"
] | aa2a11bd59104d2a8609328c2b2b55da61826470 | https://github.com/TheThingsNetwork/go-utils/blob/aa2a11bd59104d2a8609328c2b2b55da61826470/pseudorandom/random.go#L21-L27 | test |
jtacoma/uritemplates | uritemplates.go | Names | func (self *UriTemplate) Names() []string {
names := make([]string, 0, len(self.parts))
for _, p := range self.parts {
if len(p.raw) > 0 || len(p.terms) == 0 {
continue
}
for _, term := range p.terms {
names = append(names, term.name)
}
}
return names
} | go | func (self *UriTemplate) Names() []string {
names := make([]string, 0, len(self.parts))
for _, p := range self.parts {
if len(p.raw) > 0 || len(p.terms) == 0 {
continue
}
for _, term := range p.terms {
names = append(names, term.name)
}
}
return names
} | [
"func",
"(",
"self",
"*",
"UriTemplate",
")",
"Names",
"(",
")",
"[",
"]",
"string",
"{",
"names",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"self",
".",
"parts",
")",
")",
"\n",
"for",
"_",
",",
"p",
":=",
"range",
"s... | // Names returns the names of all variables within the template. | [
"Names",
"returns",
"the",
"names",
"of",
"all",
"variables",
"within",
"the",
"template",
"."
] | 307ae868f90f4ee1b73ebe4596e0394237dacce8 | https://github.com/jtacoma/uritemplates/blob/307ae868f90f4ee1b73ebe4596e0394237dacce8/uritemplates.go#L192-L206 | test |
olorin/nagiosplugin | perfdata.go | String | func (p PerfDatum) String() string {
val := fmtPerfFloat(p.value)
value := fmt.Sprintf("%s=%s%s", p.label, val, p.unit)
value += fmt.Sprintf(";%s;%s", fmtThreshold(p.warn), fmtThreshold(p.crit))
value += fmt.Sprintf(";%s;%s", fmtThreshold(p.min), fmtThreshold(p.max))
return value
} | go | func (p PerfDatum) String() string {
val := fmtPerfFloat(p.value)
value := fmt.Sprintf("%s=%s%s", p.label, val, p.unit)
value += fmt.Sprintf(";%s;%s", fmtThreshold(p.warn), fmtThreshold(p.crit))
value += fmt.Sprintf(";%s;%s", fmtThreshold(p.min), fmtThreshold(p.max))
return value
} | [
"func",
"(",
"p",
"PerfDatum",
")",
"String",
"(",
")",
"string",
"{",
"val",
":=",
"fmtPerfFloat",
"(",
"p",
".",
"value",
")",
"\n",
"value",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"%s=%s%s\"",
",",
"p",
".",
"label",
",",
"val",
",",
"p",
".",
"u... | // String returns the string representation of a PerfDatum, suitable for
// check output. | [
"String",
"returns",
"the",
"string",
"representation",
"of",
"a",
"PerfDatum",
"suitable",
"for",
"check",
"output",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/perfdata.go#L99-L105 | test |
olorin/nagiosplugin | perfdata.go | RenderPerfdata | func RenderPerfdata(perfdata []PerfDatum) string {
value := ""
if len(perfdata) == 0 {
return value
}
// Demarcate start of perfdata in check output.
value += " |"
for _, datum := range perfdata {
value += fmt.Sprintf(" %v", datum)
}
return value
} | go | func RenderPerfdata(perfdata []PerfDatum) string {
value := ""
if len(perfdata) == 0 {
return value
}
// Demarcate start of perfdata in check output.
value += " |"
for _, datum := range perfdata {
value += fmt.Sprintf(" %v", datum)
}
return value
} | [
"func",
"RenderPerfdata",
"(",
"perfdata",
"[",
"]",
"PerfDatum",
")",
"string",
"{",
"value",
":=",
"\"\"",
"\n",
"if",
"len",
"(",
"perfdata",
")",
"==",
"0",
"{",
"return",
"value",
"\n",
"}",
"\n",
"value",
"+=",
"\" |\"",
"\n",
"for",
"_",
",",
... | // RenderPerfdata accepts a slice of PerfDatum objects and returns their
// concatenated string representations in a form suitable to append to
// the first line of check output. | [
"RenderPerfdata",
"accepts",
"a",
"slice",
"of",
"PerfDatum",
"objects",
"and",
"returns",
"their",
"concatenated",
"string",
"representations",
"in",
"a",
"form",
"suitable",
"to",
"append",
"to",
"the",
"first",
"line",
"of",
"check",
"output",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/perfdata.go#L110-L121 | test |
olorin/nagiosplugin | check.go | Exit | func Exit(status Status, message string) {
fmt.Printf("%v: %s\n", status, message)
os.Exit(int(status))
} | go | func Exit(status Status, message string) {
fmt.Printf("%v: %s\n", status, message)
os.Exit(int(status))
} | [
"func",
"Exit",
"(",
"status",
"Status",
",",
"message",
"string",
")",
"{",
"fmt",
".",
"Printf",
"(",
"\"%v: %s\\n\"",
",",
"\\n",
",",
"status",
")",
"\n",
"message",
"\n",
"}"
] | // Exit is a standalone exit function for simple checks without multiple results
// or perfdata. | [
"Exit",
"is",
"a",
"standalone",
"exit",
"function",
"for",
"simple",
"checks",
"without",
"multiple",
"results",
"or",
"perfdata",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L15-L18 | test |
olorin/nagiosplugin | check.go | NewCheckWithOptions | func NewCheckWithOptions(options CheckOptions) *Check {
c := NewCheck()
if options.StatusPolicy != nil {
c.statusPolicy = options.StatusPolicy
}
return c
} | go | func NewCheckWithOptions(options CheckOptions) *Check {
c := NewCheck()
if options.StatusPolicy != nil {
c.statusPolicy = options.StatusPolicy
}
return c
} | [
"func",
"NewCheckWithOptions",
"(",
"options",
"CheckOptions",
")",
"*",
"Check",
"{",
"c",
":=",
"NewCheck",
"(",
")",
"\n",
"if",
"options",
".",
"StatusPolicy",
"!=",
"nil",
"{",
"c",
".",
"statusPolicy",
"=",
"options",
".",
"StatusPolicy",
"\n",
"}",
... | // NewCheckWithOptions returns an empty Check object with
// caller-specified behavioural modifications. See CheckOptions. | [
"NewCheckWithOptions",
"returns",
"an",
"empty",
"Check",
"object",
"with",
"caller",
"-",
"specified",
"behavioural",
"modifications",
".",
"See",
"CheckOptions",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L57-L63 | test |
olorin/nagiosplugin | check.go | AddResult | func (c *Check) AddResult(status Status, message string) {
var result Result
result.status = status
result.message = message
c.results = append(c.results, result)
if (*c.statusPolicy)[result.status] > (*c.statusPolicy)[c.status] {
c.status = result.status
}
} | go | func (c *Check) AddResult(status Status, message string) {
var result Result
result.status = status
result.message = message
c.results = append(c.results, result)
if (*c.statusPolicy)[result.status] > (*c.statusPolicy)[c.status] {
c.status = result.status
}
} | [
"func",
"(",
"c",
"*",
"Check",
")",
"AddResult",
"(",
"status",
"Status",
",",
"message",
"string",
")",
"{",
"var",
"result",
"Result",
"\n",
"result",
".",
"status",
"=",
"status",
"\n",
"result",
".",
"message",
"=",
"message",
"\n",
"c",
".",
"r... | // AddResult adds a check result. This will not terminate the check. If
// status is the highest yet reported, this will update the check's
// final return status. | [
"AddResult",
"adds",
"a",
"check",
"result",
".",
"This",
"will",
"not",
"terminate",
"the",
"check",
".",
"If",
"status",
"is",
"the",
"highest",
"yet",
"reported",
"this",
"will",
"update",
"the",
"check",
"s",
"final",
"return",
"status",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L68-L77 | test |
olorin/nagiosplugin | check.go | AddResultf | func (c *Check) AddResultf(status Status, format string, v ...interface{}) {
msg := fmt.Sprintf(format, v...)
c.AddResult(status, msg)
} | go | func (c *Check) AddResultf(status Status, format string, v ...interface{}) {
msg := fmt.Sprintf(format, v...)
c.AddResult(status, msg)
} | [
"func",
"(",
"c",
"*",
"Check",
")",
"AddResultf",
"(",
"status",
"Status",
",",
"format",
"string",
",",
"v",
"...",
"interface",
"{",
"}",
")",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"v",
"...",
")",
"\n",
"c",
".",
"AddRe... | // AddResultf functions as AddResult, but takes a printf-style format
// string and arguments. | [
"AddResultf",
"functions",
"as",
"AddResult",
"but",
"takes",
"a",
"printf",
"-",
"style",
"format",
"string",
"and",
"arguments",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L81-L84 | test |
olorin/nagiosplugin | check.go | String | func (c Check) String() string {
value := fmt.Sprintf("%v: %s", c.status, c.exitInfoText())
value += RenderPerfdata(c.perfdata)
return value
} | go | func (c Check) String() string {
value := fmt.Sprintf("%v: %s", c.status, c.exitInfoText())
value += RenderPerfdata(c.perfdata)
return value
} | [
"func",
"(",
"c",
"Check",
")",
"String",
"(",
")",
"string",
"{",
"value",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"%v: %s\"",
",",
"c",
".",
"status",
",",
"c",
".",
"exitInfoText",
"(",
")",
")",
"\n",
"value",
"+=",
"RenderPerfdata",
"(",
"c",
".",... | // String representation of the check results, suitable for output and
// parsing by Nagios. | [
"String",
"representation",
"of",
"the",
"check",
"results",
"suitable",
"for",
"output",
"and",
"parsing",
"by",
"Nagios",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L125-L129 | test |
olorin/nagiosplugin | check.go | Exitf | func (c *Check) Exitf(status Status, format string, v ...interface{}) {
info := fmt.Sprintf(format, v...)
c.AddResult(status, info)
c.Finish()
} | go | func (c *Check) Exitf(status Status, format string, v ...interface{}) {
info := fmt.Sprintf(format, v...)
c.AddResult(status, info)
c.Finish()
} | [
"func",
"(",
"c",
"*",
"Check",
")",
"Exitf",
"(",
"status",
"Status",
",",
"format",
"string",
",",
"v",
"...",
"interface",
"{",
"}",
")",
"{",
"info",
":=",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"v",
"...",
")",
"\n",
"c",
".",
"AddResult... | // Exitf takes a status plus a format string, and a list of
// parameters to pass to Sprintf. It then immediately outputs and exits. | [
"Exitf",
"takes",
"a",
"status",
"plus",
"a",
"format",
"string",
"and",
"a",
"list",
"of",
"parameters",
"to",
"pass",
"to",
"Sprintf",
".",
"It",
"then",
"immediately",
"outputs",
"and",
"exits",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L146-L150 | test |
olorin/nagiosplugin | check.go | Criticalf | func (c *Check) Criticalf(format string, v ...interface{}) {
c.Exitf(CRITICAL, format, v...)
} | go | func (c *Check) Criticalf(format string, v ...interface{}) {
c.Exitf(CRITICAL, format, v...)
} | [
"func",
"(",
"c",
"*",
"Check",
")",
"Criticalf",
"(",
"format",
"string",
",",
"v",
"...",
"interface",
"{",
"}",
")",
"{",
"c",
".",
"Exitf",
"(",
"CRITICAL",
",",
"format",
",",
"v",
"...",
")",
"\n",
"}"
] | // Criticalf is a shorthand function which exits the check with status
// CRITICAL and the message provided. | [
"Criticalf",
"is",
"a",
"shorthand",
"function",
"which",
"exits",
"the",
"check",
"with",
"status",
"CRITICAL",
"and",
"the",
"message",
"provided",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L154-L156 | test |
olorin/nagiosplugin | check.go | Unknownf | func (c *Check) Unknownf(format string, v ...interface{}) {
c.Exitf(UNKNOWN, format, v...)
} | go | func (c *Check) Unknownf(format string, v ...interface{}) {
c.Exitf(UNKNOWN, format, v...)
} | [
"func",
"(",
"c",
"*",
"Check",
")",
"Unknownf",
"(",
"format",
"string",
",",
"v",
"...",
"interface",
"{",
"}",
")",
"{",
"c",
".",
"Exitf",
"(",
"UNKNOWN",
",",
"format",
",",
"v",
"...",
")",
"\n",
"}"
] | // Unknownf is a shorthand function which exits the check with status
// UNKNOWN and the message provided. | [
"Unknownf",
"is",
"a",
"shorthand",
"function",
"which",
"exits",
"the",
"check",
"with",
"status",
"UNKNOWN",
"and",
"the",
"message",
"provided",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/check.go#L160-L162 | test |
olorin/nagiosplugin | result.go | NewDefaultStatusPolicy | func NewDefaultStatusPolicy() *statusPolicy {
return &statusPolicy{
OK: statusSeverity(OK),
WARNING: statusSeverity(WARNING),
CRITICAL: statusSeverity(CRITICAL),
UNKNOWN: statusSeverity(UNKNOWN),
}
} | go | func NewDefaultStatusPolicy() *statusPolicy {
return &statusPolicy{
OK: statusSeverity(OK),
WARNING: statusSeverity(WARNING),
CRITICAL: statusSeverity(CRITICAL),
UNKNOWN: statusSeverity(UNKNOWN),
}
} | [
"func",
"NewDefaultStatusPolicy",
"(",
")",
"*",
"statusPolicy",
"{",
"return",
"&",
"statusPolicy",
"{",
"OK",
":",
"statusSeverity",
"(",
"OK",
")",
",",
"WARNING",
":",
"statusSeverity",
"(",
"WARNING",
")",
",",
"CRITICAL",
":",
"statusSeverity",
"(",
"C... | // NewDefaultStatusPolicy returns a status policy that assigns relative
// severity in accordance with conventional Nagios plugin return codes.
// Statuses associated with higher return codes are more severe. | [
"NewDefaultStatusPolicy",
"returns",
"a",
"status",
"policy",
"that",
"assigns",
"relative",
"severity",
"in",
"accordance",
"with",
"conventional",
"Nagios",
"plugin",
"return",
"codes",
".",
"Statuses",
"associated",
"with",
"higher",
"return",
"codes",
"are",
"mo... | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/result.go#L29-L36 | test |
olorin/nagiosplugin | result.go | NewStatusPolicy | func NewStatusPolicy(statuses []Status) (*statusPolicy, error) {
newPol := make(statusPolicy)
for i, status := range statuses {
newPol[status] = statusSeverity(i)
}
// Ensure all statuses are covered by the new policy.
defaultPol := NewDefaultStatusPolicy()
for status := range *defaultPol {
_, ok := newPol[s... | go | func NewStatusPolicy(statuses []Status) (*statusPolicy, error) {
newPol := make(statusPolicy)
for i, status := range statuses {
newPol[status] = statusSeverity(i)
}
// Ensure all statuses are covered by the new policy.
defaultPol := NewDefaultStatusPolicy()
for status := range *defaultPol {
_, ok := newPol[s... | [
"func",
"NewStatusPolicy",
"(",
"statuses",
"[",
"]",
"Status",
")",
"(",
"*",
"statusPolicy",
",",
"error",
")",
"{",
"newPol",
":=",
"make",
"(",
"statusPolicy",
")",
"\n",
"for",
"i",
",",
"status",
":=",
"range",
"statuses",
"{",
"newPol",
"[",
"st... | // NewStatusPolicy returns a status policy that assigns relative
// severity in accordance with a user-configurable prioritised slice.
// Check statuses must be listed in ascending severity order. | [
"NewStatusPolicy",
"returns",
"a",
"status",
"policy",
"that",
"assigns",
"relative",
"severity",
"in",
"accordance",
"with",
"a",
"user",
"-",
"configurable",
"prioritised",
"slice",
".",
"Check",
"statuses",
"must",
"be",
"listed",
"in",
"ascending",
"severity",... | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/result.go#L50-L66 | test |
olorin/nagiosplugin | range.go | ParseRange | func ParseRange(rangeStr string) (*Range, error) {
// Set defaults
t := &Range{
Start: 0,
End: math.Inf(1),
AlertOnInside: false,
}
// Remove leading and trailing whitespace
rangeStr = strings.Trim(rangeStr, " \n\r")
// Check for inverted semantics
if rangeStr[0] == '@' {
t.AlertOnInsi... | go | func ParseRange(rangeStr string) (*Range, error) {
// Set defaults
t := &Range{
Start: 0,
End: math.Inf(1),
AlertOnInside: false,
}
// Remove leading and trailing whitespace
rangeStr = strings.Trim(rangeStr, " \n\r")
// Check for inverted semantics
if rangeStr[0] == '@' {
t.AlertOnInsi... | [
"func",
"ParseRange",
"(",
"rangeStr",
"string",
")",
"(",
"*",
"Range",
",",
"error",
")",
"{",
"t",
":=",
"&",
"Range",
"{",
"Start",
":",
"0",
",",
"End",
":",
"math",
".",
"Inf",
"(",
"1",
")",
",",
"AlertOnInside",
":",
"false",
",",
"}",
... | // ParseRange returns a new range object and nil if the given range definition was
// valid, or nil and an error if it was invalid. | [
"ParseRange",
"returns",
"a",
"new",
"range",
"object",
"and",
"nil",
"if",
"the",
"given",
"range",
"definition",
"was",
"valid",
"or",
"nil",
"and",
"an",
"error",
"if",
"it",
"was",
"invalid",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/range.go#L24-L70 | test |
olorin/nagiosplugin | range.go | Check | func (r *Range) Check(value float64) bool {
// Ranges are treated as a closed interval.
if r.Start <= value && value <= r.End {
return r.AlertOnInside
}
return !r.AlertOnInside
} | go | func (r *Range) Check(value float64) bool {
// Ranges are treated as a closed interval.
if r.Start <= value && value <= r.End {
return r.AlertOnInside
}
return !r.AlertOnInside
} | [
"func",
"(",
"r",
"*",
"Range",
")",
"Check",
"(",
"value",
"float64",
")",
"bool",
"{",
"if",
"r",
".",
"Start",
"<=",
"value",
"&&",
"value",
"<=",
"r",
".",
"End",
"{",
"return",
"r",
".",
"AlertOnInside",
"\n",
"}",
"\n",
"return",
"!",
"r",
... | // Check returns true if an alert should be raised based on the range (if the
// value is outside the range for normal semantics, or if the value is
// inside the range for inverted semantics ('@-semantics')). | [
"Check",
"returns",
"true",
"if",
"an",
"alert",
"should",
"be",
"raised",
"based",
"on",
"the",
"range",
"(",
"if",
"the",
"value",
"is",
"outside",
"the",
"range",
"for",
"normal",
"semantics",
"or",
"if",
"the",
"value",
"is",
"inside",
"the",
"range"... | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/range.go#L75-L81 | test |
olorin/nagiosplugin | range.go | CheckInt | func (r *Range) CheckInt(val int) bool {
return r.Check(float64(val))
} | go | func (r *Range) CheckInt(val int) bool {
return r.Check(float64(val))
} | [
"func",
"(",
"r",
"*",
"Range",
")",
"CheckInt",
"(",
"val",
"int",
")",
"bool",
"{",
"return",
"r",
".",
"Check",
"(",
"float64",
"(",
"val",
")",
")",
"\n",
"}"
] | // CheckInt is a convenience method which does an unchecked type
// conversion from an int to a float64. | [
"CheckInt",
"is",
"a",
"convenience",
"method",
"which",
"does",
"an",
"unchecked",
"type",
"conversion",
"from",
"an",
"int",
"to",
"a",
"float64",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/range.go#L85-L87 | test |
olorin/nagiosplugin | range.go | CheckUint64 | func (r *Range) CheckUint64(val uint64) bool {
return r.Check(float64(val))
} | go | func (r *Range) CheckUint64(val uint64) bool {
return r.Check(float64(val))
} | [
"func",
"(",
"r",
"*",
"Range",
")",
"CheckUint64",
"(",
"val",
"uint64",
")",
"bool",
"{",
"return",
"r",
".",
"Check",
"(",
"float64",
"(",
"val",
")",
")",
"\n",
"}"
] | // CheckUint64 is a convenience method which does an unchecked type
// conversion from an uint64 to a float64. | [
"CheckUint64",
"is",
"a",
"convenience",
"method",
"which",
"does",
"an",
"unchecked",
"type",
"conversion",
"from",
"an",
"uint64",
"to",
"a",
"float64",
"."
] | 893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064 | https://github.com/olorin/nagiosplugin/blob/893f9702af4ea1e2dc4cd6528cbdcdb3dc7ca064/range.go#L91-L93 | test |
apparentlymart/go-rundeck-api | rundeck/client.go | NewClient | func NewClient(config *ClientConfig) (*Client, error) {
t := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: config.AllowUnverifiedSSL,
},
}
httpClient := &http.Client{
Transport: t,
}
apiPath, _ := url.Parse("api/13/")
baseURL, err := url.Parse(config.BaseURL)
if err != nil {
retu... | go | func NewClient(config *ClientConfig) (*Client, error) {
t := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: config.AllowUnverifiedSSL,
},
}
httpClient := &http.Client{
Transport: t,
}
apiPath, _ := url.Parse("api/13/")
baseURL, err := url.Parse(config.BaseURL)
if err != nil {
retu... | [
"func",
"NewClient",
"(",
"config",
"*",
"ClientConfig",
")",
"(",
"*",
"Client",
",",
"error",
")",
"{",
"t",
":=",
"&",
"http",
".",
"Transport",
"{",
"TLSClientConfig",
":",
"&",
"tls",
".",
"Config",
"{",
"InsecureSkipVerify",
":",
"config",
".",
"... | // NewClient returns a configured Rundeck client. | [
"NewClient",
"returns",
"a",
"configured",
"Rundeck",
"client",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/client.go#L50-L72 | test |
apparentlymart/go-rundeck-api | rundeck/key.go | GetKeyMeta | func (c *Client) GetKeyMeta(path string) (*KeyMeta, error) {
k := &KeyMeta{}
err := c.get([]string{"storage", "keys", path}, nil, k)
return k, err
} | go | func (c *Client) GetKeyMeta(path string) (*KeyMeta, error) {
k := &KeyMeta{}
err := c.get([]string{"storage", "keys", path}, nil, k)
return k, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetKeyMeta",
"(",
"path",
"string",
")",
"(",
"*",
"KeyMeta",
",",
"error",
")",
"{",
"k",
":=",
"&",
"KeyMeta",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
"]",
"string",
"{",
"\"storage\"",
"... | // GetKeyMeta returns the metadata for the key at the given keystore path. | [
"GetKeyMeta",
"returns",
"the",
"metadata",
"for",
"the",
"key",
"at",
"the",
"given",
"keystore",
"path",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/key.go#L25-L29 | test |
apparentlymart/go-rundeck-api | rundeck/key.go | GetKeysInDirMeta | func (c *Client) GetKeysInDirMeta(path string) ([]KeyMeta, error) {
r := &keyMetaListContents{}
err := c.get([]string{"storage", "keys", path}, nil, r)
if err != nil {
return nil, err
}
return r.Keys, nil
} | go | func (c *Client) GetKeysInDirMeta(path string) ([]KeyMeta, error) {
r := &keyMetaListContents{}
err := c.get([]string{"storage", "keys", path}, nil, r)
if err != nil {
return nil, err
}
return r.Keys, nil
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetKeysInDirMeta",
"(",
"path",
"string",
")",
"(",
"[",
"]",
"KeyMeta",
",",
"error",
")",
"{",
"r",
":=",
"&",
"keyMetaListContents",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
"]",
"string",
... | // GetKeysInDirMeta returns the metadata for the keys and subdirectories within
// the directory at the given keystore path. | [
"GetKeysInDirMeta",
"returns",
"the",
"metadata",
"for",
"the",
"keys",
"and",
"subdirectories",
"within",
"the",
"directory",
"at",
"the",
"given",
"keystore",
"path",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/key.go#L33-L40 | test |
apparentlymart/go-rundeck-api | rundeck/key.go | GetKeyContent | func (c *Client) GetKeyContent(path string) (string, error) {
return c.rawGet([]string{"storage", "keys", path}, nil, "application/pgp-keys")
} | go | func (c *Client) GetKeyContent(path string) (string, error) {
return c.rawGet([]string{"storage", "keys", path}, nil, "application/pgp-keys")
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetKeyContent",
"(",
"path",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"return",
"c",
".",
"rawGet",
"(",
"[",
"]",
"string",
"{",
"\"storage\"",
",",
"\"keys\"",
",",
"path",
"}",
",",
"nil",
",",... | // GetKeyContent retrieves and returns the content of the key at the given keystore path.
// Private keys are write-only, so they cannot be retrieved via this interface. | [
"GetKeyContent",
"retrieves",
"and",
"returns",
"the",
"content",
"of",
"the",
"key",
"at",
"the",
"given",
"keystore",
"path",
".",
"Private",
"keys",
"are",
"write",
"-",
"only",
"so",
"they",
"cannot",
"be",
"retrieved",
"via",
"this",
"interface",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/key.go#L44-L46 | test |
apparentlymart/go-rundeck-api | rundeck/job.go | GetJobSummariesForProject | func (c *Client) GetJobSummariesForProject(projectName string) ([]JobSummary, error) {
jobList := &jobSummaryList{}
err := c.get([]string{"project", projectName, "jobs"}, nil, jobList)
return jobList.Jobs, err
} | go | func (c *Client) GetJobSummariesForProject(projectName string) ([]JobSummary, error) {
jobList := &jobSummaryList{}
err := c.get([]string{"project", projectName, "jobs"}, nil, jobList)
return jobList.Jobs, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetJobSummariesForProject",
"(",
"projectName",
"string",
")",
"(",
"[",
"]",
"JobSummary",
",",
"error",
")",
"{",
"jobList",
":=",
"&",
"jobSummaryList",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
... | // GetJobSummariesForProject returns summaries of the jobs belonging to the named project. | [
"GetJobSummariesForProject",
"returns",
"summaries",
"of",
"the",
"jobs",
"belonging",
"to",
"the",
"named",
"project",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/job.go#L310-L314 | test |
apparentlymart/go-rundeck-api | rundeck/job.go | GetJobsForProject | func (c *Client) GetJobsForProject(projectName string) ([]JobDetail, error) {
jobList := &jobDetailList{}
err := c.get([]string{"jobs", "export"}, map[string]string{"project": projectName}, jobList)
if err != nil {
return nil, err
}
return jobList.Jobs, nil
} | go | func (c *Client) GetJobsForProject(projectName string) ([]JobDetail, error) {
jobList := &jobDetailList{}
err := c.get([]string{"jobs", "export"}, map[string]string{"project": projectName}, jobList)
if err != nil {
return nil, err
}
return jobList.Jobs, nil
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetJobsForProject",
"(",
"projectName",
"string",
")",
"(",
"[",
"]",
"JobDetail",
",",
"error",
")",
"{",
"jobList",
":=",
"&",
"jobDetailList",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
"]",
"s... | // GetJobsForProject returns the full job details of the jobs belonging to the named project. | [
"GetJobsForProject",
"returns",
"the",
"full",
"job",
"details",
"of",
"the",
"jobs",
"belonging",
"to",
"the",
"named",
"project",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/job.go#L317-L324 | test |
apparentlymart/go-rundeck-api | rundeck/job.go | GetJob | func (c *Client) GetJob(id string) (*JobDetail, error) {
jobList := &jobDetailList{}
err := c.get([]string{"job", id}, nil, jobList)
if err != nil {
return nil, err
}
return &jobList.Jobs[0], nil
} | go | func (c *Client) GetJob(id string) (*JobDetail, error) {
jobList := &jobDetailList{}
err := c.get([]string{"job", id}, nil, jobList)
if err != nil {
return nil, err
}
return &jobList.Jobs[0], nil
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetJob",
"(",
"id",
"string",
")",
"(",
"*",
"JobDetail",
",",
"error",
")",
"{",
"jobList",
":=",
"&",
"jobDetailList",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
"]",
"string",
"{",
"\"job\"",... | // GetJob returns the full job details of the job with the given id. | [
"GetJob",
"returns",
"the",
"full",
"job",
"details",
"of",
"the",
"job",
"with",
"the",
"given",
"id",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/job.go#L327-L334 | test |
apparentlymart/go-rundeck-api | rundeck/job.go | CreateJob | func (c *Client) CreateJob(job *JobDetail) (*JobSummary, error) {
return c.importJob(job, "create")
} | go | func (c *Client) CreateJob(job *JobDetail) (*JobSummary, error) {
return c.importJob(job, "create")
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateJob",
"(",
"job",
"*",
"JobDetail",
")",
"(",
"*",
"JobSummary",
",",
"error",
")",
"{",
"return",
"c",
".",
"importJob",
"(",
"job",
",",
"\"create\"",
")",
"\n",
"}"
] | // CreateJob creates a new job based on the provided structure. | [
"CreateJob",
"creates",
"a",
"new",
"job",
"based",
"on",
"the",
"provided",
"structure",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/job.go#L337-L339 | test |
apparentlymart/go-rundeck-api | rundeck/job.go | CreateOrUpdateJob | func (c *Client) CreateOrUpdateJob(job *JobDetail) (*JobSummary, error) {
return c.importJob(job, "update")
} | go | func (c *Client) CreateOrUpdateJob(job *JobDetail) (*JobSummary, error) {
return c.importJob(job, "update")
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateOrUpdateJob",
"(",
"job",
"*",
"JobDetail",
")",
"(",
"*",
"JobSummary",
",",
"error",
")",
"{",
"return",
"c",
".",
"importJob",
"(",
"job",
",",
"\"update\"",
")",
"\n",
"}"
] | // CreateOrUpdateJob takes a job detail structure which has its ID set and either updates
// an existing job with the same id or creates a new job with that id. | [
"CreateOrUpdateJob",
"takes",
"a",
"job",
"detail",
"structure",
"which",
"has",
"its",
"ID",
"set",
"and",
"either",
"updates",
"an",
"existing",
"job",
"with",
"the",
"same",
"id",
"or",
"creates",
"a",
"new",
"job",
"with",
"that",
"id",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/job.go#L343-L345 | test |
apparentlymart/go-rundeck-api | rundeck/job.go | DeleteJob | func (c *Client) DeleteJob(id string) error {
return c.delete([]string{"job", id})
} | go | func (c *Client) DeleteJob(id string) error {
return c.delete([]string{"job", id})
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteJob",
"(",
"id",
"string",
")",
"error",
"{",
"return",
"c",
".",
"delete",
"(",
"[",
"]",
"string",
"{",
"\"job\"",
",",
"id",
"}",
")",
"\n",
"}"
] | // DeleteJob deletes the job with the given id. | [
"DeleteJob",
"deletes",
"the",
"job",
"with",
"the",
"given",
"id",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/job.go#L377-L379 | test |
apparentlymart/go-rundeck-api | rundeck/job.go | JobSummary | func (r *jobImportResult) JobSummary() *JobSummary {
return &JobSummary{
ID: r.ID,
Name: r.Name,
GroupName: r.GroupName,
ProjectName: r.ProjectName,
}
} | go | func (r *jobImportResult) JobSummary() *JobSummary {
return &JobSummary{
ID: r.ID,
Name: r.Name,
GroupName: r.GroupName,
ProjectName: r.ProjectName,
}
} | [
"func",
"(",
"r",
"*",
"jobImportResult",
")",
"JobSummary",
"(",
")",
"*",
"JobSummary",
"{",
"return",
"&",
"JobSummary",
"{",
"ID",
":",
"r",
".",
"ID",
",",
"Name",
":",
"r",
".",
"Name",
",",
"GroupName",
":",
"r",
".",
"GroupName",
",",
"Proj... | // JobSummary produces a JobSummary instance with values populated from the import result.
// The summary object won't have its Description populated, since import results do not
// include descriptions. | [
"JobSummary",
"produces",
"a",
"JobSummary",
"instance",
"with",
"values",
"populated",
"from",
"the",
"import",
"result",
".",
"The",
"summary",
"object",
"won",
"t",
"have",
"its",
"Description",
"populated",
"since",
"import",
"results",
"do",
"not",
"include... | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/job.go#L457-L464 | test |
apparentlymart/go-rundeck-api | rundeck/system_info.go | GetSystemInfo | func (c *Client) GetSystemInfo() (*SystemInfo, error) {
sysInfo := &SystemInfo{}
err := c.get([]string{"system", "info"}, nil, sysInfo)
return sysInfo, err
} | go | func (c *Client) GetSystemInfo() (*SystemInfo, error) {
sysInfo := &SystemInfo{}
err := c.get([]string{"system", "info"}, nil, sysInfo)
return sysInfo, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetSystemInfo",
"(",
")",
"(",
"*",
"SystemInfo",
",",
"error",
")",
"{",
"sysInfo",
":=",
"&",
"SystemInfo",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
"]",
"string",
"{",
"\"system\"",
",",
"\... | // GetSystemInfo retrieves and returns miscellaneous system information about the Rundeck server
// and the machine it's running on. | [
"GetSystemInfo",
"retrieves",
"and",
"returns",
"miscellaneous",
"system",
"information",
"about",
"the",
"Rundeck",
"server",
"and",
"the",
"machine",
"it",
"s",
"running",
"on",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/system_info.go#L103-L107 | test |
apparentlymart/go-rundeck-api | rundeck/system_info.go | DateTime | func (ts *SystemTimestamp) DateTime() time.Time {
// Assume the server will always give us a valid timestamp,
// so we don't need to handle the error case.
// (Famous last words?)
t, _ := time.Parse(time.RFC3339, ts.DateTimeStr)
return t
} | go | func (ts *SystemTimestamp) DateTime() time.Time {
// Assume the server will always give us a valid timestamp,
// so we don't need to handle the error case.
// (Famous last words?)
t, _ := time.Parse(time.RFC3339, ts.DateTimeStr)
return t
} | [
"func",
"(",
"ts",
"*",
"SystemTimestamp",
")",
"DateTime",
"(",
")",
"time",
".",
"Time",
"{",
"t",
",",
"_",
":=",
"time",
".",
"Parse",
"(",
"time",
".",
"RFC3339",
",",
"ts",
".",
"DateTimeStr",
")",
"\n",
"return",
"t",
"\n",
"}"
] | // DateTime produces a time.Time object from a SystemTimestamp object. | [
"DateTime",
"produces",
"a",
"time",
".",
"Time",
"object",
"from",
"a",
"SystemTimestamp",
"object",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/system_info.go#L110-L116 | test |
apparentlymart/go-rundeck-api | rundeck/project.go | GetAllProjects | func (c *Client) GetAllProjects() ([]ProjectSummary, error) {
p := &projects{}
err := c.get([]string{"projects"}, nil, p)
return p.Projects, err
} | go | func (c *Client) GetAllProjects() ([]ProjectSummary, error) {
p := &projects{}
err := c.get([]string{"projects"}, nil, p)
return p.Projects, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetAllProjects",
"(",
")",
"(",
"[",
"]",
"ProjectSummary",
",",
"error",
")",
"{",
"p",
":=",
"&",
"projects",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
"]",
"string",
"{",
"\"projects\"",
"}"... | // GetAllProjects retrieves and returns all of the projects defined in the Rundeck server. | [
"GetAllProjects",
"retrieves",
"and",
"returns",
"all",
"of",
"the",
"projects",
"defined",
"in",
"the",
"Rundeck",
"server",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/project.go#L45-L49 | test |
apparentlymart/go-rundeck-api | rundeck/project.go | GetProject | func (c *Client) GetProject(name string) (*Project, error) {
p := &Project{}
err := c.get([]string{"project", name}, nil, p)
return p, err
} | go | func (c *Client) GetProject(name string) (*Project, error) {
p := &Project{}
err := c.get([]string{"project", name}, nil, p)
return p, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetProject",
"(",
"name",
"string",
")",
"(",
"*",
"Project",
",",
"error",
")",
"{",
"p",
":=",
"&",
"Project",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"get",
"(",
"[",
"]",
"string",
"{",
"\"project\"",
"... | // GetProject retrieves and returns the named project. | [
"GetProject",
"retrieves",
"and",
"returns",
"the",
"named",
"project",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/project.go#L52-L56 | test |
apparentlymart/go-rundeck-api | rundeck/project.go | CreateProject | func (c *Client) CreateProject(project *Project) (*Project, error) {
p := &Project{}
err := c.post([]string{"projects"}, nil, project, p)
return p, err
} | go | func (c *Client) CreateProject(project *Project) (*Project, error) {
p := &Project{}
err := c.post([]string{"projects"}, nil, project, p)
return p, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateProject",
"(",
"project",
"*",
"Project",
")",
"(",
"*",
"Project",
",",
"error",
")",
"{",
"p",
":=",
"&",
"Project",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"post",
"(",
"[",
"]",
"string",
"{",
"\"... | // CreateProject creates a new, empty project. | [
"CreateProject",
"creates",
"a",
"new",
"empty",
"project",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/project.go#L59-L63 | test |
apparentlymart/go-rundeck-api | rundeck/project.go | DeleteProject | func (c *Client) DeleteProject(name string) error {
return c.delete([]string{"project", name})
} | go | func (c *Client) DeleteProject(name string) error {
return c.delete([]string{"project", name})
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteProject",
"(",
"name",
"string",
")",
"error",
"{",
"return",
"c",
".",
"delete",
"(",
"[",
"]",
"string",
"{",
"\"project\"",
",",
"name",
"}",
")",
"\n",
"}"
] | // DeleteProject deletes a project and all of its jobs. | [
"DeleteProject",
"deletes",
"a",
"project",
"and",
"all",
"of",
"its",
"jobs",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/project.go#L66-L68 | test |
apparentlymart/go-rundeck-api | rundeck/project.go | SetProjectConfig | func (c *Client) SetProjectConfig(projectName string, config ProjectConfig) error {
return c.put(
[]string{"project", projectName, "config"},
config,
nil,
)
} | go | func (c *Client) SetProjectConfig(projectName string, config ProjectConfig) error {
return c.put(
[]string{"project", projectName, "config"},
config,
nil,
)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SetProjectConfig",
"(",
"projectName",
"string",
",",
"config",
"ProjectConfig",
")",
"error",
"{",
"return",
"c",
".",
"put",
"(",
"[",
"]",
"string",
"{",
"\"project\"",
",",
"projectName",
",",
"\"config\"",
"}",
... | // SetProjectConfig replaces the configuration of the named project. | [
"SetProjectConfig",
"replaces",
"the",
"configuration",
"of",
"the",
"named",
"project",
"."
] | 2c962acae81080a937c350a5bea054c239f27a81 | https://github.com/apparentlymart/go-rundeck-api/blob/2c962acae81080a937c350a5bea054c239f27a81/rundeck/project.go#L71-L77 | test |
profitbricks/profitbricks-sdk-go | profitbricks.go | NewClient | func NewClient(username, password string) *Client {
c := newPBRestClient(username, password, "", "", true)
return &Client{
userName: c.username,
password: c.password,
client: c,
}
} | go | func NewClient(username, password string) *Client {
c := newPBRestClient(username, password, "", "", true)
return &Client{
userName: c.username,
password: c.password,
client: c,
}
} | [
"func",
"NewClient",
"(",
"username",
",",
"password",
"string",
")",
"*",
"Client",
"{",
"c",
":=",
"newPBRestClient",
"(",
"username",
",",
"password",
",",
"\"\"",
",",
"\"\"",
",",
"true",
")",
"\n",
"return",
"&",
"Client",
"{",
"userName",
":",
"... | //NewClient is a constructor for Client object | [
"NewClient",
"is",
"a",
"constructor",
"for",
"Client",
"object"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/profitbricks.go#L15-L23 | test |
profitbricks/profitbricks-sdk-go | profitbricks.go | NewClientbyToken | func NewClientbyToken(token string) *Client {
c := newPBRestClientbyToken(token, "", "", true)
return &Client{
token: c.token,
client: c,
}
} | go | func NewClientbyToken(token string) *Client {
c := newPBRestClientbyToken(token, "", "", true)
return &Client{
token: c.token,
client: c,
}
} | [
"func",
"NewClientbyToken",
"(",
"token",
"string",
")",
"*",
"Client",
"{",
"c",
":=",
"newPBRestClientbyToken",
"(",
"token",
",",
"\"\"",
",",
"\"\"",
",",
"true",
")",
"\n",
"return",
"&",
"Client",
"{",
"token",
":",
"c",
".",
"token",
",",
"clien... | // NewClientbyToken is a constructor for Client object using bearer tokens for
// authentication instead of username, password | [
"NewClientbyToken",
"is",
"a",
"constructor",
"for",
"Client",
"object",
"using",
"bearer",
"tokens",
"for",
"authentication",
"instead",
"of",
"username",
"password"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/profitbricks.go#L27-L34 | test |
profitbricks/profitbricks-sdk-go | profitbricks.go | SetDepth | func (c *Client) SetDepth(depth int) {
c.client.depth = strconv.Itoa(depth)
} | go | func (c *Client) SetDepth(depth int) {
c.client.depth = strconv.Itoa(depth)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"SetDepth",
"(",
"depth",
"int",
")",
"{",
"c",
".",
"client",
".",
"depth",
"=",
"strconv",
".",
"Itoa",
"(",
"depth",
")",
"\n",
"}"
] | // SetDepth sets depth parameter for api calls | [
"SetDepth",
"sets",
"depth",
"parameter",
"for",
"api",
"calls"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/profitbricks.go#L37-L39 | test |
profitbricks/profitbricks-sdk-go | datacenter.go | ListDatacenters | func (c *Client) ListDatacenters() (*Datacenters, error) {
url := dcColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenters{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListDatacenters() (*Datacenters, error) {
url := dcColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenters{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListDatacenters",
"(",
")",
"(",
"*",
"Datacenters",
",",
"error",
")",
"{",
"url",
":=",
"dcColPath",
"(",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
"+",
"strconv",
".",
... | //ListDatacenters lists all data centers | [
"ListDatacenters",
"lists",
"all",
"data",
"centers"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/datacenter.go#L59-L64 | test |
profitbricks/profitbricks-sdk-go | datacenter.go | CreateDatacenter | func (c *Client) CreateDatacenter(dc Datacenter) (*Datacenter, error) {
url := dcColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenter{}
err := c.client.Post(url, dc, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) CreateDatacenter(dc Datacenter) (*Datacenter, error) {
url := dcColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenter{}
err := c.client.Post(url, dc, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateDatacenter",
"(",
"dc",
"Datacenter",
")",
"(",
"*",
"Datacenter",
",",
"error",
")",
"{",
"url",
":=",
"dcColPath",
"(",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
"+... | //CreateDatacenter creates a data center | [
"CreateDatacenter",
"creates",
"a",
"data",
"center"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/datacenter.go#L67-L72 | test |
profitbricks/profitbricks-sdk-go | datacenter.go | GetDatacenter | func (c *Client) GetDatacenter(dcid string) (*Datacenter, error) {
url := dcPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenter{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetDatacenter(dcid string) (*Datacenter, error) {
url := dcPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenter{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetDatacenter",
"(",
"dcid",
"string",
")",
"(",
"*",
"Datacenter",
",",
"error",
")",
"{",
"url",
":=",
"dcPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
... | //GetDatacenter gets a datacenter | [
"GetDatacenter",
"gets",
"a",
"datacenter"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/datacenter.go#L75-L80 | test |
profitbricks/profitbricks-sdk-go | datacenter.go | UpdateDataCenter | func (c *Client) UpdateDataCenter(dcid string, obj DatacenterProperties) (*Datacenter, error) {
url := dcPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenter{}
err := c.client.Patch(url, obj, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) UpdateDataCenter(dcid string, obj DatacenterProperties) (*Datacenter, error) {
url := dcPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Datacenter{}
err := c.client.Patch(url, obj, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateDataCenter",
"(",
"dcid",
"string",
",",
"obj",
"DatacenterProperties",
")",
"(",
"*",
"Datacenter",
",",
"error",
")",
"{",
"url",
":=",
"dcPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client"... | //UpdateDataCenter updates a data center | [
"UpdateDataCenter",
"updates",
"a",
"data",
"center"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/datacenter.go#L83-L88 | test |
profitbricks/profitbricks-sdk-go | datacenter.go | DeleteDatacenter | func (c *Client) DeleteDatacenter(dcid string) (*http.Header, error) {
url := dcPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
return ret, c.client.Delete(url, ret, http.StatusAccepted)
} | go | func (c *Client) DeleteDatacenter(dcid string) (*http.Header, error) {
url := dcPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
return ret, c.client.Delete(url, ret, http.StatusAccepted)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteDatacenter",
"(",
"dcid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"dcPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
... | //DeleteDatacenter deletes a data center | [
"DeleteDatacenter",
"deletes",
"a",
"data",
"center"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/datacenter.go#L91-L95 | test |
profitbricks/profitbricks-sdk-go | datacenter.go | WaitTillProvisioned | func (c *Client) WaitTillProvisioned(path string) error {
waitCount := 300
for i := 0; i < waitCount; i++ {
request, err := c.GetRequestStatus(path)
if err != nil {
return err
}
if request.Metadata.Status == "DONE" {
return nil
}
time.Sleep(1 * time.Second)
i++
}
return fmt.Errorf("timeout expir... | go | func (c *Client) WaitTillProvisioned(path string) error {
waitCount := 300
for i := 0; i < waitCount; i++ {
request, err := c.GetRequestStatus(path)
if err != nil {
return err
}
if request.Metadata.Status == "DONE" {
return nil
}
time.Sleep(1 * time.Second)
i++
}
return fmt.Errorf("timeout expir... | [
"func",
"(",
"c",
"*",
"Client",
")",
"WaitTillProvisioned",
"(",
"path",
"string",
")",
"error",
"{",
"waitCount",
":=",
"300",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"waitCount",
";",
"i",
"++",
"{",
"request",
",",
"err",
":=",
"c",
".",
... | //WaitTillProvisioned helper function | [
"WaitTillProvisioned",
"helper",
"function"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/datacenter.go#L98-L112 | test |
profitbricks/profitbricks-sdk-go | firewallrule.go | ListFirewallRules | func (c *Client) ListFirewallRules(dcID string, serverID string, nicID string) (*FirewallRules, error) {
url := fwruleColPath(dcID, serverID, nicID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRules{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListFirewallRules(dcID string, serverID string, nicID string) (*FirewallRules, error) {
url := fwruleColPath(dcID, serverID, nicID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRules{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListFirewallRules",
"(",
"dcID",
"string",
",",
"serverID",
"string",
",",
"nicID",
"string",
")",
"(",
"*",
"FirewallRules",
",",
"error",
")",
"{",
"url",
":=",
"fwruleColPath",
"(",
"dcID",
",",
"serverID",
",",
... | //ListFirewallRules lists all firewall rules | [
"ListFirewallRules",
"lists",
"all",
"firewall",
"rules"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/firewallrule.go#L45-L50 | test |
profitbricks/profitbricks-sdk-go | firewallrule.go | GetFirewallRule | func (c *Client) GetFirewallRule(dcID string, serverID string, nicID string, fwID string) (*FirewallRule, error) {
url := fwrulePath(dcID, serverID, nicID, fwID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRule{}
err := c.client.Get(url, ret, http.StatusOK)
return... | go | func (c *Client) GetFirewallRule(dcID string, serverID string, nicID string, fwID string) (*FirewallRule, error) {
url := fwrulePath(dcID, serverID, nicID, fwID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRule{}
err := c.client.Get(url, ret, http.StatusOK)
return... | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetFirewallRule",
"(",
"dcID",
"string",
",",
"serverID",
"string",
",",
"nicID",
"string",
",",
"fwID",
"string",
")",
"(",
"*",
"FirewallRule",
",",
"error",
")",
"{",
"url",
":=",
"fwrulePath",
"(",
"dcID",
","... | //GetFirewallRule gets a firewall rule | [
"GetFirewallRule",
"gets",
"a",
"firewall",
"rule"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/firewallrule.go#L53-L58 | test |
profitbricks/profitbricks-sdk-go | firewallrule.go | CreateFirewallRule | func (c *Client) CreateFirewallRule(dcID string, serverID string, nicID string, fw FirewallRule) (*FirewallRule, error) {
url := fwruleColPath(dcID, serverID, nicID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRule{}
err := c.client.Post(url, fw, ret, http.StatusAc... | go | func (c *Client) CreateFirewallRule(dcID string, serverID string, nicID string, fw FirewallRule) (*FirewallRule, error) {
url := fwruleColPath(dcID, serverID, nicID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRule{}
err := c.client.Post(url, fw, ret, http.StatusAc... | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateFirewallRule",
"(",
"dcID",
"string",
",",
"serverID",
"string",
",",
"nicID",
"string",
",",
"fw",
"FirewallRule",
")",
"(",
"*",
"FirewallRule",
",",
"error",
")",
"{",
"url",
":=",
"fwruleColPath",
"(",
"dc... | //CreateFirewallRule creates a firewall rule | [
"CreateFirewallRule",
"creates",
"a",
"firewall",
"rule"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/firewallrule.go#L61-L66 | test |
profitbricks/profitbricks-sdk-go | firewallrule.go | UpdateFirewallRule | func (c *Client) UpdateFirewallRule(dcID string, serverID string, nicID string, fwID string, obj FirewallruleProperties) (*FirewallRule, error) {
url := fwrulePath(dcID, serverID, nicID, fwID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRule{}
err := c.client.Patch... | go | func (c *Client) UpdateFirewallRule(dcID string, serverID string, nicID string, fwID string, obj FirewallruleProperties) (*FirewallRule, error) {
url := fwrulePath(dcID, serverID, nicID, fwID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &FirewallRule{}
err := c.client.Patch... | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateFirewallRule",
"(",
"dcID",
"string",
",",
"serverID",
"string",
",",
"nicID",
"string",
",",
"fwID",
"string",
",",
"obj",
"FirewallruleProperties",
")",
"(",
"*",
"FirewallRule",
",",
"error",
")",
"{",
"url",... | //UpdateFirewallRule updates a firewall rule | [
"UpdateFirewallRule",
"updates",
"a",
"firewall",
"rule"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/firewallrule.go#L69-L74 | test |
profitbricks/profitbricks-sdk-go | firewallrule.go | DeleteFirewallRule | func (c *Client) DeleteFirewallRule(dcID string, serverID string, nicID string, fwID string) (*http.Header, error) {
url := fwrulePath(dcID, serverID, nicID, fwID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepte... | go | func (c *Client) DeleteFirewallRule(dcID string, serverID string, nicID string, fwID string) (*http.Header, error) {
url := fwrulePath(dcID, serverID, nicID, fwID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepte... | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteFirewallRule",
"(",
"dcID",
"string",
",",
"serverID",
"string",
",",
"nicID",
"string",
",",
"fwID",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"fwrulePath",
"(",
... | //DeleteFirewallRule deletes a firewall rule | [
"DeleteFirewallRule",
"deletes",
"a",
"firewall",
"rule"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/firewallrule.go#L77-L82 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | ListLoadbalancers | func (c *Client) ListLoadbalancers(dcid string) (*Loadbalancers, error) {
url := lbalColPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Loadbalancers{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListLoadbalancers(dcid string) (*Loadbalancers, error) {
url := lbalColPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Loadbalancers{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListLoadbalancers",
"(",
"dcid",
"string",
")",
"(",
"*",
"Loadbalancers",
",",
"error",
")",
"{",
"url",
":=",
"lbalColPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&p... | //ListLoadbalancers returns a Collection struct for loadbalancers in the Datacenter | [
"ListLoadbalancers",
"returns",
"a",
"Collection",
"struct",
"for",
"loadbalancers",
"in",
"the",
"Datacenter"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L54-L60 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | GetLoadbalancer | func (c *Client) GetLoadbalancer(dcid, lbalid string) (*Loadbalancer, error) {
url := lbalPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Loadbalancer{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetLoadbalancer(dcid, lbalid string) (*Loadbalancer, error) {
url := lbalPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Loadbalancer{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetLoadbalancer",
"(",
"dcid",
",",
"lbalid",
"string",
")",
"(",
"*",
"Loadbalancer",
",",
"error",
")",
"{",
"url",
":=",
"lbalPath",
"(",
"dcid",
",",
"lbalid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",... | //GetLoadbalancer pulls data for the Loadbalancer where id = lbalid returns a Instance struct | [
"GetLoadbalancer",
"pulls",
"data",
"for",
"the",
"Loadbalancer",
"where",
"id",
"=",
"lbalid",
"returns",
"a",
"Instance",
"struct"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L72-L77 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | UpdateLoadbalancer | func (c *Client) UpdateLoadbalancer(dcid string, lbalid string, obj LoadbalancerProperties) (*Loadbalancer, error) {
url := lbalPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Loadbalancer{}
err := c.client.Patch(url, obj, ret, http.StatusAccepted)
return r... | go | func (c *Client) UpdateLoadbalancer(dcid string, lbalid string, obj LoadbalancerProperties) (*Loadbalancer, error) {
url := lbalPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Loadbalancer{}
err := c.client.Patch(url, obj, ret, http.StatusAccepted)
return r... | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateLoadbalancer",
"(",
"dcid",
"string",
",",
"lbalid",
"string",
",",
"obj",
"LoadbalancerProperties",
")",
"(",
"*",
"Loadbalancer",
",",
"error",
")",
"{",
"url",
":=",
"lbalPath",
"(",
"dcid",
",",
"lbalid",
... | //UpdateLoadbalancer updates a load balancer | [
"UpdateLoadbalancer",
"updates",
"a",
"load",
"balancer"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L80-L85 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | DeleteLoadbalancer | func (c *Client) DeleteLoadbalancer(dcid, lbalid string) (*http.Header, error) {
url := lbalPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) DeleteLoadbalancer(dcid, lbalid string) (*http.Header, error) {
url := lbalPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteLoadbalancer",
"(",
"dcid",
",",
"lbalid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"lbalPath",
"(",
"dcid",
",",
"lbalid",
")",
"+",
"`?depth=`",
"+",
"c",
".... | //DeleteLoadbalancer deletes a load balancer | [
"DeleteLoadbalancer",
"deletes",
"a",
"load",
"balancer"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L88-L93 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | ListBalancedNics | func (c *Client) ListBalancedNics(dcid, lbalid string) (*Nics, error) {
url := balnicColPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nics{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListBalancedNics(dcid, lbalid string) (*Nics, error) {
url := balnicColPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nics{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListBalancedNics",
"(",
"dcid",
",",
"lbalid",
"string",
")",
"(",
"*",
"Nics",
",",
"error",
")",
"{",
"url",
":=",
"balnicColPath",
"(",
"dcid",
",",
"lbalid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
... | //ListBalancedNics lists balanced nics | [
"ListBalancedNics",
"lists",
"balanced",
"nics"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L96-L101 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | AssociateNic | func (c *Client) AssociateNic(dcid string, lbalid string, nicid string) (*Nic, error) {
sm := map[string]string{"id": nicid}
url := balnicColPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Post(url, sm, ret, http.StatusAccepted)
retur... | go | func (c *Client) AssociateNic(dcid string, lbalid string, nicid string) (*Nic, error) {
sm := map[string]string{"id": nicid}
url := balnicColPath(dcid, lbalid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Post(url, sm, ret, http.StatusAccepted)
retur... | [
"func",
"(",
"c",
"*",
"Client",
")",
"AssociateNic",
"(",
"dcid",
"string",
",",
"lbalid",
"string",
",",
"nicid",
"string",
")",
"(",
"*",
"Nic",
",",
"error",
")",
"{",
"sm",
":=",
"map",
"[",
"string",
"]",
"string",
"{",
"\"id\"",
":",
"nicid"... | //AssociateNic attach a nic to load balancer | [
"AssociateNic",
"attach",
"a",
"nic",
"to",
"load",
"balancer"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L104-L110 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | GetBalancedNic | func (c *Client) GetBalancedNic(dcid, lbalid, balnicid string) (*Nic, error) {
url := balnicPath(dcid, lbalid, balnicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetBalancedNic(dcid, lbalid, balnicid string) (*Nic, error) {
url := balnicPath(dcid, lbalid, balnicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetBalancedNic",
"(",
"dcid",
",",
"lbalid",
",",
"balnicid",
"string",
")",
"(",
"*",
"Nic",
",",
"error",
")",
"{",
"url",
":=",
"balnicPath",
"(",
"dcid",
",",
"lbalid",
",",
"balnicid",
")",
"+",
"`?depth=`"... | //GetBalancedNic gets a balanced nic | [
"GetBalancedNic",
"gets",
"a",
"balanced",
"nic"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L113-L118 | test |
profitbricks/profitbricks-sdk-go | loadbalancer.go | DeleteBalancedNic | func (c *Client) DeleteBalancedNic(dcid, lbalid, balnicid string) (*http.Header, error) {
url := balnicPath(dcid, lbalid, balnicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) DeleteBalancedNic(dcid, lbalid, balnicid string) (*http.Header, error) {
url := balnicPath(dcid, lbalid, balnicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteBalancedNic",
"(",
"dcid",
",",
"lbalid",
",",
"balnicid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"balnicPath",
"(",
"dcid",
",",
"lbalid",
",",
"balnicid",
")... | //DeleteBalancedNic removes a balanced nic | [
"DeleteBalancedNic",
"removes",
"a",
"balanced",
"nic"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/loadbalancer.go#L121-L126 | test |
profitbricks/profitbricks-sdk-go | lan.go | ListLans | func (c *Client) ListLans(dcid string) (*Lans, error) {
url := lanColPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Lans{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListLans(dcid string) (*Lans, error) {
url := lanColPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Lans{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListLans",
"(",
"dcid",
"string",
")",
"(",
"*",
"Lans",
",",
"error",
")",
"{",
"url",
":=",
"lanColPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
"+",
... | // ListLans returns a Collection for lans in the Datacenter | [
"ListLans",
"returns",
"a",
"Collection",
"for",
"lans",
"in",
"the",
"Datacenter"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/lan.go#L59-L64 | test |
profitbricks/profitbricks-sdk-go | lan.go | GetLan | func (c *Client) GetLan(dcid, lanid string) (*Lan, error) {
url := lanPath(dcid, lanid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Lan{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetLan(dcid, lanid string) (*Lan, error) {
url := lanPath(dcid, lanid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Lan{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetLan",
"(",
"dcid",
",",
"lanid",
"string",
")",
"(",
"*",
"Lan",
",",
"error",
")",
"{",
"url",
":=",
"lanPath",
"(",
"dcid",
",",
"lanid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
... | // GetLan pulls data for the lan where id = lanid returns an Instance struct | [
"GetLan",
"pulls",
"data",
"for",
"the",
"lan",
"where",
"id",
"=",
"lanid",
"returns",
"an",
"Instance",
"struct"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/lan.go#L76-L81 | test |
profitbricks/profitbricks-sdk-go | lan.go | DeleteLan | func (c *Client) DeleteLan(dcid, lanid string) (*http.Header, error) {
url := lanPath(dcid, lanid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) DeleteLan(dcid, lanid string) (*http.Header, error) {
url := lanPath(dcid, lanid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteLan",
"(",
"dcid",
",",
"lanid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"lanPath",
"(",
"dcid",
",",
"lanid",
")",
"\n",
"ret",
":=",
"&",
"http",
".",
"... | // DeleteLan deletes a lan where id == lanid | [
"DeleteLan",
"deletes",
"a",
"lan",
"where",
"id",
"==",
"lanid"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/lan.go#L92-L97 | test |
profitbricks/profitbricks-sdk-go | nic.go | ListNics | func (c *Client) ListNics(dcid, srvid string) (*Nics, error) {
url := nicColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nics{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListNics(dcid, srvid string) (*Nics, error) {
url := nicColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nics{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListNics",
"(",
"dcid",
",",
"srvid",
"string",
")",
"(",
"*",
"Nics",
",",
"error",
")",
"{",
"url",
":=",
"nicColPath",
"(",
"dcid",
",",
"srvid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"dept... | // ListNics returns a Nics struct collection | [
"ListNics",
"returns",
"a",
"Nics",
"struct",
"collection"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/nic.go#L49-L54 | test |
profitbricks/profitbricks-sdk-go | nic.go | CreateNic | func (c *Client) CreateNic(dcid string, srvid string, nic Nic) (*Nic, error) {
url := nicColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Post(url, nic, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) CreateNic(dcid string, srvid string, nic Nic) (*Nic, error) {
url := nicColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Post(url, nic, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateNic",
"(",
"dcid",
"string",
",",
"srvid",
"string",
",",
"nic",
"Nic",
")",
"(",
"*",
"Nic",
",",
"error",
")",
"{",
"url",
":=",
"nicColPath",
"(",
"dcid",
",",
"srvid",
")",
"+",
"`?depth=`",
"+",
"... | // CreateNic creates a nic on a server | [
"CreateNic",
"creates",
"a",
"nic",
"on",
"a",
"server"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/nic.go#L57-L64 | test |
profitbricks/profitbricks-sdk-go | nic.go | GetNic | func (c *Client) GetNic(dcid, srvid, nicid string) (*Nic, error) {
url := nicPath(dcid, srvid, nicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetNic(dcid, srvid, nicid string) (*Nic, error) {
url := nicPath(dcid, srvid, nicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetNic",
"(",
"dcid",
",",
"srvid",
",",
"nicid",
"string",
")",
"(",
"*",
"Nic",
",",
"error",
")",
"{",
"url",
":=",
"nicPath",
"(",
"dcid",
",",
"srvid",
",",
"nicid",
")",
"+",
"`?depth=`",
"+",
"c",
"... | // GetNic pulls data for the nic where id = srvid returns a Instance struct | [
"GetNic",
"pulls",
"data",
"for",
"the",
"nic",
"where",
"id",
"=",
"srvid",
"returns",
"a",
"Instance",
"struct"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/nic.go#L67-L73 | test |
profitbricks/profitbricks-sdk-go | nic.go | UpdateNic | func (c *Client) UpdateNic(dcid string, srvid string, nicid string, obj NicProperties) (*Nic, error) {
url := nicPath(dcid, srvid, nicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Patch(url, obj, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) UpdateNic(dcid string, srvid string, nicid string, obj NicProperties) (*Nic, error) {
url := nicPath(dcid, srvid, nicid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Nic{}
err := c.client.Patch(url, obj, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateNic",
"(",
"dcid",
"string",
",",
"srvid",
"string",
",",
"nicid",
"string",
",",
"obj",
"NicProperties",
")",
"(",
"*",
"Nic",
",",
"error",
")",
"{",
"url",
":=",
"nicPath",
"(",
"dcid",
",",
"srvid",
... | // UpdateNic partial update of nic properties | [
"UpdateNic",
"partial",
"update",
"of",
"nic",
"properties"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/nic.go#L76-L83 | test |
profitbricks/profitbricks-sdk-go | nic.go | DeleteNic | func (c *Client) DeleteNic(dcid, srvid, nicid string) (*http.Header, error) {
url := nicPath(dcid, srvid, nicid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) DeleteNic(dcid, srvid, nicid string) (*http.Header, error) {
url := nicPath(dcid, srvid, nicid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteNic",
"(",
"dcid",
",",
"srvid",
",",
"nicid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"nicPath",
"(",
"dcid",
",",
"srvid",
",",
"nicid",
")",
"\n",
"ret",... | // DeleteNic deletes the nic where id=nicid and returns a Resp struct | [
"DeleteNic",
"deletes",
"the",
"nic",
"where",
"id",
"=",
"nicid",
"and",
"returns",
"a",
"Resp",
"struct"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/nic.go#L86-L91 | test |
profitbricks/profitbricks-sdk-go | snapshot.go | ListSnapshots | func (c *Client) ListSnapshots() (*Snapshots, error) {
url := snapshotColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Snapshots{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListSnapshots() (*Snapshots, error) {
url := snapshotColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Snapshots{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListSnapshots",
"(",
")",
"(",
"*",
"Snapshots",
",",
"error",
")",
"{",
"url",
":=",
"snapshotColPath",
"(",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
"+",
"strconv",
".",... | //ListSnapshots lists all snapshots | [
"ListSnapshots",
"lists",
"all",
"snapshots"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/snapshot.go#L51-L56 | test |
profitbricks/profitbricks-sdk-go | snapshot.go | GetSnapshot | func (c *Client) GetSnapshot(snapshotID string) (*Snapshot, error) {
url := snapshotColPath() + slash(snapshotID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Snapshot{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetSnapshot(snapshotID string) (*Snapshot, error) {
url := snapshotColPath() + slash(snapshotID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Snapshot{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetSnapshot",
"(",
"snapshotID",
"string",
")",
"(",
"*",
"Snapshot",
",",
"error",
")",
"{",
"url",
":=",
"snapshotColPath",
"(",
")",
"+",
"slash",
"(",
"snapshotID",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"cli... | //GetSnapshot gets a specific snapshot | [
"GetSnapshot",
"gets",
"a",
"specific",
"snapshot"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/snapshot.go#L59-L64 | test |
profitbricks/profitbricks-sdk-go | snapshot.go | DeleteSnapshot | func (c *Client) DeleteSnapshot(snapshotID string) (*http.Header, error) {
url := snapshotColPath() + slash(snapshotID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) DeleteSnapshot(snapshotID string) (*http.Header, error) {
url := snapshotColPath() + slash(snapshotID) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteSnapshot",
"(",
"snapshotID",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"snapshotColPath",
"(",
")",
"+",
"slash",
"(",
"snapshotID",
")",
"+",
"`?depth=`",
"+",
... | // DeleteSnapshot deletes a specified snapshot | [
"DeleteSnapshot",
"deletes",
"a",
"specified",
"snapshot"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/snapshot.go#L67-L72 | test |
profitbricks/profitbricks-sdk-go | snapshot.go | UpdateSnapshot | func (c *Client) UpdateSnapshot(snapshotID string, request SnapshotProperties) (*Snapshot, error) {
url := snapshotColPath() + slash(snapshotID)
ret := &Snapshot{}
err := c.client.Patch(url, request, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) UpdateSnapshot(snapshotID string, request SnapshotProperties) (*Snapshot, error) {
url := snapshotColPath() + slash(snapshotID)
ret := &Snapshot{}
err := c.client.Patch(url, request, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateSnapshot",
"(",
"snapshotID",
"string",
",",
"request",
"SnapshotProperties",
")",
"(",
"*",
"Snapshot",
",",
"error",
")",
"{",
"url",
":=",
"snapshotColPath",
"(",
")",
"+",
"slash",
"(",
"snapshotID",
")",
... | // UpdateSnapshot updates a snapshot | [
"UpdateSnapshot",
"updates",
"a",
"snapshot"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/snapshot.go#L75-L80 | test |
profitbricks/profitbricks-sdk-go | ipblock.go | ListIPBlocks | func (c *Client) ListIPBlocks() (*IPBlocks, error) {
url := ipblockColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlocks{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListIPBlocks() (*IPBlocks, error) {
url := ipblockColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlocks{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListIPBlocks",
"(",
")",
"(",
"*",
"IPBlocks",
",",
"error",
")",
"{",
"url",
":=",
"ipblockColPath",
"(",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
"+",
"strconv",
".",
... | //ListIPBlocks lists all IP blocks | [
"ListIPBlocks",
"lists",
"all",
"IP",
"blocks"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/ipblock.go#L40-L45 | test |
profitbricks/profitbricks-sdk-go | ipblock.go | ReserveIPBlock | func (c *Client) ReserveIPBlock(request IPBlock) (*IPBlock, error) {
url := ipblockColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlock{}
err := c.client.Post(url, request, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) ReserveIPBlock(request IPBlock) (*IPBlock, error) {
url := ipblockColPath() + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlock{}
err := c.client.Post(url, request, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ReserveIPBlock",
"(",
"request",
"IPBlock",
")",
"(",
"*",
"IPBlock",
",",
"error",
")",
"{",
"url",
":=",
"ipblockColPath",
"(",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
... | //ReserveIPBlock creates an IP block | [
"ReserveIPBlock",
"creates",
"an",
"IP",
"block"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/ipblock.go#L48-L53 | test |
profitbricks/profitbricks-sdk-go | ipblock.go | GetIPBlock | func (c *Client) GetIPBlock(ipblockid string) (*IPBlock, error) {
url := ipblockPath(ipblockid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlock{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetIPBlock(ipblockid string) (*IPBlock, error) {
url := ipblockPath(ipblockid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlock{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetIPBlock",
"(",
"ipblockid",
"string",
")",
"(",
"*",
"IPBlock",
",",
"error",
")",
"{",
"url",
":=",
"ipblockPath",
"(",
"ipblockid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pret... | //GetIPBlock gets an IP blocks | [
"GetIPBlock",
"gets",
"an",
"IP",
"blocks"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/ipblock.go#L56-L61 | test |
profitbricks/profitbricks-sdk-go | ipblock.go | UpdateIPBlock | func (c *Client) UpdateIPBlock(ipblockid string, props IPBlockProperties) (*IPBlock, error) {
url := ipblockPath(ipblockid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlock{}
err := c.client.Patch(url, props, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) UpdateIPBlock(ipblockid string, props IPBlockProperties) (*IPBlock, error) {
url := ipblockPath(ipblockid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &IPBlock{}
err := c.client.Patch(url, props, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateIPBlock",
"(",
"ipblockid",
"string",
",",
"props",
"IPBlockProperties",
")",
"(",
"*",
"IPBlock",
",",
"error",
")",
"{",
"url",
":=",
"ipblockPath",
"(",
"ipblockid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
... | // UpdateIPBlock partial update of ipblock properties | [
"UpdateIPBlock",
"partial",
"update",
"of",
"ipblock",
"properties"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/ipblock.go#L64-L69 | test |
profitbricks/profitbricks-sdk-go | ipblock.go | ReleaseIPBlock | func (c *Client) ReleaseIPBlock(ipblockid string) (*http.Header, error) {
url := ipblockPath(ipblockid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) ReleaseIPBlock(ipblockid string) (*http.Header, error) {
url := ipblockPath(ipblockid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ReleaseIPBlock",
"(",
"ipblockid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"ipblockPath",
"(",
"ipblockid",
")",
"\n",
"ret",
":=",
"&",
"http",
".",
"Header",
"{",
... | //ReleaseIPBlock deletes an IP block | [
"ReleaseIPBlock",
"deletes",
"an",
"IP",
"block"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/ipblock.go#L72-L77 | test |
profitbricks/profitbricks-sdk-go | volume.go | ListVolumes | func (c *Client) ListVolumes(dcid string) (*Volumes, error) {
url := volumeColPath(dcid) + `?depth=` + c.client.depth
ret := &Volumes{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListVolumes(dcid string) (*Volumes, error) {
url := volumeColPath(dcid) + `?depth=` + c.client.depth
ret := &Volumes{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListVolumes",
"(",
"dcid",
"string",
")",
"(",
"*",
"Volumes",
",",
"error",
")",
"{",
"url",
":=",
"volumeColPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"\n",
"ret",
":="... | // ListVolumes returns a Collection struct for volumes in the Datacenter | [
"ListVolumes",
"returns",
"a",
"Collection",
"struct",
"for",
"volumes",
"in",
"the",
"Datacenter"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/volume.go#L58-L63 | test |
profitbricks/profitbricks-sdk-go | volume.go | GetVolume | func (c *Client) GetVolume(dcid string, volumeID string) (*Volume, error) {
url := volumePath(dcid, volumeID) + `?depth=` + c.client.depth
ret := &Volume{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetVolume(dcid string, volumeID string) (*Volume, error) {
url := volumePath(dcid, volumeID) + `?depth=` + c.client.depth
ret := &Volume{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetVolume",
"(",
"dcid",
"string",
",",
"volumeID",
"string",
")",
"(",
"*",
"Volume",
",",
"error",
")",
"{",
"url",
":=",
"volumePath",
"(",
"dcid",
",",
"volumeID",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"cl... | //GetVolume gets a volume | [
"GetVolume",
"gets",
"a",
"volume"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/volume.go#L66-L71 | test |
profitbricks/profitbricks-sdk-go | volume.go | UpdateVolume | func (c *Client) UpdateVolume(dcid string, volid string, request VolumeProperties) (*Volume, error) {
url := volumePath(dcid, volid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Volume{}
err := c.client.Patch(url, request, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) UpdateVolume(dcid string, volid string, request VolumeProperties) (*Volume, error) {
url := volumePath(dcid, volid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Volume{}
err := c.client.Patch(url, request, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"UpdateVolume",
"(",
"dcid",
"string",
",",
"volid",
"string",
",",
"request",
"VolumeProperties",
")",
"(",
"*",
"Volume",
",",
"error",
")",
"{",
"url",
":=",
"volumePath",
"(",
"dcid",
",",
"volid",
")",
"+",
... | //UpdateVolume updates a volume | [
"UpdateVolume",
"updates",
"a",
"volume"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/volume.go#L74-L79 | test |
profitbricks/profitbricks-sdk-go | volume.go | CreateVolume | func (c *Client) CreateVolume(dcid string, request Volume) (*Volume, error) {
url := volumeColPath(dcid) + `?depth=` + c.client.depth
ret := &Volume{}
err := c.client.Post(url, request, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) CreateVolume(dcid string, request Volume) (*Volume, error) {
url := volumeColPath(dcid) + `?depth=` + c.client.depth
ret := &Volume{}
err := c.client.Post(url, request, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateVolume",
"(",
"dcid",
"string",
",",
"request",
"Volume",
")",
"(",
"*",
"Volume",
",",
"error",
")",
"{",
"url",
":=",
"volumeColPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
... | //CreateVolume creates a volume | [
"CreateVolume",
"creates",
"a",
"volume"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/volume.go#L82-L87 | test |
profitbricks/profitbricks-sdk-go | volume.go | DeleteVolume | func (c *Client) DeleteVolume(dcid, volid string) (*http.Header, error) {
url := volumePath(dcid, volid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) DeleteVolume(dcid, volid string) (*http.Header, error) {
url := volumePath(dcid, volid)
ret := &http.Header{}
err := c.client.Delete(url, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteVolume",
"(",
"dcid",
",",
"volid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"url",
":=",
"volumePath",
"(",
"dcid",
",",
"volid",
")",
"\n",
"ret",
":=",
"&",
"http",
".... | // DeleteVolume deletes a volume | [
"DeleteVolume",
"deletes",
"a",
"volume"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/volume.go#L90-L95 | test |
profitbricks/profitbricks-sdk-go | volume.go | CreateSnapshot | func (c *Client) CreateSnapshot(dcid string, volid string, name string, description string) (*Snapshot, error) {
path := volumePath(dcid, volid) + "/create-snapshot"
data := url.Values{}
data.Set("name", name)
data.Add("description", description)
ret := &Snapshot{}
err := c.client.Post(path, data, ret, http.Stat... | go | func (c *Client) CreateSnapshot(dcid string, volid string, name string, description string) (*Snapshot, error) {
path := volumePath(dcid, volid) + "/create-snapshot"
data := url.Values{}
data.Set("name", name)
data.Add("description", description)
ret := &Snapshot{}
err := c.client.Post(path, data, ret, http.Stat... | [
"func",
"(",
"c",
"*",
"Client",
")",
"CreateSnapshot",
"(",
"dcid",
"string",
",",
"volid",
"string",
",",
"name",
"string",
",",
"description",
"string",
")",
"(",
"*",
"Snapshot",
",",
"error",
")",
"{",
"path",
":=",
"volumePath",
"(",
"dcid",
",",... | //CreateSnapshot creates a volume snapshot | [
"CreateSnapshot",
"creates",
"a",
"volume",
"snapshot"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/volume.go#L98-L107 | test |
profitbricks/profitbricks-sdk-go | volume.go | RestoreSnapshot | func (c *Client) RestoreSnapshot(dcid string, volid string, snapshotID string) (*http.Header, error) {
path := volumePath(dcid, volid) + "/restore-snapshot"
data := url.Values{}
data.Set("snapshotId", snapshotID)
ret := &http.Header{}
err := c.client.Post(path, data, ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) RestoreSnapshot(dcid string, volid string, snapshotID string) (*http.Header, error) {
path := volumePath(dcid, volid) + "/restore-snapshot"
data := url.Values{}
data.Set("snapshotId", snapshotID)
ret := &http.Header{}
err := c.client.Post(path, data, ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"RestoreSnapshot",
"(",
"dcid",
"string",
",",
"volid",
"string",
",",
"snapshotID",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"path",
":=",
"volumePath",
"(",
"dcid",
",",
"volid",
... | // RestoreSnapshot restores a volume with provided snapshot | [
"RestoreSnapshot",
"restores",
"a",
"volume",
"with",
"provided",
"snapshot"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/volume.go#L110-L117 | test |
profitbricks/profitbricks-sdk-go | server.go | ListServers | func (c *Client) ListServers(dcid string) (*Servers, error) {
url := serverColPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Servers{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListServers(dcid string) (*Servers, error) {
url := serverColPath(dcid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Servers{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListServers",
"(",
"dcid",
"string",
")",
"(",
"*",
"Servers",
",",
"error",
")",
"{",
"url",
":=",
"serverColPath",
"(",
"dcid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"depth",
"+",
"`&pretty=`",
... | // ListServers returns a server struct collection | [
"ListServers",
"returns",
"a",
"server",
"struct",
"collection"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/server.go#L59-L64 | test |
profitbricks/profitbricks-sdk-go | server.go | GetServer | func (c *Client) GetServer(dcid, srvid string) (*Server, error) {
url := serverPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Server{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) GetServer(dcid, srvid string) (*Server, error) {
url := serverPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Server{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"GetServer",
"(",
"dcid",
",",
"srvid",
"string",
")",
"(",
"*",
"Server",
",",
"error",
")",
"{",
"url",
":=",
"serverPath",
"(",
"dcid",
",",
"srvid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"client",
".",
"d... | // GetServer pulls data for the server where id = srvid returns a Instance struct | [
"GetServer",
"pulls",
"data",
"for",
"the",
"server",
"where",
"id",
"=",
"srvid",
"returns",
"a",
"Instance",
"struct"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/server.go#L75-L80 | test |
profitbricks/profitbricks-sdk-go | server.go | DeleteServer | func (c *Client) DeleteServer(dcid, srvid string) (*http.Header, error) {
ret := &http.Header{}
err := c.client.Delete(serverPath(dcid, srvid), ret, http.StatusAccepted)
return ret, err
} | go | func (c *Client) DeleteServer(dcid, srvid string) (*http.Header, error) {
ret := &http.Header{}
err := c.client.Delete(serverPath(dcid, srvid), ret, http.StatusAccepted)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"DeleteServer",
"(",
"dcid",
",",
"srvid",
"string",
")",
"(",
"*",
"http",
".",
"Header",
",",
"error",
")",
"{",
"ret",
":=",
"&",
"http",
".",
"Header",
"{",
"}",
"\n",
"err",
":=",
"c",
".",
"client",
"... | // DeleteServer deletes the server where id=srvid and returns Resp struct | [
"DeleteServer",
"deletes",
"the",
"server",
"where",
"id",
"=",
"srvid",
"and",
"returns",
"Resp",
"struct"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/server.go#L92-L96 | test |
profitbricks/profitbricks-sdk-go | server.go | ListAttachedCdroms | func (c *Client) ListAttachedCdroms(dcid, srvid string) (*Images, error) {
url := serverCdromColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Images{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | go | func (c *Client) ListAttachedCdroms(dcid, srvid string) (*Images, error) {
url := serverCdromColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Images{}
err := c.client.Get(url, ret, http.StatusOK)
return ret, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListAttachedCdroms",
"(",
"dcid",
",",
"srvid",
"string",
")",
"(",
"*",
"Images",
",",
"error",
")",
"{",
"url",
":=",
"serverCdromColPath",
"(",
"dcid",
",",
"srvid",
")",
"+",
"`?depth=`",
"+",
"c",
".",
"cli... | //ListAttachedCdroms returns list of attached cd roms | [
"ListAttachedCdroms",
"returns",
"list",
"of",
"attached",
"cd",
"roms"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/server.go#L99-L104 | test |
profitbricks/profitbricks-sdk-go | server.go | AttachCdrom | func (c *Client) AttachCdrom(dcid string, srvid string, cdid string) (*Image, error) {
data := struct {
ID string `json:"id,omitempty"`
}{
cdid,
}
url := serverCdromColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Image{}
err := c.client.Post(url, da... | go | func (c *Client) AttachCdrom(dcid string, srvid string, cdid string) (*Image, error) {
data := struct {
ID string `json:"id,omitempty"`
}{
cdid,
}
url := serverCdromColPath(dcid, srvid) + `?depth=` + c.client.depth + `&pretty=` + strconv.FormatBool(c.client.pretty)
ret := &Image{}
err := c.client.Post(url, da... | [
"func",
"(",
"c",
"*",
"Client",
")",
"AttachCdrom",
"(",
"dcid",
"string",
",",
"srvid",
"string",
",",
"cdid",
"string",
")",
"(",
"*",
"Image",
",",
"error",
")",
"{",
"data",
":=",
"struct",
"{",
"ID",
"string",
"`json:\"id,omitempty\"`",
"\n",
"}"... | //AttachCdrom attaches a CD rom | [
"AttachCdrom",
"attaches",
"a",
"CD",
"rom"
] | 1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4 | https://github.com/profitbricks/profitbricks-sdk-go/blob/1d2db5f00bf5dd0b6c29273541c71c60cdf4d4d4/server.go#L107-L117 | test |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.