id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
136,600 | cloudfoundry-community/firehose-to-syslog | stats/stats_server.go | Start | func (s *Server) Start() {
http.HandleFunc("/", index)
http.Handle("/stats/app", &statsHandler{
stats: s.Stats,
logger: s.Logger,
})
http.HandleFunc("/stats/runtime", stats_api.Handler)
port := DefaultPort
if p := os.Getenv(EnvPort); p != "" {
port = p
}
s.Logger.Printf("[INFO] Start server listening ... | go | func (s *Server) Start() {
http.HandleFunc("/", index)
http.Handle("/stats/app", &statsHandler{
stats: s.Stats,
logger: s.Logger,
})
http.HandleFunc("/stats/runtime", stats_api.Handler)
port := DefaultPort
if p := os.Getenv(EnvPort); p != "" {
port = p
}
s.Logger.Printf("[INFO] Start server listening ... | [
"func",
"(",
"s",
"*",
"Server",
")",
"Start",
"(",
")",
"{",
"http",
".",
"HandleFunc",
"(",
"\"",
"\"",
",",
"index",
")",
"\n",
"http",
".",
"Handle",
"(",
"\"",
"\"",
",",
"&",
"statsHandler",
"{",
"stats",
":",
"s",
".",
"Stats",
",",
"log... | // Start starts listening. | [
"Start",
"starts",
"listening",
"."
] | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/stats/stats_server.go#L32-L50 |
136,601 | cloudfoundry-community/firehose-to-syslog | eventRouting/event_filter.go | HasIgnoreField | func HasIgnoreField(event *fevents.Event) bool {
ignored, hasIgnoredField := event.Fields["cf_ignored_app"]
delete(event.Fields, "cf_ignored_app")
return ignored == true && hasIgnoredField
} | go | func HasIgnoreField(event *fevents.Event) bool {
ignored, hasIgnoredField := event.Fields["cf_ignored_app"]
delete(event.Fields, "cf_ignored_app")
return ignored == true && hasIgnoredField
} | [
"func",
"HasIgnoreField",
"(",
"event",
"*",
"fevents",
".",
"Event",
")",
"bool",
"{",
"ignored",
",",
"hasIgnoredField",
":=",
"event",
".",
"Fields",
"[",
"\"",
"\"",
"]",
"\n",
"delete",
"(",
"event",
".",
"Fields",
",",
"\"",
"\"",
")",
"\n",
"r... | //HasIgnoreField Filter out the event has ignored app filed | [
"HasIgnoreField",
"Filter",
"out",
"the",
"event",
"has",
"ignored",
"app",
"filed"
] | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/eventRouting/event_filter.go#L13-L17 |
136,602 | cloudfoundry-community/firehose-to-syslog | eventRouting/event_filter.go | NotInCertainOrgs | func NotInCertainOrgs(orgFilters string) EventFilter {
return func(event *fevents.Event) bool {
orgName := event.Fields["cf_org_name"]
if orgFilters == "" || orgName == nil {
return false
}
//// TODO: No need to split for every record...
orgs := strings.Split(orgFilters, ",")
for _, org := range orgs {
... | go | func NotInCertainOrgs(orgFilters string) EventFilter {
return func(event *fevents.Event) bool {
orgName := event.Fields["cf_org_name"]
if orgFilters == "" || orgName == nil {
return false
}
//// TODO: No need to split for every record...
orgs := strings.Split(orgFilters, ",")
for _, org := range orgs {
... | [
"func",
"NotInCertainOrgs",
"(",
"orgFilters",
"string",
")",
"EventFilter",
"{",
"return",
"func",
"(",
"event",
"*",
"fevents",
".",
"Event",
")",
"bool",
"{",
"orgName",
":=",
"event",
".",
"Fields",
"[",
"\"",
"\"",
"]",
"\n",
"if",
"orgFilters",
"==... | //NotInCertainOrgs Filter out events not in certain orgs | [
"NotInCertainOrgs",
"Filter",
"out",
"events",
"not",
"in",
"certain",
"orgs"
] | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/eventRouting/event_filter.go#L20-L35 |
136,603 | cloudfoundry-community/firehose-to-syslog | diodes/one_to_one.go | NewOneToOne | func NewOneToOne(size int, alerter gendiodes.Alerter) *OneToOne {
return &OneToOne{
d: gendiodes.NewPoller(gendiodes.NewOneToOne(size, alerter)),
}
} | go | func NewOneToOne(size int, alerter gendiodes.Alerter) *OneToOne {
return &OneToOne{
d: gendiodes.NewPoller(gendiodes.NewOneToOne(size, alerter)),
}
} | [
"func",
"NewOneToOne",
"(",
"size",
"int",
",",
"alerter",
"gendiodes",
".",
"Alerter",
")",
"*",
"OneToOne",
"{",
"return",
"&",
"OneToOne",
"{",
"d",
":",
"gendiodes",
".",
"NewPoller",
"(",
"gendiodes",
".",
"NewOneToOne",
"(",
"size",
",",
"alerter",
... | // NewOneToOne initializes a new one to one diode of a given size and alerter.
// The alerter is called whenever data is dropped with an integer representing
// the number of byte slices that were dropped. | [
"NewOneToOne",
"initializes",
"a",
"new",
"one",
"to",
"one",
"diode",
"of",
"a",
"given",
"size",
"and",
"alerter",
".",
"The",
"alerter",
"is",
"called",
"whenever",
"data",
"is",
"dropped",
"with",
"an",
"integer",
"representing",
"the",
"number",
"of",
... | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/diodes/one_to_one.go#L14-L18 |
136,604 | cloudfoundry-community/firehose-to-syslog | caching/caching_lazyfill.go | normaliseAndSaveEntityToDatabase | func (c *CacheLazyFill) normaliseAndSaveEntityToDatabase(entityType, uuid string, nv *entity) error {
// Strip name suffixes if applicable. This is intended for blue green deployments,
// so that things like -venerable can be stripped from renamed apps
if entityType == "apps" {
for _, suffix := range c.config.Stri... | go | func (c *CacheLazyFill) normaliseAndSaveEntityToDatabase(entityType, uuid string, nv *entity) error {
// Strip name suffixes if applicable. This is intended for blue green deployments,
// so that things like -venerable can be stripped from renamed apps
if entityType == "apps" {
for _, suffix := range c.config.Stri... | [
"func",
"(",
"c",
"*",
"CacheLazyFill",
")",
"normaliseAndSaveEntityToDatabase",
"(",
"entityType",
",",
"uuid",
"string",
",",
"nv",
"*",
"entity",
")",
"error",
"{",
"// Strip name suffixes if applicable. This is intended for blue green deployments,",
"// so that things lik... | // normaliseAndSaveEntityToDatabase saves the entity to the cache, stripping app name prefixes if enabled
// entityType is "apps" or "spaces" or "orgs" - caller must validate
// uuid must be validated by caller
// nv may be modified by this function | [
"normaliseAndSaveEntityToDatabase",
"saves",
"the",
"entity",
"to",
"the",
"cache",
"stripping",
"app",
"name",
"prefixes",
"if",
"enabled",
"entityType",
"is",
"apps",
"or",
"spaces",
"or",
"orgs",
"-",
"caller",
"must",
"validate",
"uuid",
"must",
"be",
"valid... | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/caching/caching_lazyfill.go#L140-L157 |
136,605 | cloudfoundry-community/firehose-to-syslog | caching/caching_lazyfill.go | fetchEntityListFromAPI | func (c *CacheLazyFill) fetchEntityListFromAPI(entityType string) (map[string]*entity, error) {
url := fmt.Sprintf("/v2/%s?results-per-page=100", entityType)
rv := make(map[string]*entity)
for {
var md struct {
NextURL string `json:"next_url"`
Resources []*struct {
Metadata struct {
GUID string `j... | go | func (c *CacheLazyFill) fetchEntityListFromAPI(entityType string) (map[string]*entity, error) {
url := fmt.Sprintf("/v2/%s?results-per-page=100", entityType)
rv := make(map[string]*entity)
for {
var md struct {
NextURL string `json:"next_url"`
Resources []*struct {
Metadata struct {
GUID string `j... | [
"func",
"(",
"c",
"*",
"CacheLazyFill",
")",
"fetchEntityListFromAPI",
"(",
"entityType",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"*",
"entity",
",",
"error",
")",
"{",
"url",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"entityType",
")",... | // fetchEntityListFromAPI fetches a full list of all such entities from the server
// entityType must have been validated by the caller | [
"fetchEntityListFromAPI",
"fetches",
"a",
"full",
"list",
"of",
"all",
"such",
"entities",
"from",
"the",
"server",
"entityType",
"must",
"have",
"been",
"validated",
"by",
"the",
"caller"
] | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/caching/caching_lazyfill.go#L161-L190 |
136,606 | cloudfoundry-community/firehose-to-syslog | caching/caching_lazyfill.go | fetchEntityFromAPI | func (c *CacheLazyFill) fetchEntityFromAPI(entityType, guid string) (*entity, error) {
var md struct {
Entity *entity `json:"entity"`
}
err := c.makeRequestAndDecodeJSON(fmt.Sprintf("/v2/%s/%s", entityType, guid), &md)
if err != nil {
return nil, err
}
return md.Entity, nil
} | go | func (c *CacheLazyFill) fetchEntityFromAPI(entityType, guid string) (*entity, error) {
var md struct {
Entity *entity `json:"entity"`
}
err := c.makeRequestAndDecodeJSON(fmt.Sprintf("/v2/%s/%s", entityType, guid), &md)
if err != nil {
return nil, err
}
return md.Entity, nil
} | [
"func",
"(",
"c",
"*",
"CacheLazyFill",
")",
"fetchEntityFromAPI",
"(",
"entityType",
",",
"guid",
"string",
")",
"(",
"*",
"entity",
",",
"error",
")",
"{",
"var",
"md",
"struct",
"{",
"Entity",
"*",
"entity",
"`json:\"entity\"`",
"\n",
"}",
"\n",
"err"... | // both entityType and guid must have been validated by the caller | [
"both",
"entityType",
"and",
"guid",
"must",
"have",
"been",
"validated",
"by",
"the",
"caller"
] | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/caching/caching_lazyfill.go#L208-L217 |
136,607 | cloudfoundry-community/firehose-to-syslog | firehoseclient/firehoseclient.go | Start | func (f *FirehoseNozzle) Start(ctx context.Context) {
f.consumeFirehose()
wg.Add(2)
go f.routeEvent(ctx)
go f.ReadLogsBuffer(ctx)
} | go | func (f *FirehoseNozzle) Start(ctx context.Context) {
f.consumeFirehose()
wg.Add(2)
go f.routeEvent(ctx)
go f.ReadLogsBuffer(ctx)
} | [
"func",
"(",
"f",
"*",
"FirehoseNozzle",
")",
"Start",
"(",
"ctx",
"context",
".",
"Context",
")",
"{",
"f",
".",
"consumeFirehose",
"(",
")",
"\n",
"wg",
".",
"Add",
"(",
"2",
")",
"\n",
"go",
"f",
".",
"routeEvent",
"(",
"ctx",
")",
"\n",
"go",... | //Start consumer and reading ingest loop | [
"Start",
"consumer",
"and",
"reading",
"ingest",
"loop"
] | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/firehoseclient/firehoseclient.go#L71-L76 |
136,608 | cloudfoundry-community/firehose-to-syslog | firehoseclient/firehoseclient.go | StopReading | func (f *FirehoseNozzle) StopReading() {
close(f.stopRouting)
close(f.stopReading)
//Need to be sure both of the GoRoutine are stop
wg.Wait()
} | go | func (f *FirehoseNozzle) StopReading() {
close(f.stopRouting)
close(f.stopReading)
//Need to be sure both of the GoRoutine are stop
wg.Wait()
} | [
"func",
"(",
"f",
"*",
"FirehoseNozzle",
")",
"StopReading",
"(",
")",
"{",
"close",
"(",
"f",
".",
"stopRouting",
")",
"\n",
"close",
"(",
"f",
".",
"stopReading",
")",
"\n",
"//Need to be sure both of the GoRoutine are stop",
"wg",
".",
"Wait",
"(",
")",
... | //Stop reading loop | [
"Stop",
"reading",
"loop"
] | 0324cba8f46364119e36353997ec630e70bee008 | https://github.com/cloudfoundry-community/firehose-to-syslog/blob/0324cba8f46364119e36353997ec630e70bee008/firehoseclient/firehoseclient.go#L79-L84 |
136,609 | gorilla/http | client.go | Do | func (c *Client) Do(method, url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error) {
if headers == nil {
headers = make(map[string][]string)
}
u, err := stdurl.ParseRequestURI(url)
if err != nil {
return client.Status{}, nil, nil, err
}
host := u.Ho... | go | func (c *Client) Do(method, url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error) {
if headers == nil {
headers = make(map[string][]string)
}
u, err := stdurl.ParseRequestURI(url)
if err != nil {
return client.Status{}, nil, nil, err
}
host := u.Ho... | [
"func",
"(",
"c",
"*",
"Client",
")",
"Do",
"(",
"method",
",",
"url",
"string",
",",
"headers",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
",",
"body",
"io",
".",
"Reader",
")",
"(",
"client",
".",
"Status",
",",
"map",
"[",
"string",
"]",
... | // Do sends an HTTP request and returns an HTTP response. If the response body is non nil
// it must be closed. | [
"Do",
"sends",
"an",
"HTTP",
"request",
"and",
"returns",
"an",
"HTTP",
"response",
".",
"If",
"the",
"response",
"body",
"is",
"non",
"nil",
"it",
"must",
"be",
"closed",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client.go#L25-L75 |
136,610 | gorilla/http | client.go | Get | func (c *Client) Get(url string, headers map[string][]string) (client.Status, map[string][]string, io.ReadCloser, error) {
return c.Do("GET", url, headers, nil)
} | go | func (c *Client) Get(url string, headers map[string][]string) (client.Status, map[string][]string, io.ReadCloser, error) {
return c.Do("GET", url, headers, nil)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Get",
"(",
"url",
"string",
",",
"headers",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
")",
"(",
"client",
".",
"Status",
",",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
",",
"io",
".",
"ReadCloser",... | // Get sends a GET request. If the response body is non nil it must be closed. | [
"Get",
"sends",
"a",
"GET",
"request",
".",
"If",
"the",
"response",
"body",
"is",
"non",
"nil",
"it",
"must",
"be",
"closed",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client.go#L92-L94 |
136,611 | gorilla/http | client.go | Post | func (c *Client) Post(url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error) {
return c.Do("POST", url, headers, body)
} | go | func (c *Client) Post(url string, headers map[string][]string, body io.Reader) (client.Status, map[string][]string, io.ReadCloser, error) {
return c.Do("POST", url, headers, body)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Post",
"(",
"url",
"string",
",",
"headers",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
",",
"body",
"io",
".",
"Reader",
")",
"(",
"client",
".",
"Status",
",",
"map",
"[",
"string",
"]",
"[",
"]",
"s... | // Post sends a POST request, suppling the contents of the reader as the request body. | [
"Post",
"sends",
"a",
"POST",
"request",
"suppling",
"the",
"contents",
"of",
"the",
"reader",
"as",
"the",
"request",
"body",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client.go#L97-L99 |
136,612 | gorilla/http | http.go | Post | func Post(url string, r io.Reader) error {
status, _, rc, err := DefaultClient.Post(url, nil, r)
if err != nil {
return err
}
defer rc.Close()
if !status.IsSuccess() {
return &StatusError{status}
}
return nil
} | go | func Post(url string, r io.Reader) error {
status, _, rc, err := DefaultClient.Post(url, nil, r)
if err != nil {
return err
}
defer rc.Close()
if !status.IsSuccess() {
return &StatusError{status}
}
return nil
} | [
"func",
"Post",
"(",
"url",
"string",
",",
"r",
"io",
".",
"Reader",
")",
"error",
"{",
"status",
",",
"_",
",",
"rc",
",",
"err",
":=",
"DefaultClient",
".",
"Post",
"(",
"url",
",",
"nil",
",",
"r",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
... | // Post issues a POST request using the DefaultClient using r as the body.
// If the status code was not a success code, it will be returned as an error. | [
"Post",
"issues",
"a",
"POST",
"request",
"using",
"the",
"DefaultClient",
"using",
"r",
"as",
"the",
"body",
".",
"If",
"the",
"status",
"code",
"was",
"not",
"a",
"success",
"code",
"it",
"will",
"be",
"returned",
"as",
"an",
"error",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/http.go#L45-L55 |
136,613 | gorilla/http | client/client.go | NewClient | func NewClient(rw io.ReadWriter) Client {
return &client{
reader: reader{bufio.NewReaderSize(rw, readerBuffer)},
writer: writer{Writer: rw},
}
} | go | func NewClient(rw io.ReadWriter) Client {
return &client{
reader: reader{bufio.NewReaderSize(rw, readerBuffer)},
writer: writer{Writer: rw},
}
} | [
"func",
"NewClient",
"(",
"rw",
"io",
".",
"ReadWriter",
")",
"Client",
"{",
"return",
"&",
"client",
"{",
"reader",
":",
"reader",
"{",
"bufio",
".",
"NewReaderSize",
"(",
"rw",
",",
"readerBuffer",
")",
"}",
",",
"writer",
":",
"writer",
"{",
"Writer... | // NewClient returns a Client implementation which uses rw to communicate. | [
"NewClient",
"returns",
"a",
"Client",
"implementation",
"which",
"uses",
"rw",
"to",
"communicate",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/client.go#L80-L85 |
136,614 | gorilla/http | client/client.go | WriteRequest | func (c *client) WriteRequest(req *Request) error {
if err := c.WriteRequestLine(req.Method, req.Path, req.Query, req.Version.String()); err != nil {
return err
}
for _, h := range req.Headers {
if err := c.WriteHeader(h.Key, h.Value); err != nil {
return err
}
}
l := req.ContentLength()
if l >= 0 {
if... | go | func (c *client) WriteRequest(req *Request) error {
if err := c.WriteRequestLine(req.Method, req.Path, req.Query, req.Version.String()); err != nil {
return err
}
for _, h := range req.Headers {
if err := c.WriteHeader(h.Key, h.Value); err != nil {
return err
}
}
l := req.ContentLength()
if l >= 0 {
if... | [
"func",
"(",
"c",
"*",
"client",
")",
"WriteRequest",
"(",
"req",
"*",
"Request",
")",
"error",
"{",
"if",
"err",
":=",
"c",
".",
"WriteRequestLine",
"(",
"req",
".",
"Method",
",",
"req",
".",
"Path",
",",
"req",
".",
"Query",
",",
"req",
".",
"... | // SendRequest marshalls a HTTP request to the wire. | [
"SendRequest",
"marshalls",
"a",
"HTTP",
"request",
"to",
"the",
"wire",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/client.go#L93-L128 |
136,615 | gorilla/http | client/client.go | ReadResponse | func (c *client) ReadResponse() (*Response, error) {
version, code, msg, err := c.ReadStatusLine()
var headers []Header
if err != nil {
return nil, fmt.Errorf("ReadStatusLine: %v", err)
}
for {
var key, value string
var done bool
key, value, done, err = c.ReadHeader()
if err != nil || done {
break
}... | go | func (c *client) ReadResponse() (*Response, error) {
version, code, msg, err := c.ReadStatusLine()
var headers []Header
if err != nil {
return nil, fmt.Errorf("ReadStatusLine: %v", err)
}
for {
var key, value string
var done bool
key, value, done, err = c.ReadHeader()
if err != nil || done {
break
}... | [
"func",
"(",
"c",
"*",
"client",
")",
"ReadResponse",
"(",
")",
"(",
"*",
"Response",
",",
"error",
")",
"{",
"version",
",",
"code",
",",
"msg",
",",
"err",
":=",
"c",
".",
"ReadStatusLine",
"(",
")",
"\n",
"var",
"headers",
"[",
"]",
"Header",
... | // ReadResponse unmarshalls a HTTP response. | [
"ReadResponse",
"unmarshalls",
"a",
"HTTP",
"response",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/client.go#L131-L163 |
136,616 | gorilla/http | client/client.go | TransferEncoding | func (r *Response) TransferEncoding() string {
for _, h := range r.Headers {
if strings.EqualFold(h.Key, "Transfer-Encoding") {
switch h.Value {
case "identity", "chunked":
return h.Value
}
}
}
return "identity"
} | go | func (r *Response) TransferEncoding() string {
for _, h := range r.Headers {
if strings.EqualFold(h.Key, "Transfer-Encoding") {
switch h.Value {
case "identity", "chunked":
return h.Value
}
}
}
return "identity"
} | [
"func",
"(",
"r",
"*",
"Response",
")",
"TransferEncoding",
"(",
")",
"string",
"{",
"for",
"_",
",",
"h",
":=",
"range",
"r",
".",
"Headers",
"{",
"if",
"strings",
".",
"EqualFold",
"(",
"h",
".",
"Key",
",",
"\"",
"\"",
")",
"{",
"switch",
"h",... | // TransferEncoding returns the transfer encoding this message was transmitted with.
// If not is specified by the sender, "identity" is assumed. | [
"TransferEncoding",
"returns",
"the",
"transfer",
"encoding",
"this",
"message",
"was",
"transmitted",
"with",
".",
"If",
"not",
"is",
"specified",
"by",
"the",
"sender",
"identity",
"is",
"assumed",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/client.go#L200-L210 |
136,617 | gorilla/http | client/writer.go | WriteRequestLine | func (w *writer) WriteRequestLine(method, path string, query []string, version string) error {
if w.phase != requestline {
return &phaseError{requestline, w.phase}
}
q := strings.Join(query, "&")
if len(q) > 0 {
q = "?" + q
}
w.tmp, w.Writer = w.Writer, bufio.NewWriter(w.Writer)
_, err := fmt.Fprintf(w, "%s ... | go | func (w *writer) WriteRequestLine(method, path string, query []string, version string) error {
if w.phase != requestline {
return &phaseError{requestline, w.phase}
}
q := strings.Join(query, "&")
if len(q) > 0 {
q = "?" + q
}
w.tmp, w.Writer = w.Writer, bufio.NewWriter(w.Writer)
_, err := fmt.Fprintf(w, "%s ... | [
"func",
"(",
"w",
"*",
"writer",
")",
"WriteRequestLine",
"(",
"method",
",",
"path",
"string",
",",
"query",
"[",
"]",
"string",
",",
"version",
"string",
")",
"error",
"{",
"if",
"w",
".",
"phase",
"!=",
"requestline",
"{",
"return",
"&",
"phaseError... | // WriteRequestLine writes the RequestLine and moves the Conn to the headers phase | [
"WriteRequestLine",
"writes",
"the",
"RequestLine",
"and",
"moves",
"the",
"Conn",
"to",
"the",
"headers",
"phase"
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/writer.go#L50-L62 |
136,618 | gorilla/http | client/writer.go | WriteHeader | func (w *writer) WriteHeader(key, value string) error {
if w.phase != header {
return &phaseError{header, w.phase}
}
_, err := fmt.Fprintf(w, "%s: %s\r\n", key, value)
return err
} | go | func (w *writer) WriteHeader(key, value string) error {
if w.phase != header {
return &phaseError{header, w.phase}
}
_, err := fmt.Fprintf(w, "%s: %s\r\n", key, value)
return err
} | [
"func",
"(",
"w",
"*",
"writer",
")",
"WriteHeader",
"(",
"key",
",",
"value",
"string",
")",
"error",
"{",
"if",
"w",
".",
"phase",
"!=",
"header",
"{",
"return",
"&",
"phaseError",
"{",
"header",
",",
"w",
".",
"phase",
"}",
"\n",
"}",
"\n",
"_... | // WriteHeader writes the canonical header form to the wire. | [
"WriteHeader",
"writes",
"the",
"canonical",
"header",
"form",
"to",
"the",
"wire",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/writer.go#L65-L71 |
136,619 | gorilla/http | client/writer.go | StartBody | func (w *writer) StartBody() error {
if _, err := w.Write([]byte("\r\n")); err != nil {
return err
}
err := w.Writer.(*bufio.Writer).Flush()
w.Writer, w.tmp = w.tmp, nil
w.phase = body
return err
} | go | func (w *writer) StartBody() error {
if _, err := w.Write([]byte("\r\n")); err != nil {
return err
}
err := w.Writer.(*bufio.Writer).Flush()
w.Writer, w.tmp = w.tmp, nil
w.phase = body
return err
} | [
"func",
"(",
"w",
"*",
"writer",
")",
"StartBody",
"(",
")",
"error",
"{",
"if",
"_",
",",
"err",
":=",
"w",
".",
"Write",
"(",
"[",
"]",
"byte",
"(",
"\"",
"\\r",
"\\n",
"\"",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
... | // StartBody moves the Conn into the body phase, no further headers may be sent at this point. | [
"StartBody",
"moves",
"the",
"Conn",
"into",
"the",
"body",
"phase",
"no",
"further",
"headers",
"may",
"be",
"sent",
"at",
"this",
"point",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/writer.go#L74-L82 |
136,620 | gorilla/http | client/writer.go | WriteBody | func (w *writer) WriteBody(r io.Reader) error {
if w.phase != body {
return &phaseError{body, w.phase}
}
_, err := io.Copy(w, r)
w.phase = requestline
return err
} | go | func (w *writer) WriteBody(r io.Reader) error {
if w.phase != body {
return &phaseError{body, w.phase}
}
_, err := io.Copy(w, r)
w.phase = requestline
return err
} | [
"func",
"(",
"w",
"*",
"writer",
")",
"WriteBody",
"(",
"r",
"io",
".",
"Reader",
")",
"error",
"{",
"if",
"w",
".",
"phase",
"!=",
"body",
"{",
"return",
"&",
"phaseError",
"{",
"body",
",",
"w",
".",
"phase",
"}",
"\n",
"}",
"\n",
"_",
",",
... | // WriteBody writes the contents of r to the wire. | [
"WriteBody",
"writes",
"the",
"contents",
"of",
"r",
"to",
"the",
"wire",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/writer.go#L85-L92 |
136,621 | gorilla/http | client/writer.go | WriteChunked | func (w *writer) WriteChunked(r io.Reader) error {
if w.phase != body {
return &phaseError{body, w.phase}
}
cw := httputil.NewChunkedWriter(w)
if _, err := io.Copy(cw, r); err != nil {
return nil
}
w.phase = requestline
return cw.Close()
} | go | func (w *writer) WriteChunked(r io.Reader) error {
if w.phase != body {
return &phaseError{body, w.phase}
}
cw := httputil.NewChunkedWriter(w)
if _, err := io.Copy(cw, r); err != nil {
return nil
}
w.phase = requestline
return cw.Close()
} | [
"func",
"(",
"w",
"*",
"writer",
")",
"WriteChunked",
"(",
"r",
"io",
".",
"Reader",
")",
"error",
"{",
"if",
"w",
".",
"phase",
"!=",
"body",
"{",
"return",
"&",
"phaseError",
"{",
"body",
",",
"w",
".",
"phase",
"}",
"\n",
"}",
"\n",
"cw",
":... | // WriteChunked writes the contents of r in chunked format to the wire. | [
"WriteChunked",
"writes",
"the",
"contents",
"of",
"r",
"in",
"chunked",
"format",
"to",
"the",
"wire",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/writer.go#L95-L105 |
136,622 | gorilla/http | client/reader.go | ReadVersion | func (r *reader) ReadVersion() (Version, error) {
var major, minor int
for pos := 0; pos < len("HTTP/x.x "); pos++ {
c, err := r.ReadByte()
if err != nil {
return invalidVersion, err
}
switch pos {
case 0:
if c != 'H' {
return readVersionErr(pos, 'H', c)
}
case 1, 2:
if c != 'T' {
retu... | go | func (r *reader) ReadVersion() (Version, error) {
var major, minor int
for pos := 0; pos < len("HTTP/x.x "); pos++ {
c, err := r.ReadByte()
if err != nil {
return invalidVersion, err
}
switch pos {
case 0:
if c != 'H' {
return readVersionErr(pos, 'H', c)
}
case 1, 2:
if c != 'T' {
retu... | [
"func",
"(",
"r",
"*",
"reader",
")",
"ReadVersion",
"(",
")",
"(",
"Version",
",",
"error",
")",
"{",
"var",
"major",
",",
"minor",
"int",
"\n",
"for",
"pos",
":=",
"0",
";",
"pos",
"<",
"len",
"(",
"\"",
"\"",
")",
";",
"pos",
"++",
"{",
"c... | // ReadVersion reads a HTTP version string from the wire. | [
"ReadVersion",
"reads",
"a",
"HTTP",
"version",
"string",
"from",
"the",
"wire",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/reader.go#L15-L60 |
136,623 | gorilla/http | client/reader.go | ReadStatusCode | func (r *reader) ReadStatusCode() (int, error) {
var code int
for pos := 0; pos < len("200 "); pos++ {
c, err := r.ReadByte()
if err != nil {
return 0, err
}
switch pos {
case 0, 1, 2:
switch c {
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
switch pos {
case 0:
code = int(int... | go | func (r *reader) ReadStatusCode() (int, error) {
var code int
for pos := 0; pos < len("200 "); pos++ {
c, err := r.ReadByte()
if err != nil {
return 0, err
}
switch pos {
case 0, 1, 2:
switch c {
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
switch pos {
case 0:
code = int(int... | [
"func",
"(",
"r",
"*",
"reader",
")",
"ReadStatusCode",
"(",
")",
"(",
"int",
",",
"error",
")",
"{",
"var",
"code",
"int",
"\n",
"for",
"pos",
":=",
"0",
";",
"pos",
"<",
"len",
"(",
"\"",
"\"",
")",
";",
"pos",
"++",
"{",
"c",
",",
"err",
... | // ReadStatusCode reads the HTTP status code from the wire. | [
"ReadStatusCode",
"reads",
"the",
"HTTP",
"status",
"code",
"from",
"the",
"wire",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/reader.go#L69-L101 |
136,624 | gorilla/http | client/reader.go | ReadStatusLine | func (r *reader) ReadStatusLine() (Version, int, string, error) {
version, err := r.ReadVersion()
if err != nil {
return Version{}, 0, "", err
}
code, err := r.ReadStatusCode()
if err != nil {
return Version{}, 0, "", err
}
msg, _, err := r.ReadLine()
return version, code, string(msg), err
} | go | func (r *reader) ReadStatusLine() (Version, int, string, error) {
version, err := r.ReadVersion()
if err != nil {
return Version{}, 0, "", err
}
code, err := r.ReadStatusCode()
if err != nil {
return Version{}, 0, "", err
}
msg, _, err := r.ReadLine()
return version, code, string(msg), err
} | [
"func",
"(",
"r",
"*",
"reader",
")",
"ReadStatusLine",
"(",
")",
"(",
"Version",
",",
"int",
",",
"string",
",",
"error",
")",
"{",
"version",
",",
"err",
":=",
"r",
".",
"ReadVersion",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"V... | // ReadStatusLine reads the status line. | [
"ReadStatusLine",
"reads",
"the",
"status",
"line",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/reader.go#L104-L115 |
136,625 | gorilla/http | client/reader.go | ReadHeader | func (r *reader) ReadHeader() (string, string, bool, error) {
line, err := r.readLine()
if err != nil {
return "", "", false, err
}
if line := string(line); line == "\r\n" || line == "\n" {
return "", "", true, nil
}
v := bytes.SplitN(line, []byte(":"), 2)
if len(v) != 2 {
return "", "", false, fmt.Errorf(... | go | func (r *reader) ReadHeader() (string, string, bool, error) {
line, err := r.readLine()
if err != nil {
return "", "", false, err
}
if line := string(line); line == "\r\n" || line == "\n" {
return "", "", true, nil
}
v := bytes.SplitN(line, []byte(":"), 2)
if len(v) != 2 {
return "", "", false, fmt.Errorf(... | [
"func",
"(",
"r",
"*",
"reader",
")",
"ReadHeader",
"(",
")",
"(",
"string",
",",
"string",
",",
"bool",
",",
"error",
")",
"{",
"line",
",",
"err",
":=",
"r",
".",
"readLine",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\""... | // ReadHeader reads a http header. | [
"ReadHeader",
"reads",
"a",
"http",
"header",
"."
] | 732371cf4733ce912492655d1c0d18af235771f2 | https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/reader.go#L118-L131 |
136,626 | bradfitz/latlong | latlong.go | newTileKey | func newTileKey(size uint8, x, y uint16) tileKey {
return tileKey(size&7)<<28 |
tileKey(y&(1<<14-1))<<14 |
tileKey(x&(1<<14-1))
} | go | func newTileKey(size uint8, x, y uint16) tileKey {
return tileKey(size&7)<<28 |
tileKey(y&(1<<14-1))<<14 |
tileKey(x&(1<<14-1))
} | [
"func",
"newTileKey",
"(",
"size",
"uint8",
",",
"x",
",",
"y",
"uint16",
")",
"tileKey",
"{",
"return",
"tileKey",
"(",
"size",
"&",
"7",
")",
"<<",
"28",
"|",
"tileKey",
"(",
"y",
"&",
"(",
"1",
"<<",
"14",
"-",
"1",
")",
")",
"<<",
"14",
"... | // size is 0, 1, 2, or 3 | [
"size",
"is",
"0",
"1",
"2",
"or",
"3"
] | f3db6d0dff40d47957be82e1a6645574fb041f95 | https://github.com/bradfitz/latlong/blob/f3db6d0dff40d47957be82e1a6645574fb041f95/latlong.go#L177-L181 |
136,627 | spotinst/spotinst-sdk-go | spotinst/credentials/provider_file.go | filename | func (p *FileProvider) filename() (string, error) {
if p.Filename == "" {
if p.Filename = os.Getenv(FileCredentialsEnvVarFile); p.Filename != "" {
return p.Filename, nil
}
homeDir := os.Getenv("HOME") // *nix
if homeDir == "" { // Windows
homeDir = os.Getenv("USERPROFILE")
}
if homeDir == ... | go | func (p *FileProvider) filename() (string, error) {
if p.Filename == "" {
if p.Filename = os.Getenv(FileCredentialsEnvVarFile); p.Filename != "" {
return p.Filename, nil
}
homeDir := os.Getenv("HOME") // *nix
if homeDir == "" { // Windows
homeDir = os.Getenv("USERPROFILE")
}
if homeDir == ... | [
"func",
"(",
"p",
"*",
"FileProvider",
")",
"filename",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"p",
".",
"Filename",
"==",
"\"",
"\"",
"{",
"if",
"p",
".",
"Filename",
"=",
"os",
".",
"Getenv",
"(",
"FileCredentialsEnvVarFile",
")",
... | // filename returns the filename to use to read Spotinst credentials.
//
// Will return an error if the user's home directory path cannot be found. | [
"filename",
"returns",
"the",
"filename",
"to",
"use",
"to",
"read",
"Spotinst",
"credentials",
".",
"Will",
"return",
"an",
"error",
"if",
"the",
"user",
"s",
"home",
"directory",
"path",
"cannot",
"be",
"found",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/credentials/provider_file.go#L88-L106 |
136,628 | spotinst/spotinst-sdk-go | spotinst/credentials/provider_file.go | loadCredentials | func (p *FileProvider) loadCredentials(filename string) (Value, error) {
f, err := os.Open(filename)
if err != nil {
return Value{ProviderName: FileCredentialsProviderName},
fmt.Errorf("%s: %s", ErrFileCredentialsLoadFailed.Error(), err)
}
defer f.Close()
var value Value
if err := json.NewDecoder(f).Decode(... | go | func (p *FileProvider) loadCredentials(filename string) (Value, error) {
f, err := os.Open(filename)
if err != nil {
return Value{ProviderName: FileCredentialsProviderName},
fmt.Errorf("%s: %s", ErrFileCredentialsLoadFailed.Error(), err)
}
defer f.Close()
var value Value
if err := json.NewDecoder(f).Decode(... | [
"func",
"(",
"p",
"*",
"FileProvider",
")",
"loadCredentials",
"(",
"filename",
"string",
")",
"(",
"Value",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"filename",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"Val... | // loadCredentials loads the credentials from the file pointed to by filename.
// The credentials retrieved from the profile will be returned or error. Error will be
// returned if it fails to read from the file, or the data is invalid. | [
"loadCredentials",
"loads",
"the",
"credentials",
"from",
"the",
"file",
"pointed",
"to",
"by",
"filename",
".",
"The",
"credentials",
"retrieved",
"from",
"the",
"profile",
"will",
"be",
"returned",
"or",
"error",
".",
"Error",
"will",
"be",
"returned",
"if",... | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/credentials/provider_file.go#L111-L130 |
136,629 | spotinst/spotinst-sdk-go | service/elastigroup/providers/azure/azure.go | List | func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {
r := client.NewRequest(http.MethodGet, "/compute/azure/group")
resp, err := client.RequireOK(s.Client.Do(ctx, r))
if err != nil {
return nil, err
}
defer resp.Body.Close()
gs, err := groupsFromHttpResponse(resp)
... | go | func (s *ServiceOp) List(ctx context.Context, input *ListGroupsInput) (*ListGroupsOutput, error) {
r := client.NewRequest(http.MethodGet, "/compute/azure/group")
resp, err := client.RequireOK(s.Client.Do(ctx, r))
if err != nil {
return nil, err
}
defer resp.Body.Close()
gs, err := groupsFromHttpResponse(resp)
... | [
"func",
"(",
"s",
"*",
"ServiceOp",
")",
"List",
"(",
"ctx",
"context",
".",
"Context",
",",
"input",
"*",
"ListGroupsInput",
")",
"(",
"*",
"ListGroupsOutput",
",",
"error",
")",
"{",
"r",
":=",
"client",
".",
"NewRequest",
"(",
"http",
".",
"MethodGe... | // endregion
// region API requests | [
"endregion",
"region",
"API",
"requests"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/azure/azure.go#L752-L766 |
136,630 | spotinst/spotinst-sdk-go | service/elastigroup/providers/azure/azure.go | SetShutdownScript | func (o *LaunchSpecification) SetShutdownScript(v *string) *LaunchSpecification {
if o.ShutdownScript = v; o.ShutdownScript == nil {
o.nullFields = append(o.nullFields, "ShutdownScript")
}
return o
} | go | func (o *LaunchSpecification) SetShutdownScript(v *string) *LaunchSpecification {
if o.ShutdownScript = v; o.ShutdownScript == nil {
o.nullFields = append(o.nullFields, "ShutdownScript")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetShutdownScript",
"(",
"v",
"*",
"string",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"ShutdownScript",
"=",
"v",
";",
"o",
".",
"ShutdownScript",
"==",
"nil",
"{",
"o",
".",
"nullFields",
... | // SetShutdownScript sets the shutdown script used when draining instances | [
"SetShutdownScript",
"sets",
"the",
"shutdown",
"script",
"used",
"when",
"draining",
"instances"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/azure/azure.go#L1923-L1928 |
136,631 | spotinst/spotinst-sdk-go | service/elastigroup/providers/azure/azure.go | SetAdditionalIPConfigs | func (o *Network) SetAdditionalIPConfigs(v []*AdditionalIPConfigs) *Network {
if o.AdditionalIPConfigs = v; o.AdditionalIPConfigs == nil {
o.nullFields = append(o.nullFields, "AdditionalIPConfigs")
}
return o
} | go | func (o *Network) SetAdditionalIPConfigs(v []*AdditionalIPConfigs) *Network {
if o.AdditionalIPConfigs = v; o.AdditionalIPConfigs == nil {
o.nullFields = append(o.nullFields, "AdditionalIPConfigs")
}
return o
} | [
"func",
"(",
"o",
"*",
"Network",
")",
"SetAdditionalIPConfigs",
"(",
"v",
"[",
"]",
"*",
"AdditionalIPConfigs",
")",
"*",
"Network",
"{",
"if",
"o",
".",
"AdditionalIPConfigs",
"=",
"v",
";",
"o",
".",
"AdditionalIPConfigs",
"==",
"nil",
"{",
"o",
".",
... | // SetAdditionalIPConfigs sets the additional IP configurations | [
"SetAdditionalIPConfigs",
"sets",
"the",
"additional",
"IP",
"configurations"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/azure/azure.go#L2189-L2194 |
136,632 | spotinst/spotinst-sdk-go | service/elastigroup/providers/azure/azure.go | SetPrivateIPAddressVersion | func (o *AdditionalIPConfigs) SetPrivateIPAddressVersion(v *string) *AdditionalIPConfigs {
if o.PrivateIPAddressVersion = v; o.PrivateIPAddressVersion == nil {
o.nullFields = append(o.nullFields, "PrivateIPAddressVersion")
}
return o
} | go | func (o *AdditionalIPConfigs) SetPrivateIPAddressVersion(v *string) *AdditionalIPConfigs {
if o.PrivateIPAddressVersion = v; o.PrivateIPAddressVersion == nil {
o.nullFields = append(o.nullFields, "PrivateIPAddressVersion")
}
return o
} | [
"func",
"(",
"o",
"*",
"AdditionalIPConfigs",
")",
"SetPrivateIPAddressVersion",
"(",
"v",
"*",
"string",
")",
"*",
"AdditionalIPConfigs",
"{",
"if",
"o",
".",
"PrivateIPAddressVersion",
"=",
"v",
";",
"o",
".",
"PrivateIPAddressVersion",
"==",
"nil",
"{",
"o"... | // SetPrivateIPAddressVersion sets the ip address version | [
"SetPrivateIPAddressVersion",
"sets",
"the",
"ip",
"address",
"version"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/azure/azure.go#L2246-L2251 |
136,633 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | ImportGKECluster | func (s *ServiceOp) ImportGKECluster(ctx context.Context, input *ImportGKEClusterInput) (*ImportGKEClusterOutput, error) {
r := client.NewRequest(http.MethodPost, "/gcp/gce/group/gke/import")
r.Params["clusterId"] = []string{spotinst.StringValue(input.ClusterID)}
r.Params["zone"] = []string{spotinst.StringValue(inp... | go | func (s *ServiceOp) ImportGKECluster(ctx context.Context, input *ImportGKEClusterInput) (*ImportGKEClusterOutput, error) {
r := client.NewRequest(http.MethodPost, "/gcp/gce/group/gke/import")
r.Params["clusterId"] = []string{spotinst.StringValue(input.ClusterID)}
r.Params["zone"] = []string{spotinst.StringValue(inp... | [
"func",
"(",
"s",
"*",
"ServiceOp",
")",
"ImportGKECluster",
"(",
"ctx",
"context",
".",
"Context",
",",
"input",
"*",
"ImportGKEClusterInput",
")",
"(",
"*",
"ImportGKEClusterOutput",
",",
"error",
")",
"{",
"r",
":=",
"client",
".",
"NewRequest",
"(",
"h... | // ImportGKECluster imports an existing GKE cluster into Elastigroup. | [
"ImportGKECluster",
"imports",
"an",
"existing",
"GKE",
"cluster",
"into",
"Elastigroup",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L642-L669 |
136,634 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetGPU | func (o *Compute) SetGPU(v *GPU) *Compute {
if o.GPU = v; o.GPU == nil {
o.nullFields = append(o.nullFields, "GPU")
}
return o
} | go | func (o *Compute) SetGPU(v *GPU) *Compute {
if o.GPU = v; o.GPU == nil {
o.nullFields = append(o.nullFields, "GPU")
}
return o
} | [
"func",
"(",
"o",
"*",
"Compute",
")",
"SetGPU",
"(",
"v",
"*",
"GPU",
")",
"*",
"Compute",
"{",
"if",
"o",
".",
"GPU",
"=",
"v",
";",
"o",
".",
"GPU",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nullFields",
",",... | // SetGPU sets the GPU object | [
"SetGPU",
"sets",
"the",
"GPU",
"object"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1027-L1032 |
136,635 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetLaunchConfiguration | func (o *Compute) SetLaunchConfiguration(v *LaunchSpecification) *Compute {
if o.LaunchSpecification = v; o.LaunchSpecification == nil {
o.nullFields = append(o.nullFields, "LaunchSpecification")
}
return o
} | go | func (o *Compute) SetLaunchConfiguration(v *LaunchSpecification) *Compute {
if o.LaunchSpecification = v; o.LaunchSpecification == nil {
o.nullFields = append(o.nullFields, "LaunchSpecification")
}
return o
} | [
"func",
"(",
"o",
"*",
"Compute",
")",
"SetLaunchConfiguration",
"(",
"v",
"*",
"LaunchSpecification",
")",
"*",
"Compute",
"{",
"if",
"o",
".",
"LaunchSpecification",
"=",
"v",
";",
"o",
".",
"LaunchSpecification",
"==",
"nil",
"{",
"o",
".",
"nullFields"... | // SetLaunchSpecification sets the launch configuration of the group. | [
"SetLaunchSpecification",
"sets",
"the",
"launch",
"configuration",
"of",
"the",
"group",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1051-L1056 |
136,636 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetSubnets | func (o *Compute) SetSubnets(v []*Subnet) *Compute {
if o.Subnets = v; o.Subnets == nil {
o.nullFields = append(o.nullFields, "Subnets")
}
return o
} | go | func (o *Compute) SetSubnets(v []*Subnet) *Compute {
if o.Subnets = v; o.Subnets == nil {
o.nullFields = append(o.nullFields, "Subnets")
}
return o
} | [
"func",
"(",
"o",
"*",
"Compute",
")",
"SetSubnets",
"(",
"v",
"[",
"]",
"*",
"Subnet",
")",
"*",
"Compute",
"{",
"if",
"o",
".",
"Subnets",
"=",
"v",
";",
"o",
".",
"Subnets",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
... | // SetSubnets sets the subnets used by the group. | [
"SetSubnets",
"sets",
"the",
"subnets",
"used",
"by",
"the",
"group",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1059-L1064 |
136,637 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetCount | func (o *GPU) SetCount(v *int) *GPU {
if o.Count = v; o.Count == nil {
o.nullFields = append(o.nullFields, "Count")
}
return o
} | go | func (o *GPU) SetCount(v *int) *GPU {
if o.Count = v; o.Count == nil {
o.nullFields = append(o.nullFields, "Count")
}
return o
} | [
"func",
"(",
"o",
"*",
"GPU",
")",
"SetCount",
"(",
"v",
"*",
"int",
")",
"*",
"GPU",
"{",
"if",
"o",
".",
"Count",
"=",
"v",
";",
"o",
".",
"Count",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nullFields",
",",
... | // SetCount sets the number of this type of gpu | [
"SetCount",
"sets",
"the",
"number",
"of",
"this",
"type",
"of",
"gpu"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1083-L1088 |
136,638 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetCustom | func (o *InstanceTypes) SetCustom(v []*CustomInstance) *InstanceTypes {
if o.Custom = v; o.Custom == nil {
o.nullFields = append(o.nullFields, "Custom")
}
return o
} | go | func (o *InstanceTypes) SetCustom(v []*CustomInstance) *InstanceTypes {
if o.Custom = v; o.Custom == nil {
o.nullFields = append(o.nullFields, "Custom")
}
return o
} | [
"func",
"(",
"o",
"*",
"InstanceTypes",
")",
"SetCustom",
"(",
"v",
"[",
"]",
"*",
"CustomInstance",
")",
"*",
"InstanceTypes",
"{",
"if",
"o",
".",
"Custom",
"=",
"v",
";",
"o",
".",
"Custom",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append... | // SetCustom sets the memory and vCPU attributes for Custom Instance types | [
"SetCustom",
"sets",
"the",
"memory",
"and",
"vCPU",
"attributes",
"for",
"Custom",
"Instance",
"types"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1143-L1148 |
136,639 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetMemoryGiB | func (o *CustomInstance) SetMemoryGiB(v *int) *CustomInstance {
if o.MemoryGiB = v; o.MemoryGiB == nil {
o.nullFields = append(o.nullFields, "MemoryGiB")
}
return o
} | go | func (o *CustomInstance) SetMemoryGiB(v *int) *CustomInstance {
if o.MemoryGiB = v; o.MemoryGiB == nil {
o.nullFields = append(o.nullFields, "MemoryGiB")
}
return o
} | [
"func",
"(",
"o",
"*",
"CustomInstance",
")",
"SetMemoryGiB",
"(",
"v",
"*",
"int",
")",
"*",
"CustomInstance",
"{",
"if",
"o",
".",
"MemoryGiB",
"=",
"v",
";",
"o",
".",
"MemoryGiB",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o... | // SetMemoryGiB sets the memory amount for a Custom Instance in intervals of 2, min 10 | [
"SetMemoryGiB",
"sets",
"the",
"memory",
"amount",
"for",
"a",
"Custom",
"Instance",
"in",
"intervals",
"of",
"2",
"min",
"10"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1151-L1156 |
136,640 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetVCPU | func (o *CustomInstance) SetVCPU(v *int) *CustomInstance {
if o.VCPU = v; o.VCPU == nil {
o.nullFields = append(o.nullFields, "VCPU")
}
return o
} | go | func (o *CustomInstance) SetVCPU(v *int) *CustomInstance {
if o.VCPU = v; o.VCPU == nil {
o.nullFields = append(o.nullFields, "VCPU")
}
return o
} | [
"func",
"(",
"o",
"*",
"CustomInstance",
")",
"SetVCPU",
"(",
"v",
"*",
"int",
")",
"*",
"CustomInstance",
"{",
"if",
"o",
".",
"VCPU",
"=",
"v",
";",
"o",
".",
"VCPU",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nu... | // SetVCPU sets sets the number of vCPUs to use in a Custom instance type | [
"SetVCPU",
"sets",
"sets",
"the",
"number",
"of",
"vCPUs",
"to",
"use",
"in",
"a",
"Custom",
"instance",
"type"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1159-L1164 |
136,641 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetBackendServiceConfig | func (o *LaunchSpecification) SetBackendServiceConfig(v *BackendServiceConfig) *LaunchSpecification {
if o.BackendServiceConfig = v; o.BackendServiceConfig == nil {
o.nullFields = append(o.nullFields, "BackendServiceConfig")
}
return o
} | go | func (o *LaunchSpecification) SetBackendServiceConfig(v *BackendServiceConfig) *LaunchSpecification {
if o.BackendServiceConfig = v; o.BackendServiceConfig == nil {
o.nullFields = append(o.nullFields, "BackendServiceConfig")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetBackendServiceConfig",
"(",
"v",
"*",
"BackendServiceConfig",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"BackendServiceConfig",
"=",
"v",
";",
"o",
".",
"BackendServiceConfig",
"==",
"nil",
"{",
... | // SetBackendServices sets the backend services to use with the group. | [
"SetBackendServices",
"sets",
"the",
"backend",
"services",
"to",
"use",
"with",
"the",
"group",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1193-L1198 |
136,642 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetDisks | func (o *LaunchSpecification) SetDisks(v []*Disk) *LaunchSpecification {
if o.Disks = v; o.Disks == nil {
o.nullFields = append(o.nullFields, "Disks")
}
return o
} | go | func (o *LaunchSpecification) SetDisks(v []*Disk) *LaunchSpecification {
if o.Disks = v; o.Disks == nil {
o.nullFields = append(o.nullFields, "Disks")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetDisks",
"(",
"v",
"[",
"]",
"*",
"Disk",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"Disks",
"=",
"v",
";",
"o",
".",
"Disks",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append"... | // SetDisks sets the list of disks used by the group | [
"SetDisks",
"sets",
"the",
"list",
"of",
"disks",
"used",
"by",
"the",
"group"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1201-L1206 |
136,643 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetLabels | func (o *LaunchSpecification) SetLabels(v []*Label) *LaunchSpecification {
if o.Labels = v; o.Labels == nil {
o.nullFields = append(o.nullFields, "Labels")
}
return o
} | go | func (o *LaunchSpecification) SetLabels(v []*Label) *LaunchSpecification {
if o.Labels = v; o.Labels == nil {
o.nullFields = append(o.nullFields, "Labels")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetLabels",
"(",
"v",
"[",
"]",
"*",
"Label",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"Labels",
"=",
"v",
";",
"o",
".",
"Labels",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"app... | // SetLabels sets the labels to be used with the group | [
"SetLabels",
"sets",
"the",
"labels",
"to",
"be",
"used",
"with",
"the",
"group"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1209-L1214 |
136,644 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetIPForwarding | func (o *LaunchSpecification) SetIPForwarding(v *bool) *LaunchSpecification {
if o.IPForwarding = v; o.IPForwarding == nil {
o.nullFields = append(o.nullFields, "IPForwarding")
}
return o
} | go | func (o *LaunchSpecification) SetIPForwarding(v *bool) *LaunchSpecification {
if o.IPForwarding = v; o.IPForwarding == nil {
o.nullFields = append(o.nullFields, "IPForwarding")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetIPForwarding",
"(",
"v",
"*",
"bool",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"IPForwarding",
"=",
"v",
";",
"o",
".",
"IPForwarding",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"... | // SetIPForwarding sets whether to use IP forwarding for this group. | [
"SetIPForwarding",
"sets",
"whether",
"to",
"use",
"IP",
"forwarding",
"for",
"this",
"group",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1217-L1222 |
136,645 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetMetadata | func (o *LaunchSpecification) SetMetadata(v []*Metadata) *LaunchSpecification {
if o.Metadata = v; o.Metadata == nil {
o.nullFields = append(o.nullFields, "Metadata")
}
return o
} | go | func (o *LaunchSpecification) SetMetadata(v []*Metadata) *LaunchSpecification {
if o.Metadata = v; o.Metadata == nil {
o.nullFields = append(o.nullFields, "Metadata")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetMetadata",
"(",
"v",
"[",
"]",
"*",
"Metadata",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"Metadata",
"=",
"v",
";",
"o",
".",
"Metadata",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=... | // SetMetadata sets metadata for the group. | [
"SetMetadata",
"sets",
"metadata",
"for",
"the",
"group",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1233-L1238 |
136,646 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetServiceAccount | func (o *LaunchSpecification) SetServiceAccount(v *string) *LaunchSpecification {
if o.ServiceAccount = v; o.ServiceAccount == nil {
o.nullFields = append(o.nullFields, "ServiceAccount")
}
return o
} | go | func (o *LaunchSpecification) SetServiceAccount(v *string) *LaunchSpecification {
if o.ServiceAccount = v; o.ServiceAccount == nil {
o.nullFields = append(o.nullFields, "ServiceAccount")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetServiceAccount",
"(",
"v",
"*",
"string",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"ServiceAccount",
"=",
"v",
";",
"o",
".",
"ServiceAccount",
"==",
"nil",
"{",
"o",
".",
"nullFields",
... | // SetServiceAccount sets the service account used by the instances in the group | [
"SetServiceAccount",
"sets",
"the",
"service",
"account",
"used",
"by",
"the",
"instances",
"in",
"the",
"group"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1241-L1246 |
136,647 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetStartupScript | func (o *LaunchSpecification) SetStartupScript(v *string) *LaunchSpecification {
if o.StartupScript = v; o.StartupScript == nil {
o.nullFields = append(o.nullFields, "StartupScript")
}
return o
} | go | func (o *LaunchSpecification) SetStartupScript(v *string) *LaunchSpecification {
if o.StartupScript = v; o.StartupScript == nil {
o.nullFields = append(o.nullFields, "StartupScript")
}
return o
} | [
"func",
"(",
"o",
"*",
"LaunchSpecification",
")",
"SetStartupScript",
"(",
"v",
"*",
"string",
")",
"*",
"LaunchSpecification",
"{",
"if",
"o",
".",
"StartupScript",
"=",
"v",
";",
"o",
".",
"StartupScript",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"="... | // SetStartupScript sets the startup script to be executed when the instance launches. | [
"SetStartupScript",
"sets",
"the",
"startup",
"script",
"to",
"be",
"executed",
"when",
"the",
"instance",
"launches",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1249-L1254 |
136,648 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetBackendServices | func (o *BackendServiceConfig) SetBackendServices(v []*BackendService) *BackendServiceConfig {
if o.BackendServices = v; o.BackendServices == nil {
o.nullFields = append(o.nullFields, "BackendServices")
}
return o
} | go | func (o *BackendServiceConfig) SetBackendServices(v []*BackendService) *BackendServiceConfig {
if o.BackendServices = v; o.BackendServices == nil {
o.nullFields = append(o.nullFields, "BackendServices")
}
return o
} | [
"func",
"(",
"o",
"*",
"BackendServiceConfig",
")",
"SetBackendServices",
"(",
"v",
"[",
"]",
"*",
"BackendService",
")",
"*",
"BackendServiceConfig",
"{",
"if",
"o",
".",
"BackendServices",
"=",
"v",
";",
"o",
".",
"BackendServices",
"==",
"nil",
"{",
"o"... | // SetBackendServices sets the backend service list | [
"SetBackendServices",
"sets",
"the",
"backend",
"service",
"list"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1281-L1286 |
136,649 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetBackendServiceName | func (o *BackendService) SetBackendServiceName(v *string) *BackendService {
if o.BackendServiceName = v; o.BackendServiceName == nil {
o.nullFields = append(o.nullFields, "BackendServiceName")
}
return o
} | go | func (o *BackendService) SetBackendServiceName(v *string) *BackendService {
if o.BackendServiceName = v; o.BackendServiceName == nil {
o.nullFields = append(o.nullFields, "BackendServiceName")
}
return o
} | [
"func",
"(",
"o",
"*",
"BackendService",
")",
"SetBackendServiceName",
"(",
"v",
"*",
"string",
")",
"*",
"BackendService",
"{",
"if",
"o",
".",
"BackendServiceName",
"=",
"v",
";",
"o",
".",
"BackendServiceName",
"==",
"nil",
"{",
"o",
".",
"nullFields",
... | // SetBackendServiceName sets the name of the backend service. | [
"SetBackendServiceName",
"sets",
"the",
"name",
"of",
"the",
"backend",
"service",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1297-L1302 |
136,650 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetLocationType | func (o *BackendService) SetLocationType(v *string) *BackendService {
if o.LocationType = v; o.LocationType == nil {
o.nullFields = append(o.nullFields, "LocationType")
}
return o
} | go | func (o *BackendService) SetLocationType(v *string) *BackendService {
if o.LocationType = v; o.LocationType == nil {
o.nullFields = append(o.nullFields, "LocationType")
}
return o
} | [
"func",
"(",
"o",
"*",
"BackendService",
")",
"SetLocationType",
"(",
"v",
"*",
"string",
")",
"*",
"BackendService",
"{",
"if",
"o",
".",
"LocationType",
"=",
"v",
";",
"o",
".",
"LocationType",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",... | // SetLocationType sets the location type | [
"SetLocationType",
"sets",
"the",
"location",
"type"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1305-L1310 |
136,651 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetNamedPorts | func (o *BackendService) SetNamedPorts(v *NamedPorts) *BackendService {
if o.NamedPorts = v; o.NamedPorts == nil {
o.nullFields = append(o.nullFields, "NamedPort")
}
return o
} | go | func (o *BackendService) SetNamedPorts(v *NamedPorts) *BackendService {
if o.NamedPorts = v; o.NamedPorts == nil {
o.nullFields = append(o.nullFields, "NamedPort")
}
return o
} | [
"func",
"(",
"o",
"*",
"BackendService",
")",
"SetNamedPorts",
"(",
"v",
"*",
"NamedPorts",
")",
"*",
"BackendService",
"{",
"if",
"o",
".",
"NamedPorts",
"=",
"v",
";",
"o",
".",
"NamedPorts",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
... | // SetNamedPorts sets the named port object | [
"SetNamedPorts",
"sets",
"the",
"named",
"port",
"object"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1321-L1326 |
136,652 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetPorts | func (o *NamedPorts) SetPorts(v []int) *NamedPorts {
if o.Ports = v; o.Ports == nil {
o.nullFields = append(o.nullFields, "Ports")
}
return o
} | go | func (o *NamedPorts) SetPorts(v []int) *NamedPorts {
if o.Ports = v; o.Ports == nil {
o.nullFields = append(o.nullFields, "Ports")
}
return o
} | [
"func",
"(",
"o",
"*",
"NamedPorts",
")",
"SetPorts",
"(",
"v",
"[",
"]",
"int",
")",
"*",
"NamedPorts",
"{",
"if",
"o",
".",
"Ports",
"=",
"v",
";",
"o",
".",
"Ports",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"... | // SetPorts sets the list of ports in the NamedPorts | [
"SetPorts",
"sets",
"the",
"list",
"of",
"ports",
"in",
"the",
"NamedPorts"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1345-L1350 |
136,653 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetAutoDelete | func (o *Disk) SetAutoDelete(v *bool) *Disk {
if o.AutoDelete = v; o.AutoDelete == nil {
o.nullFields = append(o.nullFields, "AutoDelete")
}
return o
} | go | func (o *Disk) SetAutoDelete(v *bool) *Disk {
if o.AutoDelete = v; o.AutoDelete == nil {
o.nullFields = append(o.nullFields, "AutoDelete")
}
return o
} | [
"func",
"(",
"o",
"*",
"Disk",
")",
"SetAutoDelete",
"(",
"v",
"*",
"bool",
")",
"*",
"Disk",
"{",
"if",
"o",
".",
"AutoDelete",
"=",
"v",
";",
"o",
".",
"AutoDelete",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nul... | // SetAutoDelete sets option to have disks autodelete | [
"SetAutoDelete",
"sets",
"option",
"to",
"have",
"disks",
"autodelete"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1367-L1372 |
136,654 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetBoot | func (o *Disk) SetBoot(v *bool) *Disk {
if o.Boot = v; o.Boot == nil {
o.nullFields = append(o.nullFields, "Boot")
}
return o
} | go | func (o *Disk) SetBoot(v *bool) *Disk {
if o.Boot = v; o.Boot == nil {
o.nullFields = append(o.nullFields, "Boot")
}
return o
} | [
"func",
"(",
"o",
"*",
"Disk",
")",
"SetBoot",
"(",
"v",
"*",
"bool",
")",
"*",
"Disk",
"{",
"if",
"o",
".",
"Boot",
"=",
"v",
";",
"o",
".",
"Boot",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nullFields",
",",
... | // SetBoot sets the boot option | [
"SetBoot",
"sets",
"the",
"boot",
"option"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1375-L1380 |
136,655 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetDeviceName | func (o *Disk) SetDeviceName(v *string) *Disk {
if o.DeviceName = v; o.DeviceName == nil {
o.nullFields = append(o.nullFields, "DeviceName")
}
return o
} | go | func (o *Disk) SetDeviceName(v *string) *Disk {
if o.DeviceName = v; o.DeviceName == nil {
o.nullFields = append(o.nullFields, "DeviceName")
}
return o
} | [
"func",
"(",
"o",
"*",
"Disk",
")",
"SetDeviceName",
"(",
"v",
"*",
"string",
")",
"*",
"Disk",
"{",
"if",
"o",
".",
"DeviceName",
"=",
"v",
";",
"o",
".",
"DeviceName",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"n... | // SetDeviceName sets the device name | [
"SetDeviceName",
"sets",
"the",
"device",
"name"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1383-L1388 |
136,656 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetInitializeParams | func (o *Disk) SetInitializeParams(v *InitializeParams) *Disk {
if o.InitializeParams = v; o.InitializeParams == nil {
o.nullFields = append(o.nullFields, "InitializeParams")
}
return o
} | go | func (o *Disk) SetInitializeParams(v *InitializeParams) *Disk {
if o.InitializeParams = v; o.InitializeParams == nil {
o.nullFields = append(o.nullFields, "InitializeParams")
}
return o
} | [
"func",
"(",
"o",
"*",
"Disk",
")",
"SetInitializeParams",
"(",
"v",
"*",
"InitializeParams",
")",
"*",
"Disk",
"{",
"if",
"o",
".",
"InitializeParams",
"=",
"v",
";",
"o",
".",
"InitializeParams",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append... | // SetInitializeParams sets the initialization paramters object | [
"SetInitializeParams",
"sets",
"the",
"initialization",
"paramters",
"object"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1391-L1396 |
136,657 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetInterface | func (o *Disk) SetInterface(v *string) *Disk {
if o.Interface = v; o.Interface == nil {
o.nullFields = append(o.nullFields, "Interface")
}
return o
} | go | func (o *Disk) SetInterface(v *string) *Disk {
if o.Interface = v; o.Interface == nil {
o.nullFields = append(o.nullFields, "Interface")
}
return o
} | [
"func",
"(",
"o",
"*",
"Disk",
")",
"SetInterface",
"(",
"v",
"*",
"string",
")",
"*",
"Disk",
"{",
"if",
"o",
".",
"Interface",
"=",
"v",
";",
"o",
".",
"Interface",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"null... | // SetInterface sets the interface | [
"SetInterface",
"sets",
"the",
"interface"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1399-L1404 |
136,658 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetMode | func (o *Disk) SetMode(v *string) *Disk {
if o.Mode = v; o.Mode == nil {
o.nullFields = append(o.nullFields, "Mode")
}
return o
} | go | func (o *Disk) SetMode(v *string) *Disk {
if o.Mode = v; o.Mode == nil {
o.nullFields = append(o.nullFields, "Mode")
}
return o
} | [
"func",
"(",
"o",
"*",
"Disk",
")",
"SetMode",
"(",
"v",
"*",
"string",
")",
"*",
"Disk",
"{",
"if",
"o",
".",
"Mode",
"=",
"v",
";",
"o",
".",
"Mode",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nullFields",
",",... | // SetMode sets the mode | [
"SetMode",
"sets",
"the",
"mode"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1407-L1412 |
136,659 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetSource | func (o *Disk) SetSource(v *string) *Disk {
if o.Source = v; o.Source == nil {
o.nullFields = append(o.nullFields, "Source")
}
return o
} | go | func (o *Disk) SetSource(v *string) *Disk {
if o.Source = v; o.Source == nil {
o.nullFields = append(o.nullFields, "Source")
}
return o
} | [
"func",
"(",
"o",
"*",
"Disk",
")",
"SetSource",
"(",
"v",
"*",
"string",
")",
"*",
"Disk",
"{",
"if",
"o",
".",
"Source",
"=",
"v",
";",
"o",
".",
"Source",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nullFields",
... | // SetSource sets the source | [
"SetSource",
"sets",
"the",
"source"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1415-L1420 |
136,660 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetDiskSizeGB | func (o *InitializeParams) SetDiskSizeGB(v *int) *InitializeParams {
if o.DiskSizeGB = v; o.DiskSizeGB == nil {
o.nullFields = append(o.nullFields, "DiskSizeGB")
}
return o
} | go | func (o *InitializeParams) SetDiskSizeGB(v *int) *InitializeParams {
if o.DiskSizeGB = v; o.DiskSizeGB == nil {
o.nullFields = append(o.nullFields, "DiskSizeGB")
}
return o
} | [
"func",
"(",
"o",
"*",
"InitializeParams",
")",
"SetDiskSizeGB",
"(",
"v",
"*",
"int",
")",
"*",
"InitializeParams",
"{",
"if",
"o",
".",
"DiskSizeGB",
"=",
"v",
";",
"o",
".",
"DiskSizeGB",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(... | // SetDiskSizeGB sets the disk size in gigabytes, in multiples of 2 | [
"SetDiskSizeGB",
"sets",
"the",
"disk",
"size",
"in",
"gigabytes",
"in",
"multiples",
"of",
"2"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1439-L1444 |
136,661 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetDiskType | func (o *InitializeParams) SetDiskType(v *string) *InitializeParams {
if o.DiskType = v; o.DiskType == nil {
o.nullFields = append(o.nullFields, "DiskType")
}
return o
} | go | func (o *InitializeParams) SetDiskType(v *string) *InitializeParams {
if o.DiskType = v; o.DiskType == nil {
o.nullFields = append(o.nullFields, "DiskType")
}
return o
} | [
"func",
"(",
"o",
"*",
"InitializeParams",
")",
"SetDiskType",
"(",
"v",
"*",
"string",
")",
"*",
"InitializeParams",
"{",
"if",
"o",
".",
"DiskType",
"=",
"v",
";",
"o",
".",
"DiskType",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
... | // SetDiskType sets the type of disk | [
"SetDiskType",
"sets",
"the",
"type",
"of",
"disk"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1447-L1452 |
136,662 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetAccessConfigs | func (o *NetworkInterface) SetAccessConfigs(v []*AccessConfig) *NetworkInterface {
if o.AccessConfigs = v; o.AccessConfigs == nil {
o.nullFields = append(o.nullFields, "AccessConfigs")
}
return o
} | go | func (o *NetworkInterface) SetAccessConfigs(v []*AccessConfig) *NetworkInterface {
if o.AccessConfigs = v; o.AccessConfigs == nil {
o.nullFields = append(o.nullFields, "AccessConfigs")
}
return o
} | [
"func",
"(",
"o",
"*",
"NetworkInterface",
")",
"SetAccessConfigs",
"(",
"v",
"[",
"]",
"*",
"AccessConfig",
")",
"*",
"NetworkInterface",
"{",
"if",
"o",
".",
"AccessConfigs",
"=",
"v",
";",
"o",
".",
"AccessConfigs",
"==",
"nil",
"{",
"o",
".",
"null... | // SetAccessConfigs creates a list of one or more access configuration objects | [
"SetAccessConfigs",
"creates",
"a",
"list",
"of",
"one",
"or",
"more",
"access",
"configuration",
"objects"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1501-L1506 |
136,663 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetAliasIPRanges | func (o *NetworkInterface) SetAliasIPRanges(v []*AliasIPRange) *NetworkInterface {
if o.AliasIPRanges = v; o.AliasIPRanges == nil {
o.nullFields = append(o.nullFields, "AliasIPRanges")
}
return o
} | go | func (o *NetworkInterface) SetAliasIPRanges(v []*AliasIPRange) *NetworkInterface {
if o.AliasIPRanges = v; o.AliasIPRanges == nil {
o.nullFields = append(o.nullFields, "AliasIPRanges")
}
return o
} | [
"func",
"(",
"o",
"*",
"NetworkInterface",
")",
"SetAliasIPRanges",
"(",
"v",
"[",
"]",
"*",
"AliasIPRange",
")",
"*",
"NetworkInterface",
"{",
"if",
"o",
".",
"AliasIPRanges",
"=",
"v",
";",
"o",
".",
"AliasIPRanges",
"==",
"nil",
"{",
"o",
".",
"null... | // SetAliasIPRanges sets a list of alias IP range objects | [
"SetAliasIPRanges",
"sets",
"a",
"list",
"of",
"alias",
"IP",
"range",
"objects"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1509-L1514 |
136,664 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetNetwork | func (o *NetworkInterface) SetNetwork(v *string) *NetworkInterface {
if o.Network = v; o.Network == nil {
o.nullFields = append(o.nullFields, "Network")
}
return o
} | go | func (o *NetworkInterface) SetNetwork(v *string) *NetworkInterface {
if o.Network = v; o.Network == nil {
o.nullFields = append(o.nullFields, "Network")
}
return o
} | [
"func",
"(",
"o",
"*",
"NetworkInterface",
")",
"SetNetwork",
"(",
"v",
"*",
"string",
")",
"*",
"NetworkInterface",
"{",
"if",
"o",
".",
"Network",
"=",
"v",
";",
"o",
".",
"Network",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"... | // SetNetwork sets the name of the network | [
"SetNetwork",
"sets",
"the",
"name",
"of",
"the",
"network"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1517-L1522 |
136,665 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetSubnetworkRangeName | func (o *AliasIPRange) SetSubnetworkRangeName(v *string) *AliasIPRange {
if o.SubnetworkRangeName = v; o.SubnetworkRangeName == nil {
o.nullFields = append(o.nullFields, "SubnetworkRangeName")
}
return o
} | go | func (o *AliasIPRange) SetSubnetworkRangeName(v *string) *AliasIPRange {
if o.SubnetworkRangeName = v; o.SubnetworkRangeName == nil {
o.nullFields = append(o.nullFields, "SubnetworkRangeName")
}
return o
} | [
"func",
"(",
"o",
"*",
"AliasIPRange",
")",
"SetSubnetworkRangeName",
"(",
"v",
"*",
"string",
")",
"*",
"AliasIPRange",
"{",
"if",
"o",
".",
"SubnetworkRangeName",
"=",
"v",
";",
"o",
".",
"SubnetworkRangeName",
"==",
"nil",
"{",
"o",
".",
"nullFields",
... | // SetSubnetworkRangeName sets the name of the subnetwork range | [
"SetSubnetworkRangeName",
"sets",
"the",
"name",
"of",
"the",
"subnetwork",
"range"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1567-L1572 |
136,666 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | MarshalJSON | func (o Metadata) MarshalJSON() ([]byte, error) {
type noMethod Metadata
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
} | go | func (o Metadata) MarshalJSON() ([]byte, error) {
type noMethod Metadata
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
} | [
"func",
"(",
"o",
"Metadata",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"type",
"noMethod",
"Metadata",
"\n",
"raw",
":=",
"noMethod",
"(",
"o",
")",
"\n",
"return",
"jsonutil",
".",
"MarshalJSON",
"(",
"raw",
",",
... | // endregion
// endregion
// region Metadata setters | [
"endregion",
"endregion",
"region",
"Metadata",
"setters"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1580-L1584 |
136,667 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetKey | func (o *Metadata) SetKey(v *string) *Metadata {
if o.Key = v; o.Key == nil {
o.nullFields = append(o.nullFields, "Key")
}
return o
} | go | func (o *Metadata) SetKey(v *string) *Metadata {
if o.Key = v; o.Key == nil {
o.nullFields = append(o.nullFields, "Key")
}
return o
} | [
"func",
"(",
"o",
"*",
"Metadata",
")",
"SetKey",
"(",
"v",
"*",
"string",
")",
"*",
"Metadata",
"{",
"if",
"o",
".",
"Key",
"=",
"v",
";",
"o",
".",
"Key",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nullFields",
... | // SetKey sets the metadata key | [
"SetKey",
"sets",
"the",
"metadata",
"key"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1587-L1592 |
136,668 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetRegion | func (o *Subnet) SetRegion(v *string) *Subnet {
if o.Region = v; o.Region == nil {
o.nullFields = append(o.nullFields, "Region")
}
return o
} | go | func (o *Subnet) SetRegion(v *string) *Subnet {
if o.Region = v; o.Region == nil {
o.nullFields = append(o.nullFields, "Region")
}
return o
} | [
"func",
"(",
"o",
"*",
"Subnet",
")",
"SetRegion",
"(",
"v",
"*",
"string",
")",
"*",
"Subnet",
"{",
"if",
"o",
".",
"Region",
"=",
"v",
";",
"o",
".",
"Region",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"nullField... | // SetRegion sets the region the subnet is in. | [
"SetRegion",
"sets",
"the",
"region",
"the",
"subnet",
"is",
"in",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1615-L1620 |
136,669 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetSubnetNames | func (o *Subnet) SetSubnetNames(v []string) *Subnet {
if o.SubnetNames = v; o.SubnetNames == nil {
o.nullFields = append(o.nullFields, "SubnetNames")
}
return o
} | go | func (o *Subnet) SetSubnetNames(v []string) *Subnet {
if o.SubnetNames = v; o.SubnetNames == nil {
o.nullFields = append(o.nullFields, "SubnetNames")
}
return o
} | [
"func",
"(",
"o",
"*",
"Subnet",
")",
"SetSubnetNames",
"(",
"v",
"[",
"]",
"string",
")",
"*",
"Subnet",
"{",
"if",
"o",
".",
"SubnetNames",
"=",
"v",
";",
"o",
".",
"SubnetNames",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o... | // SetSubnetNames sets the list of subnets names to use | [
"SetSubnetNames",
"sets",
"the",
"list",
"of",
"subnets",
"names",
"to",
"use"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1623-L1628 |
136,670 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetAvailabilityZones | func (o *ImportGKEGroup) SetAvailabilityZones(v []string) *ImportGKEGroup {
if o.AvailabilityZones = v; o.AvailabilityZones == nil {
o.nullFields = append(o.nullFields, "AvailabilityZones")
}
return o
} | go | func (o *ImportGKEGroup) SetAvailabilityZones(v []string) *ImportGKEGroup {
if o.AvailabilityZones = v; o.AvailabilityZones == nil {
o.nullFields = append(o.nullFields, "AvailabilityZones")
}
return o
} | [
"func",
"(",
"o",
"*",
"ImportGKEGroup",
")",
"SetAvailabilityZones",
"(",
"v",
"[",
"]",
"string",
")",
"*",
"ImportGKEGroup",
"{",
"if",
"o",
".",
"AvailabilityZones",
"=",
"v",
";",
"o",
".",
"AvailabilityZones",
"==",
"nil",
"{",
"o",
".",
"nullField... | // SetAvailabilityZones sets the availability zones for the gke group | [
"SetAvailabilityZones",
"sets",
"the",
"availability",
"zones",
"for",
"the",
"gke",
"group"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1643-L1648 |
136,671 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetCapacity | func (o *ImportGKEGroup) SetCapacity(v *CapacityGKE) *ImportGKEGroup {
if o.Capacity = v; o.Capacity == nil {
o.nullFields = append(o.nullFields, "Capacity")
}
return o
} | go | func (o *ImportGKEGroup) SetCapacity(v *CapacityGKE) *ImportGKEGroup {
if o.Capacity = v; o.Capacity == nil {
o.nullFields = append(o.nullFields, "Capacity")
}
return o
} | [
"func",
"(",
"o",
"*",
"ImportGKEGroup",
")",
"SetCapacity",
"(",
"v",
"*",
"CapacityGKE",
")",
"*",
"ImportGKEGroup",
"{",
"if",
"o",
".",
"Capacity",
"=",
"v",
";",
"o",
".",
"Capacity",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",... | // SetCapacity sets the capacity for a gke group | [
"SetCapacity",
"sets",
"the",
"capacity",
"for",
"a",
"gke",
"group"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1651-L1656 |
136,672 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetName | func (o *ImportGKEGroup) SetName(v *string) *ImportGKEGroup {
if o.Name = v; o.Name == nil {
o.nullFields = append(o.nullFields, "Name")
}
return o
} | go | func (o *ImportGKEGroup) SetName(v *string) *ImportGKEGroup {
if o.Name = v; o.Name == nil {
o.nullFields = append(o.nullFields, "Name")
}
return o
} | [
"func",
"(",
"o",
"*",
"ImportGKEGroup",
")",
"SetName",
"(",
"v",
"*",
"string",
")",
"*",
"ImportGKEGroup",
"{",
"if",
"o",
".",
"Name",
"=",
"v",
";",
"o",
".",
"Name",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
... | // SetName sets the group name | [
"SetName",
"sets",
"the",
"group",
"name"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1667-L1672 |
136,673 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetNodeImage | func (o *ImportGKEGroup) SetNodeImage(v *string) *ImportGKEGroup {
if o.NodeImage = v; o.NodeImage == nil {
o.nullFields = append(o.nullFields, "NodeImage")
}
return o
} | go | func (o *ImportGKEGroup) SetNodeImage(v *string) *ImportGKEGroup {
if o.NodeImage = v; o.NodeImage == nil {
o.nullFields = append(o.nullFields, "NodeImage")
}
return o
} | [
"func",
"(",
"o",
"*",
"ImportGKEGroup",
")",
"SetNodeImage",
"(",
"v",
"*",
"string",
")",
"*",
"ImportGKEGroup",
"{",
"if",
"o",
".",
"NodeImage",
"=",
"v",
";",
"o",
".",
"NodeImage",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
... | // SetNodeImage sets the node image for the imported gke group. | [
"SetNodeImage",
"sets",
"the",
"node",
"image",
"for",
"the",
"imported",
"gke",
"group",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1683-L1688 |
136,674 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetPreemptible | func (o *InstanceTypesGKE) SetPreemptible(v []string) *InstanceTypesGKE {
if o.Preemptible = v; o.Preemptible == nil {
o.nullFields = append(o.nullFields, "Preemptible")
}
return o
} | go | func (o *InstanceTypesGKE) SetPreemptible(v []string) *InstanceTypesGKE {
if o.Preemptible = v; o.Preemptible == nil {
o.nullFields = append(o.nullFields, "Preemptible")
}
return o
} | [
"func",
"(",
"o",
"*",
"InstanceTypesGKE",
")",
"SetPreemptible",
"(",
"v",
"[",
"]",
"string",
")",
"*",
"InstanceTypesGKE",
"{",
"if",
"o",
".",
"Preemptible",
"=",
"v",
";",
"o",
".",
"Preemptible",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"... | // SetPreemptible sets the list of preemptible instance types | [
"SetPreemptible",
"sets",
"the",
"list",
"of",
"preemptible",
"instance",
"types"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1705-L1710 |
136,675 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetGKE | func (o *Integration) SetGKE(v *GKEIntegration) *Integration {
if o.GKE = v; o.GKE == nil {
o.nullFields = append(o.nullFields, "GKE")
}
return o
} | go | func (o *Integration) SetGKE(v *GKEIntegration) *Integration {
if o.GKE = v; o.GKE == nil {
o.nullFields = append(o.nullFields, "GKE")
}
return o
} | [
"func",
"(",
"o",
"*",
"Integration",
")",
"SetGKE",
"(",
"v",
"*",
"GKEIntegration",
")",
"*",
"Integration",
"{",
"if",
"o",
".",
"GKE",
"=",
"v",
";",
"o",
".",
"GKE",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o",
".",
"... | // SetGKEIntegration sets the GKE integration | [
"SetGKEIntegration",
"sets",
"the",
"GKE",
"integration"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1723-L1728 |
136,676 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetDockerSwarm | func (o *Integration) SetDockerSwarm(v *DockerSwarmIntegration) *Integration {
if o.DockerSwarm = v; o.DockerSwarm == nil {
o.nullFields = append(o.nullFields, "DockerSwarm")
}
return o
} | go | func (o *Integration) SetDockerSwarm(v *DockerSwarmIntegration) *Integration {
if o.DockerSwarm = v; o.DockerSwarm == nil {
o.nullFields = append(o.nullFields, "DockerSwarm")
}
return o
} | [
"func",
"(",
"o",
"*",
"Integration",
")",
"SetDockerSwarm",
"(",
"v",
"*",
"DockerSwarmIntegration",
")",
"*",
"Integration",
"{",
"if",
"o",
".",
"DockerSwarm",
"=",
"v",
";",
"o",
".",
"DockerSwarm",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"a... | // SetDockerSwarm sets the DockerSwarm integration | [
"SetDockerSwarm",
"sets",
"the",
"DockerSwarm",
"integration"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1731-L1736 |
136,677 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetAutoUpdate | func (o *GKEIntegration) SetAutoUpdate(v *bool) *GKEIntegration {
if o.AutoUpdate = v; o.AutoUpdate == nil {
o.nullFields = append(o.nullFields, "AutoUpdate")
}
return o
} | go | func (o *GKEIntegration) SetAutoUpdate(v *bool) *GKEIntegration {
if o.AutoUpdate = v; o.AutoUpdate == nil {
o.nullFields = append(o.nullFields, "AutoUpdate")
}
return o
} | [
"func",
"(",
"o",
"*",
"GKEIntegration",
")",
"SetAutoUpdate",
"(",
"v",
"*",
"bool",
")",
"*",
"GKEIntegration",
"{",
"if",
"o",
".",
"AutoUpdate",
"=",
"v",
";",
"o",
".",
"AutoUpdate",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
... | // SetAutoUpdate sets the autoupdate flag | [
"SetAutoUpdate",
"sets",
"the",
"autoupdate",
"flag"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1747-L1752 |
136,678 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetAutoScale | func (o *GKEIntegration) SetAutoScale(v *AutoScaleGKE) *GKEIntegration {
if o.AutoScale = v; o.AutoScale == nil {
o.nullFields = append(o.nullFields, "AutoScale")
}
return o
} | go | func (o *GKEIntegration) SetAutoScale(v *AutoScaleGKE) *GKEIntegration {
if o.AutoScale = v; o.AutoScale == nil {
o.nullFields = append(o.nullFields, "AutoScale")
}
return o
} | [
"func",
"(",
"o",
"*",
"GKEIntegration",
")",
"SetAutoScale",
"(",
"v",
"*",
"AutoScaleGKE",
")",
"*",
"GKEIntegration",
"{",
"if",
"o",
".",
"AutoScale",
"=",
"v",
";",
"o",
".",
"AutoScale",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
... | // SetAutoScale sets the AutoScale configuration used with the GKE integration | [
"SetAutoScale",
"sets",
"the",
"AutoScale",
"configuration",
"used",
"with",
"the",
"GKE",
"integration"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1755-L1760 |
136,679 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetLocation | func (o *GKEIntegration) SetLocation(v *string) *GKEIntegration {
if o.Location = v; o.Location == nil {
o.nullFields = append(o.nullFields, "Location")
}
return o
} | go | func (o *GKEIntegration) SetLocation(v *string) *GKEIntegration {
if o.Location = v; o.Location == nil {
o.nullFields = append(o.nullFields, "Location")
}
return o
} | [
"func",
"(",
"o",
"*",
"GKEIntegration",
")",
"SetLocation",
"(",
"v",
"*",
"string",
")",
"*",
"GKEIntegration",
"{",
"if",
"o",
".",
"Location",
"=",
"v",
";",
"o",
".",
"Location",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
"o... | // SetLocation sets the location that the cluster is located in | [
"SetLocation",
"sets",
"the",
"location",
"that",
"the",
"cluster",
"is",
"located",
"in"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1763-L1768 |
136,680 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetClusterID | func (o *GKEIntegration) SetClusterID(v *string) *GKEIntegration {
if o.ClusterID = v; o.ClusterID == nil {
o.nullFields = append(o.nullFields, "ClusterID")
}
return o
} | go | func (o *GKEIntegration) SetClusterID(v *string) *GKEIntegration {
if o.ClusterID = v; o.ClusterID == nil {
o.nullFields = append(o.nullFields, "ClusterID")
}
return o
} | [
"func",
"(",
"o",
"*",
"GKEIntegration",
")",
"SetClusterID",
"(",
"v",
"*",
"string",
")",
"*",
"GKEIntegration",
"{",
"if",
"o",
".",
"ClusterID",
"=",
"v",
";",
"o",
".",
"ClusterID",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",
"(",
... | // SetClusterID sets the cluster ID | [
"SetClusterID",
"sets",
"the",
"cluster",
"ID"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1771-L1776 |
136,681 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetLabels | func (o *AutoScaleGKE) SetLabels(v []*AutoScaleLabel) *AutoScaleGKE {
if o.Labels = v; o.Labels == nil {
o.nullFields = append(o.nullFields, "Labels")
}
return o
} | go | func (o *AutoScaleGKE) SetLabels(v []*AutoScaleLabel) *AutoScaleGKE {
if o.Labels = v; o.Labels == nil {
o.nullFields = append(o.nullFields, "Labels")
}
return o
} | [
"func",
"(",
"o",
"*",
"AutoScaleGKE",
")",
"SetLabels",
"(",
"v",
"[",
"]",
"*",
"AutoScaleLabel",
")",
"*",
"AutoScaleGKE",
"{",
"if",
"o",
".",
"Labels",
"=",
"v",
";",
"o",
".",
"Labels",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"append",... | // SetLabels sets the AutoScale labels for the GKE integration | [
"SetLabels",
"sets",
"the",
"AutoScale",
"labels",
"for",
"the",
"GKE",
"integration"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1787-L1792 |
136,682 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetMasterPort | func (o *DockerSwarmIntegration) SetMasterPort(v *int) *DockerSwarmIntegration {
if o.MasterPort = v; o.MasterPort == nil {
o.nullFields = append(o.nullFields, "MasterPort")
}
return o
} | go | func (o *DockerSwarmIntegration) SetMasterPort(v *int) *DockerSwarmIntegration {
if o.MasterPort = v; o.MasterPort == nil {
o.nullFields = append(o.nullFields, "MasterPort")
}
return o
} | [
"func",
"(",
"o",
"*",
"DockerSwarmIntegration",
")",
"SetMasterPort",
"(",
"v",
"*",
"int",
")",
"*",
"DockerSwarmIntegration",
"{",
"if",
"o",
".",
"MasterPort",
"=",
"v",
";",
"o",
".",
"MasterPort",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"a... | // SetMasterPort sets the master port | [
"SetMasterPort",
"sets",
"the",
"master",
"port"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L1807-L1812 |
136,683 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetFallbackToOnDemand | func (o *Strategy) SetFallbackToOnDemand(v *bool) *Strategy {
if o.FallbackToOnDemand = v; o.FallbackToOnDemand == nil {
o.nullFields = append(o.nullFields, "FallbackToOnDemand")
}
return o
} | go | func (o *Strategy) SetFallbackToOnDemand(v *bool) *Strategy {
if o.FallbackToOnDemand = v; o.FallbackToOnDemand == nil {
o.nullFields = append(o.nullFields, "FallbackToOnDemand")
}
return o
} | [
"func",
"(",
"o",
"*",
"Strategy",
")",
"SetFallbackToOnDemand",
"(",
"v",
"*",
"bool",
")",
"*",
"Strategy",
"{",
"if",
"o",
".",
"FallbackToOnDemand",
"=",
"v",
";",
"o",
".",
"FallbackToOnDemand",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",
"appe... | // SetFallbackToOnDemand sets the option to fallback to on demand instances if preemptible instances arent available | [
"SetFallbackToOnDemand",
"sets",
"the",
"option",
"to",
"fallback",
"to",
"on",
"demand",
"instances",
"if",
"preemptible",
"instances",
"arent",
"available"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L2035-L2040 |
136,684 | spotinst/spotinst-sdk-go | service/elastigroup/providers/gcp/gcp.go | SetPreemptiblePercentage | func (o *Strategy) SetPreemptiblePercentage(v *int) *Strategy {
if o.PreemptiblePercentage = v; o.PreemptiblePercentage == nil {
o.nullFields = append(o.nullFields, "PreemptiblePercentage")
}
return o
} | go | func (o *Strategy) SetPreemptiblePercentage(v *int) *Strategy {
if o.PreemptiblePercentage = v; o.PreemptiblePercentage == nil {
o.nullFields = append(o.nullFields, "PreemptiblePercentage")
}
return o
} | [
"func",
"(",
"o",
"*",
"Strategy",
")",
"SetPreemptiblePercentage",
"(",
"v",
"*",
"int",
")",
"*",
"Strategy",
"{",
"if",
"o",
".",
"PreemptiblePercentage",
"=",
"v",
";",
"o",
".",
"PreemptiblePercentage",
"==",
"nil",
"{",
"o",
".",
"nullFields",
"=",... | // SetPreemptiblePercentage sets the ratio of preemptible instances to use in the group | [
"SetPreemptiblePercentage",
"sets",
"the",
"ratio",
"of",
"preemptible",
"instances",
"to",
"use",
"in",
"the",
"group"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/elastigroup/providers/gcp/gcp.go#L2043-L2048 |
136,685 | spotinst/spotinst-sdk-go | spotinst/client/client.go | New | func New(cfg *spotinst.Config) *Client {
if cfg == nil {
cfg = spotinst.DefaultConfig()
}
return &Client{cfg}
} | go | func New(cfg *spotinst.Config) *Client {
if cfg == nil {
cfg = spotinst.DefaultConfig()
}
return &Client{cfg}
} | [
"func",
"New",
"(",
"cfg",
"*",
"spotinst",
".",
"Config",
")",
"*",
"Client",
"{",
"if",
"cfg",
"==",
"nil",
"{",
"cfg",
"=",
"spotinst",
".",
"DefaultConfig",
"(",
")",
"\n",
"}",
"\n",
"return",
"&",
"Client",
"{",
"cfg",
"}",
"\n",
"}"
] | // New returns a new client. | [
"New",
"returns",
"a",
"new",
"client",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/client/client.go#L18-L23 |
136,686 | spotinst/spotinst-sdk-go | spotinst/client/client.go | NewRequest | func NewRequest(method, path string) *Request {
return &Request{
method: method,
url: &url.URL{
Path: path,
},
header: make(http.Header),
Params: make(url.Values),
}
} | go | func NewRequest(method, path string) *Request {
return &Request{
method: method,
url: &url.URL{
Path: path,
},
header: make(http.Header),
Params: make(url.Values),
}
} | [
"func",
"NewRequest",
"(",
"method",
",",
"path",
"string",
")",
"*",
"Request",
"{",
"return",
"&",
"Request",
"{",
"method",
":",
"method",
",",
"url",
":",
"&",
"url",
".",
"URL",
"{",
"Path",
":",
"path",
",",
"}",
",",
"header",
":",
"make",
... | // NewRequest is used to create a new request. | [
"NewRequest",
"is",
"used",
"to",
"create",
"a",
"new",
"request",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/client/client.go#L26-L35 |
136,687 | spotinst/spotinst-sdk-go | spotinst/client/client.go | Do | func (c *Client) Do(ctx context.Context, r *Request) (*http.Response, error) {
req, err := r.toHTTP(ctx, c.config)
if err != nil {
return nil, err
}
c.logRequest(req)
resp, err := c.config.HTTPClient.Do(req)
c.logResponse(resp)
return resp, err
} | go | func (c *Client) Do(ctx context.Context, r *Request) (*http.Response, error) {
req, err := r.toHTTP(ctx, c.config)
if err != nil {
return nil, err
}
c.logRequest(req)
resp, err := c.config.HTTPClient.Do(req)
c.logResponse(resp)
return resp, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Do",
"(",
"ctx",
"context",
".",
"Context",
",",
"r",
"*",
"Request",
")",
"(",
"*",
"http",
".",
"Response",
",",
"error",
")",
"{",
"req",
",",
"err",
":=",
"r",
".",
"toHTTP",
"(",
"ctx",
",",
"c",
".... | // Do runs a request with our client. | [
"Do",
"runs",
"a",
"request",
"with",
"our",
"client",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/client/client.go#L38-L47 |
136,688 | spotinst/spotinst-sdk-go | spotinst/client/request.go | toHTTP | func (r *Request) toHTTP(ctx context.Context, cfg *spotinst.Config) (*http.Request, error) {
// Set the user credentials.
creds, err := cfg.Credentials.Get()
if err != nil {
return nil, err
}
if creds.Token != "" {
r.header.Set("Authorization", "Bearer "+creds.Token)
}
if creds.Account != "" {
r.Params.Set... | go | func (r *Request) toHTTP(ctx context.Context, cfg *spotinst.Config) (*http.Request, error) {
// Set the user credentials.
creds, err := cfg.Credentials.Get()
if err != nil {
return nil, err
}
if creds.Token != "" {
r.header.Set("Authorization", "Bearer "+creds.Token)
}
if creds.Account != "" {
r.Params.Set... | [
"func",
"(",
"r",
"*",
"Request",
")",
"toHTTP",
"(",
"ctx",
"context",
".",
"Context",
",",
"cfg",
"*",
"spotinst",
".",
"Config",
")",
"(",
"*",
"http",
".",
"Request",
",",
"error",
")",
"{",
"// Set the user credentials.",
"creds",
",",
"err",
":="... | // toHTTP converts the request to an HTTP request. | [
"toHTTP",
"converts",
"the",
"request",
"to",
"an",
"HTTP",
"request",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/client/request.go#L24-L67 |
136,689 | spotinst/spotinst-sdk-go | spotinst/config.go | DefaultConfig | func DefaultConfig() *Config {
return &Config{
BaseURL: DefaultBaseURL(),
HTTPClient: DefaultHTTPClient(),
UserAgent: defaultUserAgent,
ContentType: defaultContentType,
Credentials: credentials.NewChainCredentials(
new(credentials.EnvProvider),
new(credentials.FileProvider),
),
}
} | go | func DefaultConfig() *Config {
return &Config{
BaseURL: DefaultBaseURL(),
HTTPClient: DefaultHTTPClient(),
UserAgent: defaultUserAgent,
ContentType: defaultContentType,
Credentials: credentials.NewChainCredentials(
new(credentials.EnvProvider),
new(credentials.FileProvider),
),
}
} | [
"func",
"DefaultConfig",
"(",
")",
"*",
"Config",
"{",
"return",
"&",
"Config",
"{",
"BaseURL",
":",
"DefaultBaseURL",
"(",
")",
",",
"HTTPClient",
":",
"DefaultHTTPClient",
"(",
")",
",",
"UserAgent",
":",
"defaultUserAgent",
",",
"ContentType",
":",
"defau... | // DefaultConfig returns a default configuration for the client. By default this
// will pool and reuse idle connections to API. If you have a long-lived
// client object, this is the desired behavior and should make the most efficient
// use of the connections to API. | [
"DefaultConfig",
"returns",
"a",
"default",
"configuration",
"for",
"the",
"client",
".",
"By",
"default",
"this",
"will",
"pool",
"and",
"reuse",
"idle",
"connections",
"to",
"API",
".",
"If",
"you",
"have",
"a",
"long",
"-",
"lived",
"client",
"object",
... | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/config.go#L81-L92 |
136,690 | spotinst/spotinst-sdk-go | spotinst/config.go | WithBaseURL | func (c *Config) WithBaseURL(rawurl string) *Config {
baseURL, _ := url.Parse(rawurl)
c.BaseURL = baseURL
return c
} | go | func (c *Config) WithBaseURL(rawurl string) *Config {
baseURL, _ := url.Parse(rawurl)
c.BaseURL = baseURL
return c
} | [
"func",
"(",
"c",
"*",
"Config",
")",
"WithBaseURL",
"(",
"rawurl",
"string",
")",
"*",
"Config",
"{",
"baseURL",
",",
"_",
":=",
"url",
".",
"Parse",
"(",
"rawurl",
")",
"\n",
"c",
".",
"BaseURL",
"=",
"baseURL",
"\n",
"return",
"c",
"\n",
"}"
] | // WithBaseURL defines the base URL of the Spotinst API. | [
"WithBaseURL",
"defines",
"the",
"base",
"URL",
"of",
"the",
"Spotinst",
"API",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/config.go#L95-L99 |
136,691 | spotinst/spotinst-sdk-go | spotinst/config.go | WithUserAgent | func (c *Config) WithUserAgent(ua string) *Config {
c.UserAgent = fmt.Sprintf("%s,%s", ua, c.UserAgent)
return c
} | go | func (c *Config) WithUserAgent(ua string) *Config {
c.UserAgent = fmt.Sprintf("%s,%s", ua, c.UserAgent)
return c
} | [
"func",
"(",
"c",
"*",
"Config",
")",
"WithUserAgent",
"(",
"ua",
"string",
")",
"*",
"Config",
"{",
"c",
".",
"UserAgent",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ua",
",",
"c",
".",
"UserAgent",
")",
"\n",
"return",
"c",
"\n",
"}"
] | // WithUserAgent defines the user agent. | [
"WithUserAgent",
"defines",
"the",
"user",
"agent",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/config.go#L114-L117 |
136,692 | spotinst/spotinst-sdk-go | spotinst/config.go | WithContentType | func (c *Config) WithContentType(ct string) *Config {
c.ContentType = ct
return c
} | go | func (c *Config) WithContentType(ct string) *Config {
c.ContentType = ct
return c
} | [
"func",
"(",
"c",
"*",
"Config",
")",
"WithContentType",
"(",
"ct",
"string",
")",
"*",
"Config",
"{",
"c",
".",
"ContentType",
"=",
"ct",
"\n",
"return",
"c",
"\n",
"}"
] | // WithContentType defines the content type. | [
"WithContentType",
"defines",
"the",
"content",
"type",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/config.go#L120-L123 |
136,693 | spotinst/spotinst-sdk-go | spotinst/config.go | Merge | func (c *Config) Merge(cfgs ...*Config) {
for _, other := range cfgs {
mergeConfig(c, other)
}
} | go | func (c *Config) Merge(cfgs ...*Config) {
for _, other := range cfgs {
mergeConfig(c, other)
}
} | [
"func",
"(",
"c",
"*",
"Config",
")",
"Merge",
"(",
"cfgs",
"...",
"*",
"Config",
")",
"{",
"for",
"_",
",",
"other",
":=",
"range",
"cfgs",
"{",
"mergeConfig",
"(",
"c",
",",
"other",
")",
"\n",
"}",
"\n",
"}"
] | // Merge merges the passed in configs into the existing config object. | [
"Merge",
"merges",
"the",
"passed",
"in",
"configs",
"into",
"the",
"existing",
"config",
"object",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/config.go#L133-L137 |
136,694 | spotinst/spotinst-sdk-go | spotinst/credentials/provider_chain.go | Retrieve | func (c *ChainProvider) Retrieve() (Value, error) {
var errs errorList
for _, p := range c.Providers {
value, err := p.Retrieve()
if err == nil {
c.active = p
return value, nil
}
errs = append(errs, err)
}
c.active = nil
err := ErrNoValidProvidersFoundInChain
if len(errs) > 0 {
err = errs
}
re... | go | func (c *ChainProvider) Retrieve() (Value, error) {
var errs errorList
for _, p := range c.Providers {
value, err := p.Retrieve()
if err == nil {
c.active = p
return value, nil
}
errs = append(errs, err)
}
c.active = nil
err := ErrNoValidProvidersFoundInChain
if len(errs) > 0 {
err = errs
}
re... | [
"func",
"(",
"c",
"*",
"ChainProvider",
")",
"Retrieve",
"(",
")",
"(",
"Value",
",",
"error",
")",
"{",
"var",
"errs",
"errorList",
"\n",
"for",
"_",
",",
"p",
":=",
"range",
"c",
".",
"Providers",
"{",
"value",
",",
"err",
":=",
"p",
".",
"Retr... | // Retrieve returns the credentials value or error if no provider returned
// without error. If a provider is found it will be cached. | [
"Retrieve",
"returns",
"the",
"credentials",
"value",
"or",
"error",
"if",
"no",
"provider",
"returned",
"without",
"error",
".",
"If",
"a",
"provider",
"is",
"found",
"it",
"will",
"be",
"cached",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/credentials/provider_chain.go#L51-L69 |
136,695 | spotinst/spotinst-sdk-go | spotinst/credentials/provider_chain.go | Error | func (e errorList) Error() string {
msg := ""
if size := len(e); size > 0 {
for i := 0; i < size; i++ {
msg += fmt.Sprintf("%s", e[i].Error())
// We check the next index to see if it is within the slice.
// If it is, then we append a newline. We do this, because unit tests
// could be broken with the ad... | go | func (e errorList) Error() string {
msg := ""
if size := len(e); size > 0 {
for i := 0; i < size; i++ {
msg += fmt.Sprintf("%s", e[i].Error())
// We check the next index to see if it is within the slice.
// If it is, then we append a newline. We do this, because unit tests
// could be broken with the ad... | [
"func",
"(",
"e",
"errorList",
")",
"Error",
"(",
")",
"string",
"{",
"msg",
":=",
"\"",
"\"",
"\n",
"if",
"size",
":=",
"len",
"(",
"e",
")",
";",
"size",
">",
"0",
"{",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
"{",
... | // Error returns the string representation of the error.
//
// Satisfies the error interface. | [
"Error",
"returns",
"the",
"string",
"representation",
"of",
"the",
"error",
".",
"Satisfies",
"the",
"error",
"interface",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/credentials/provider_chain.go#L88-L102 |
136,696 | spotinst/spotinst-sdk-go | spotinst/util/stringutil/stringutil.go | Stringify | func Stringify(message interface{}) string {
var buf bytes.Buffer
v := reflect.ValueOf(message)
stringifyValue(&buf, v)
return buf.String()
} | go | func Stringify(message interface{}) string {
var buf bytes.Buffer
v := reflect.ValueOf(message)
stringifyValue(&buf, v)
return buf.String()
} | [
"func",
"Stringify",
"(",
"message",
"interface",
"{",
"}",
")",
"string",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"v",
":=",
"reflect",
".",
"ValueOf",
"(",
"message",
")",
"\n",
"stringifyValue",
"(",
"&",
"buf",
",",
"v",
")",
"\n",
"retu... | // Stringify attempts to create a reasonable string representation of types.
// It does things like resolve pointers to their values and omits struct
// fields with nil values. | [
"Stringify",
"attempts",
"to",
"create",
"a",
"reasonable",
"string",
"representation",
"of",
"types",
".",
"It",
"does",
"things",
"like",
"resolve",
"pointers",
"to",
"their",
"values",
"and",
"omits",
"struct",
"fields",
"with",
"nil",
"values",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/util/stringutil/stringutil.go#L13-L18 |
136,697 | spotinst/spotinst-sdk-go | spotinst/util/stringutil/stringutil.go | stringifyValue | func stringifyValue(w io.Writer, val reflect.Value) {
if val.Kind() == reflect.Ptr && val.IsNil() {
w.Write([]byte("<nil>"))
return
}
v := reflect.Indirect(val)
switch v.Kind() {
case reflect.String:
fmt.Fprintf(w, `"%s"`, v)
case reflect.Slice:
w.Write([]byte{'['})
for i := 0; i < v.Len(); i++ {
if ... | go | func stringifyValue(w io.Writer, val reflect.Value) {
if val.Kind() == reflect.Ptr && val.IsNil() {
w.Write([]byte("<nil>"))
return
}
v := reflect.Indirect(val)
switch v.Kind() {
case reflect.String:
fmt.Fprintf(w, `"%s"`, v)
case reflect.Slice:
w.Write([]byte{'['})
for i := 0; i < v.Len(); i++ {
if ... | [
"func",
"stringifyValue",
"(",
"w",
"io",
".",
"Writer",
",",
"val",
"reflect",
".",
"Value",
")",
"{",
"if",
"val",
".",
"Kind",
"(",
")",
"==",
"reflect",
".",
"Ptr",
"&&",
"val",
".",
"IsNil",
"(",
")",
"{",
"w",
".",
"Write",
"(",
"[",
"]",... | // stringifyValue was heavily inspired by the goprotobuf library. | [
"stringifyValue",
"was",
"heavily",
"inspired",
"by",
"the",
"goprotobuf",
"library",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/util/stringutil/stringutil.go#L21-L69 |
136,698 | spotinst/spotinst-sdk-go | spotinst/client/response.go | DecodeBody | func DecodeBody(resp *http.Response, out interface{}) error {
return json.NewDecoder(resp.Body).Decode(out)
} | go | func DecodeBody(resp *http.Response, out interface{}) error {
return json.NewDecoder(resp.Body).Decode(out)
} | [
"func",
"DecodeBody",
"(",
"resp",
"*",
"http",
".",
"Response",
",",
"out",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"json",
".",
"NewDecoder",
"(",
"resp",
".",
"Body",
")",
".",
"Decode",
"(",
"out",
")",
"\n",
"}"
] | // DecodeBody is used to JSON decode a body | [
"DecodeBody",
"is",
"used",
"to",
"JSON",
"decode",
"a",
"body"
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/client/response.go#L60-L62 |
136,699 | spotinst/spotinst-sdk-go | spotinst/util/jsonutil/json.go | formatAsString | func formatAsString(v reflect.Value, kind reflect.Kind) string {
if kind == reflect.Ptr && !v.IsNil() {
v = v.Elem()
}
return fmt.Sprintf("%v", v.Interface())
} | go | func formatAsString(v reflect.Value, kind reflect.Kind) string {
if kind == reflect.Ptr && !v.IsNil() {
v = v.Elem()
}
return fmt.Sprintf("%v", v.Interface())
} | [
"func",
"formatAsString",
"(",
"v",
"reflect",
".",
"Value",
",",
"kind",
"reflect",
".",
"Kind",
")",
"string",
"{",
"if",
"kind",
"==",
"reflect",
".",
"Ptr",
"&&",
"!",
"v",
".",
"IsNil",
"(",
")",
"{",
"v",
"=",
"v",
".",
"Elem",
"(",
")",
... | // formatAsString returns a string representation of v, dereferencing it first if possible. | [
"formatAsString",
"returns",
"a",
"string",
"representation",
"of",
"v",
"dereferencing",
"it",
"first",
"if",
"possible",
"."
] | 8cd52da677ef8425428ef610f0243863759639c8 | https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/util/jsonutil/json.go#L95-L101 |
Subsets and Splits
SQL Console for google/code_x_glue_ct_code_to_text
This query implements a thoughtful three-tier curation strategy to build a balanced safety dataset, categorizing code by destructive operations, safe I/O operations, and pure computational negatives with subsampling—revealing important patterns about how destructive intent manifests in Python code for model safety research.
SQL Console for google/code_x_glue_ct_code_to_text
This query performs meaningful classification of Python code samples into safety-relevant tiers based on destructive operations, I/O patterns, and pure computation, which could be valuable for building safety classifiers or curating training data, though the output itself is a filtered/ranked dataset rather than revealing novel statistical insights.