id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
sequence
docstring
stringlengths
6
2.61k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
85
252
14,600
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", ".", "Value", "{", "case", "\"", "\"", ",", "\"", "\"", ":", "return", "h", ".", "Value", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "\"", "\"", "\n", "}" ]
// 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
14,601
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 %s%s %s\r\n", method, path, q, version) w.StartHeaders() return err }
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 %s%s %s\r\n", method, path, q, version) w.StartHeaders() return err }
[ "func", "(", "w", "*", "writer", ")", "WriteRequestLine", "(", "method", ",", "path", "string", ",", "query", "[", "]", "string", ",", "version", "string", ")", "error", "{", "if", "w", ".", "phase", "!=", "requestline", "{", "return", "&", "phaseError", "{", "requestline", ",", "w", ".", "phase", "}", "\n", "}", "\n", "q", ":=", "strings", ".", "Join", "(", "query", ",", "\"", "\"", ")", "\n", "if", "len", "(", "q", ")", ">", "0", "{", "q", "=", "\"", "\"", "+", "q", "\n", "}", "\n", "w", ".", "tmp", ",", "w", ".", "Writer", "=", "w", ".", "Writer", ",", "bufio", ".", "NewWriter", "(", "w", ".", "Writer", ")", "\n", "_", ",", "err", ":=", "fmt", ".", "Fprintf", "(", "w", ",", "\"", "\\r", "\\n", "\"", ",", "method", ",", "path", ",", "q", ",", "version", ")", "\n", "w", ".", "StartHeaders", "(", ")", "\n", "return", "err", "\n", "}" ]
// 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
14,602
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", "_", ",", "err", ":=", "fmt", ".", "Fprintf", "(", "w", ",", "\"", "\\r", "\\n", "\"", ",", "key", ",", "value", ")", "\n", "return", "err", "\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
14,603
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", "}", "\n", "err", ":=", "w", ".", "Writer", ".", "(", "*", "bufio", ".", "Writer", ")", ".", "Flush", "(", ")", "\n", "w", ".", "Writer", ",", "w", ".", "tmp", "=", "w", ".", "tmp", ",", "nil", "\n", "w", ".", "phase", "=", "body", "\n", "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
14,604
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", "_", ",", "err", ":=", "io", ".", "Copy", "(", "w", ",", "r", ")", "\n", "w", ".", "phase", "=", "requestline", "\n", "return", "err", "\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
14,605
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", ":=", "httputil", ".", "NewChunkedWriter", "(", "w", ")", "\n", "if", "_", ",", "err", ":=", "io", ".", "Copy", "(", "cw", ",", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", "\n", "}", "\n", "w", ".", "phase", "=", "requestline", "\n", "return", "cw", ".", "Close", "(", ")", "\n", "}" ]
// 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
14,606
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' { return readVersionErr(pos, 'T', c) } case 3: if c != 'P' { return readVersionErr(pos, 'P', c) } case 4: if c != '/' { return readVersionErr(pos, '/', c) } case 5: switch c { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': major = int(int(c) - 0x30) } case 6: if c != '.' { return readVersionErr(pos, '.', c) } case 7: switch c { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': minor = int(int(c) - 0x30) } case 8: if c != ' ' { return readVersionErr(pos, ' ', c) } } } return Version{major, minor}, nil }
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' { return readVersionErr(pos, 'T', c) } case 3: if c != 'P' { return readVersionErr(pos, 'P', c) } case 4: if c != '/' { return readVersionErr(pos, '/', c) } case 5: switch c { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': major = int(int(c) - 0x30) } case 6: if c != '.' { return readVersionErr(pos, '.', c) } case 7: switch c { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': minor = int(int(c) - 0x30) } case 8: if c != ' ' { return readVersionErr(pos, ' ', c) } } } return Version{major, minor}, nil }
[ "func", "(", "r", "*", "reader", ")", "ReadVersion", "(", ")", "(", "Version", ",", "error", ")", "{", "var", "major", ",", "minor", "int", "\n", "for", "pos", ":=", "0", ";", "pos", "<", "len", "(", "\"", "\"", ")", ";", "pos", "++", "{", "c", ",", "err", ":=", "r", ".", "ReadByte", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "invalidVersion", ",", "err", "\n", "}", "\n", "switch", "pos", "{", "case", "0", ":", "if", "c", "!=", "'H'", "{", "return", "readVersionErr", "(", "pos", ",", "'H'", ",", "c", ")", "\n", "}", "\n", "case", "1", ",", "2", ":", "if", "c", "!=", "'T'", "{", "return", "readVersionErr", "(", "pos", ",", "'T'", ",", "c", ")", "\n", "}", "\n", "case", "3", ":", "if", "c", "!=", "'P'", "{", "return", "readVersionErr", "(", "pos", ",", "'P'", ",", "c", ")", "\n", "}", "\n", "case", "4", ":", "if", "c", "!=", "'/'", "{", "return", "readVersionErr", "(", "pos", ",", "'/'", ",", "c", ")", "\n", "}", "\n", "case", "5", ":", "switch", "c", "{", "case", "'0'", ",", "'1'", ",", "'2'", ",", "'3'", ",", "'4'", ",", "'5'", ",", "'6'", ",", "'7'", ",", "'8'", ",", "'9'", ":", "major", "=", "int", "(", "int", "(", "c", ")", "-", "0x30", ")", "\n", "}", "\n", "case", "6", ":", "if", "c", "!=", "'.'", "{", "return", "readVersionErr", "(", "pos", ",", "'.'", ",", "c", ")", "\n", "}", "\n", "case", "7", ":", "switch", "c", "{", "case", "'0'", ",", "'1'", ",", "'2'", ",", "'3'", ",", "'4'", ",", "'5'", ",", "'6'", ",", "'7'", ",", "'8'", ",", "'9'", ":", "minor", "=", "int", "(", "int", "(", "c", ")", "-", "0x30", ")", "\n", "}", "\n", "case", "8", ":", "if", "c", "!=", "' '", "{", "return", "readVersionErr", "(", "pos", ",", "' '", ",", "c", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "Version", "{", "major", ",", "minor", "}", ",", "nil", "\n", "}" ]
// 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
14,607
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(c)-0x30) * 100 case 1: code += int(int(c)-0x30) * 10 case 2: code += int(int(c) - 0x30) } } case 3: switch c { case '\r': // special case "HTTP/1.1 301\r\n" has a blank reason. case ' ': // nothing default: return 0, fmt.Errorf("ReadStatusCode: expected %q, got %q at position %v", ' ', c, pos) } } } return code, nil }
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(c)-0x30) * 100 case 1: code += int(int(c)-0x30) * 10 case 2: code += int(int(c) - 0x30) } } case 3: switch c { case '\r': // special case "HTTP/1.1 301\r\n" has a blank reason. case ' ': // nothing default: return 0, fmt.Errorf("ReadStatusCode: expected %q, got %q at position %v", ' ', c, pos) } } } return code, nil }
[ "func", "(", "r", "*", "reader", ")", "ReadStatusCode", "(", ")", "(", "int", ",", "error", ")", "{", "var", "code", "int", "\n", "for", "pos", ":=", "0", ";", "pos", "<", "len", "(", "\"", "\"", ")", ";", "pos", "++", "{", "c", ",", "err", ":=", "r", ".", "ReadByte", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n", "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", "(", "c", ")", "-", "0x30", ")", "*", "100", "\n", "case", "1", ":", "code", "+=", "int", "(", "int", "(", "c", ")", "-", "0x30", ")", "*", "10", "\n", "case", "2", ":", "code", "+=", "int", "(", "int", "(", "c", ")", "-", "0x30", ")", "\n", "}", "\n", "}", "\n", "case", "3", ":", "switch", "c", "{", "case", "'\\r'", ":", "// special case \"HTTP/1.1 301\\r\\n\" has a blank reason.", "case", "' '", ":", "// nothing", "default", ":", "return", "0", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "' '", ",", "c", ",", "pos", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "code", ",", "nil", "\n", "}" ]
// 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
14,608
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", "Version", "{", "}", ",", "0", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "code", ",", "err", ":=", "r", ".", "ReadStatusCode", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "Version", "{", "}", ",", "0", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "msg", ",", "_", ",", "err", ":=", "r", ".", "ReadLine", "(", ")", "\n", "return", "version", ",", "code", ",", "string", "(", "msg", ")", ",", "err", "\n", "}" ]
// ReadStatusLine reads the status line.
[ "ReadStatusLine", "reads", "the", "status", "line", "." ]
732371cf4733ce912492655d1c0d18af235771f2
https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/reader.go#L104-L115
14,609
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("invalid header line: %q", line) } return string(bytes.TrimSpace(v[0])), string(bytes.TrimSpace(v[1])), false, nil }
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("invalid header line: %q", line) } return string(bytes.TrimSpace(v[0])), string(bytes.TrimSpace(v[1])), false, nil }
[ "func", "(", "r", "*", "reader", ")", "ReadHeader", "(", ")", "(", "string", ",", "string", ",", "bool", ",", "error", ")", "{", "line", ",", "err", ":=", "r", ".", "readLine", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "\"", "\"", ",", "false", ",", "err", "\n", "}", "\n", "if", "line", ":=", "string", "(", "line", ")", ";", "line", "==", "\"", "\\r", "\\n", "\"", "||", "line", "==", "\"", "\\n", "\"", "{", "return", "\"", "\"", ",", "\"", "\"", ",", "true", ",", "nil", "\n", "}", "\n", "v", ":=", "bytes", ".", "SplitN", "(", "line", ",", "[", "]", "byte", "(", "\"", "\"", ")", ",", "2", ")", "\n", "if", "len", "(", "v", ")", "!=", "2", "{", "return", "\"", "\"", ",", "\"", "\"", ",", "false", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "line", ")", "\n", "}", "\n", "return", "string", "(", "bytes", ".", "TrimSpace", "(", "v", "[", "0", "]", ")", ")", ",", "string", "(", "bytes", ".", "TrimSpace", "(", "v", "[", "1", "]", ")", ")", ",", "false", ",", "nil", "\n", "}" ]
// ReadHeader reads a http header.
[ "ReadHeader", "reads", "a", "http", "header", "." ]
732371cf4733ce912492655d1c0d18af235771f2
https://github.com/gorilla/http/blob/732371cf4733ce912492655d1c0d18af235771f2/client/reader.go#L118-L131
14,610
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", "|", "tileKey", "(", "x", "&", "(", "1", "<<", "14", "-", "1", ")", ")", "\n", "}" ]
// 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
14,611
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 == "" { return "", ErrFileCredentialsHomeNotFound } p.Filename = filepath.Join(homeDir, ".spotinst", "credentials") } return p.Filename, nil }
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 == "" { return "", ErrFileCredentialsHomeNotFound } p.Filename = filepath.Join(homeDir, ".spotinst", "credentials") } return p.Filename, nil }
[ "func", "(", "p", "*", "FileProvider", ")", "filename", "(", ")", "(", "string", ",", "error", ")", "{", "if", "p", ".", "Filename", "==", "\"", "\"", "{", "if", "p", ".", "Filename", "=", "os", ".", "Getenv", "(", "FileCredentialsEnvVarFile", ")", ";", "p", ".", "Filename", "!=", "\"", "\"", "{", "return", "p", ".", "Filename", ",", "nil", "\n", "}", "\n\n", "homeDir", ":=", "os", ".", "Getenv", "(", "\"", "\"", ")", "// *nix", "\n", "if", "homeDir", "==", "\"", "\"", "{", "// Windows", "homeDir", "=", "os", ".", "Getenv", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "homeDir", "==", "\"", "\"", "{", "return", "\"", "\"", ",", "ErrFileCredentialsHomeNotFound", "\n", "}", "\n\n", "p", ".", "Filename", "=", "filepath", ".", "Join", "(", "homeDir", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "}", "\n\n", "return", "p", ".", "Filename", ",", "nil", "\n", "}" ]
// 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
14,612
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(&value); err != nil { return Value{ProviderName: FileCredentialsProviderName}, fmt.Errorf("%s: %s", ErrFileCredentialsLoadFailed.Error(), err) } if token := value.Token; len(token) == 0 { return Value{ProviderName: FileCredentialsProviderName}, ErrFileCredentialsTokenNotFound } return value, nil }
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(&value); err != nil { return Value{ProviderName: FileCredentialsProviderName}, fmt.Errorf("%s: %s", ErrFileCredentialsLoadFailed.Error(), err) } if token := value.Token; len(token) == 0 { return Value{ProviderName: FileCredentialsProviderName}, ErrFileCredentialsTokenNotFound } return value, nil }
[ "func", "(", "p", "*", "FileProvider", ")", "loadCredentials", "(", "filename", "string", ")", "(", "Value", ",", "error", ")", "{", "f", ",", "err", ":=", "os", ".", "Open", "(", "filename", ")", "\n", "if", "err", "!=", "nil", "{", "return", "Value", "{", "ProviderName", ":", "FileCredentialsProviderName", "}", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "ErrFileCredentialsLoadFailed", ".", "Error", "(", ")", ",", "err", ")", "\n", "}", "\n", "defer", "f", ".", "Close", "(", ")", "\n\n", "var", "value", "Value", "\n", "if", "err", ":=", "json", ".", "NewDecoder", "(", "f", ")", ".", "Decode", "(", "&", "value", ")", ";", "err", "!=", "nil", "{", "return", "Value", "{", "ProviderName", ":", "FileCredentialsProviderName", "}", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "ErrFileCredentialsLoadFailed", ".", "Error", "(", ")", ",", "err", ")", "\n", "}", "\n", "if", "token", ":=", "value", ".", "Token", ";", "len", "(", "token", ")", "==", "0", "{", "return", "Value", "{", "ProviderName", ":", "FileCredentialsProviderName", "}", ",", "ErrFileCredentialsTokenNotFound", "\n", "}", "\n\n", "return", "value", ",", "nil", "\n", "}" ]
// 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", "it", "fails", "to", "read", "from", "the", "file", "or", "the", "data", "is", "invalid", "." ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/credentials/provider_file.go#L111-L130
14,613
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) if err != nil { return nil, err } return &ListGroupsOutput{Groups: gs}, nil }
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) if err != nil { return nil, err } return &ListGroupsOutput{Groups: gs}, nil }
[ "func", "(", "s", "*", "ServiceOp", ")", "List", "(", "ctx", "context", ".", "Context", ",", "input", "*", "ListGroupsInput", ")", "(", "*", "ListGroupsOutput", ",", "error", ")", "{", "r", ":=", "client", ".", "NewRequest", "(", "http", ".", "MethodGet", ",", "\"", "\"", ")", "\n", "resp", ",", "err", ":=", "client", ".", "RequireOK", "(", "s", ".", "Client", ".", "Do", "(", "ctx", ",", "r", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "resp", ".", "Body", ".", "Close", "(", ")", "\n\n", "gs", ",", "err", ":=", "groupsFromHttpResponse", "(", "resp", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "ListGroupsOutput", "{", "Groups", ":", "gs", "}", ",", "nil", "\n", "}" ]
// 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
14,614
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,615
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", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,616
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", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,617
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(input.ClusterZoneName)} r.Params["dryRun"] = []string{strconv.FormatBool(spotinst.BoolValue(input.DryRun))} body := &ImportGKEClusterInput{Group: input.Group} r.Obj = body resp, err := client.RequireOK(s.Client.Do(ctx, r)) if err != nil { return nil, err } defer resp.Body.Close() gs, err := groupsFromHttpResponse(resp) if err != nil { return nil, err } output := new(ImportGKEClusterOutput) if len(gs) > 0 { output.Group = gs[0] } return output, nil }
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(input.ClusterZoneName)} r.Params["dryRun"] = []string{strconv.FormatBool(spotinst.BoolValue(input.DryRun))} body := &ImportGKEClusterInput{Group: input.Group} r.Obj = body resp, err := client.RequireOK(s.Client.Do(ctx, r)) if err != nil { return nil, err } defer resp.Body.Close() gs, err := groupsFromHttpResponse(resp) if err != nil { return nil, err } output := new(ImportGKEClusterOutput) if len(gs) > 0 { output.Group = gs[0] } return output, nil }
[ "func", "(", "s", "*", "ServiceOp", ")", "ImportGKECluster", "(", "ctx", "context", ".", "Context", ",", "input", "*", "ImportGKEClusterInput", ")", "(", "*", "ImportGKEClusterOutput", ",", "error", ")", "{", "r", ":=", "client", ".", "NewRequest", "(", "http", ".", "MethodPost", ",", "\"", "\"", ")", "\n\n", "r", ".", "Params", "[", "\"", "\"", "]", "=", "[", "]", "string", "{", "spotinst", ".", "StringValue", "(", "input", ".", "ClusterID", ")", "}", "\n", "r", ".", "Params", "[", "\"", "\"", "]", "=", "[", "]", "string", "{", "spotinst", ".", "StringValue", "(", "input", ".", "ClusterZoneName", ")", "}", "\n", "r", ".", "Params", "[", "\"", "\"", "]", "=", "[", "]", "string", "{", "strconv", ".", "FormatBool", "(", "spotinst", ".", "BoolValue", "(", "input", ".", "DryRun", ")", ")", "}", "\n\n", "body", ":=", "&", "ImportGKEClusterInput", "{", "Group", ":", "input", ".", "Group", "}", "\n", "r", ".", "Obj", "=", "body", "\n\n", "resp", ",", "err", ":=", "client", ".", "RequireOK", "(", "s", ".", "Client", ".", "Do", "(", "ctx", ",", "r", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "resp", ".", "Body", ".", "Close", "(", ")", "\n\n", "gs", ",", "err", ":=", "groupsFromHttpResponse", "(", "resp", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "output", ":=", "new", "(", "ImportGKEClusterOutput", ")", "\n", "if", "len", "(", "gs", ")", ">", "0", "{", "output", ".", "Group", "=", "gs", "[", "0", "]", "\n", "}", "\n\n", "return", "output", ",", "nil", "\n", "}" ]
// 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
14,618
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", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,619
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,620
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,621
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", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,622
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,623
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,624
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,625
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", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,626
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,627
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,628
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,629
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,630
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,631
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,632
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", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,633
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,634
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,635
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,636
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,637
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,638
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", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,639
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "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
14,640
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,641
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,642
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", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,643
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", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,644
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,645
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,646
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", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,647
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", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,648
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,649
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,650
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", ",", "o", ".", "forceSendFields", ",", "o", ".", "nullFields", ")", "\n", "}" ]
// 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
14,651
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", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,652
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,653
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,654
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", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,655
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,656
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,657
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,658
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,659
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,660
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,661
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,662
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,663
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", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,664
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,665
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", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,666
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,667
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,668
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", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// 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
14,669
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
14,670
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", "(", "http", ".", "Header", ")", ",", "Params", ":", "make", "(", "url", ".", "Values", ")", ",", "}", "\n", "}" ]
// 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
14,671
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", ".", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "c", ".", "logRequest", "(", "req", ")", "\n", "resp", ",", "err", ":=", "c", ".", "config", ".", "HTTPClient", ".", "Do", "(", "req", ")", "\n", "c", ".", "logResponse", "(", "resp", ")", "\n", "return", "resp", ",", "err", "\n", "}" ]
// 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
14,672
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("accountId", creds.Account) } // Encode the query parameters. r.url.RawQuery = r.Params.Encode() // Check if we should encode the body. if r.body == nil && r.Obj != nil { if b, err := EncodeBody(r.Obj); err != nil { return nil, err } else { r.body = b } } // Create the HTTP request. req, err := http.NewRequest(r.method, r.url.RequestURI(), r.body) if err != nil { return nil, err } // Set request base URL. req.URL.Host = cfg.BaseURL.Host req.URL.Scheme = cfg.BaseURL.Scheme // Set request headers. req.Host = cfg.BaseURL.Host req.Header = r.header req.Header.Set("Content-Type", cfg.ContentType) req.Header.Add("Accept", cfg.ContentType) req.Header.Add("User-Agent", cfg.UserAgent) return req.WithContext(ctx), nil }
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("accountId", creds.Account) } // Encode the query parameters. r.url.RawQuery = r.Params.Encode() // Check if we should encode the body. if r.body == nil && r.Obj != nil { if b, err := EncodeBody(r.Obj); err != nil { return nil, err } else { r.body = b } } // Create the HTTP request. req, err := http.NewRequest(r.method, r.url.RequestURI(), r.body) if err != nil { return nil, err } // Set request base URL. req.URL.Host = cfg.BaseURL.Host req.URL.Scheme = cfg.BaseURL.Scheme // Set request headers. req.Host = cfg.BaseURL.Host req.Header = r.header req.Header.Set("Content-Type", cfg.ContentType) req.Header.Add("Accept", cfg.ContentType) req.Header.Add("User-Agent", cfg.UserAgent) return req.WithContext(ctx), nil }
[ "func", "(", "r", "*", "Request", ")", "toHTTP", "(", "ctx", "context", ".", "Context", ",", "cfg", "*", "spotinst", ".", "Config", ")", "(", "*", "http", ".", "Request", ",", "error", ")", "{", "// Set the user credentials.", "creds", ",", "err", ":=", "cfg", ".", "Credentials", ".", "Get", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "creds", ".", "Token", "!=", "\"", "\"", "{", "r", ".", "header", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", "+", "creds", ".", "Token", ")", "\n", "}", "\n", "if", "creds", ".", "Account", "!=", "\"", "\"", "{", "r", ".", "Params", ".", "Set", "(", "\"", "\"", ",", "creds", ".", "Account", ")", "\n", "}", "\n\n", "// Encode the query parameters.", "r", ".", "url", ".", "RawQuery", "=", "r", ".", "Params", ".", "Encode", "(", ")", "\n\n", "// Check if we should encode the body.", "if", "r", ".", "body", "==", "nil", "&&", "r", ".", "Obj", "!=", "nil", "{", "if", "b", ",", "err", ":=", "EncodeBody", "(", "r", ".", "Obj", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "else", "{", "r", ".", "body", "=", "b", "\n", "}", "\n", "}", "\n\n", "// Create the HTTP request.", "req", ",", "err", ":=", "http", ".", "NewRequest", "(", "r", ".", "method", ",", "r", ".", "url", ".", "RequestURI", "(", ")", ",", "r", ".", "body", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// Set request base URL.", "req", ".", "URL", ".", "Host", "=", "cfg", ".", "BaseURL", ".", "Host", "\n", "req", ".", "URL", ".", "Scheme", "=", "cfg", ".", "BaseURL", ".", "Scheme", "\n\n", "// Set request headers.", "req", ".", "Host", "=", "cfg", ".", "BaseURL", ".", "Host", "\n", "req", ".", "Header", "=", "r", ".", "header", "\n", "req", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "cfg", ".", "ContentType", ")", "\n", "req", ".", "Header", ".", "Add", "(", "\"", "\"", ",", "cfg", ".", "ContentType", ")", "\n", "req", ".", "Header", ".", "Add", "(", "\"", "\"", ",", "cfg", ".", "UserAgent", ")", "\n\n", "return", "req", ".", "WithContext", "(", "ctx", ")", ",", "nil", "\n", "}" ]
// 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
14,673
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", ":", "defaultContentType", ",", "Credentials", ":", "credentials", ".", "NewChainCredentials", "(", "new", "(", "credentials", ".", "EnvProvider", ")", ",", "new", "(", "credentials", ".", "FileProvider", ")", ",", ")", ",", "}", "\n", "}" ]
// 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", "this", "is", "the", "desired", "behavior", "and", "should", "make", "the", "most", "efficient", "use", "of", "the", "connections", "to", "API", "." ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/config.go#L81-L92
14,674
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
14,675
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
14,676
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
14,677
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
14,678
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 } return Value{}, err }
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 } return Value{}, err }
[ "func", "(", "c", "*", "ChainProvider", ")", "Retrieve", "(", ")", "(", "Value", ",", "error", ")", "{", "var", "errs", "errorList", "\n", "for", "_", ",", "p", ":=", "range", "c", ".", "Providers", "{", "value", ",", "err", ":=", "p", ".", "Retrieve", "(", ")", "\n", "if", "err", "==", "nil", "{", "c", ".", "active", "=", "p", "\n", "return", "value", ",", "nil", "\n", "}", "\n", "errs", "=", "append", "(", "errs", ",", "err", ")", "\n", "}", "\n", "c", ".", "active", "=", "nil", "\n\n", "err", ":=", "ErrNoValidProvidersFoundInChain", "\n", "if", "len", "(", "errs", ")", ">", "0", "{", "err", "=", "errs", "\n", "}", "\n\n", "return", "Value", "{", "}", ",", "err", "\n", "}" ]
// 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
14,679
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 additional '\n'. if i+1 < size { msg += "\n" } } } return msg }
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 additional '\n'. if i+1 < size { msg += "\n" } } } return msg }
[ "func", "(", "e", "errorList", ")", "Error", "(", ")", "string", "{", "msg", ":=", "\"", "\"", "\n", "if", "size", ":=", "len", "(", "e", ")", ";", "size", ">", "0", "{", "for", "i", ":=", "0", ";", "i", "<", "size", ";", "i", "++", "{", "msg", "+=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "e", "[", "i", "]", ".", "Error", "(", ")", ")", "\n", "// 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 additional '\\n'.", "if", "i", "+", "1", "<", "size", "{", "msg", "+=", "\"", "\\n", "\"", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "msg", "\n", "}" ]
// 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
14,680
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", "return", "buf", ".", "String", "(", ")", "\n", "}" ]
// 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
14,681
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 i > 0 { w.Write([]byte{' '}) } stringifyValue(w, v.Index(i)) } w.Write([]byte{']'}) return case reflect.Struct: if v.Type().Name() != "" { w.Write([]byte(v.Type().String())) } w.Write([]byte{'{'}) var sep bool for i := 0; i < v.NumField(); i++ { fv := v.Field(i) if fv.Kind() == reflect.Ptr && fv.IsNil() { continue } if fv.Kind() == reflect.Slice && fv.IsNil() { continue } if sep { w.Write([]byte(", ")) } else { sep = true } w.Write([]byte(v.Type().Field(i).Name)) w.Write([]byte{':'}) stringifyValue(w, fv) } w.Write([]byte{'}'}) default: if v.CanInterface() { fmt.Fprint(w, v.Interface()) } } }
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 i > 0 { w.Write([]byte{' '}) } stringifyValue(w, v.Index(i)) } w.Write([]byte{']'}) return case reflect.Struct: if v.Type().Name() != "" { w.Write([]byte(v.Type().String())) } w.Write([]byte{'{'}) var sep bool for i := 0; i < v.NumField(); i++ { fv := v.Field(i) if fv.Kind() == reflect.Ptr && fv.IsNil() { continue } if fv.Kind() == reflect.Slice && fv.IsNil() { continue } if sep { w.Write([]byte(", ")) } else { sep = true } w.Write([]byte(v.Type().Field(i).Name)) w.Write([]byte{':'}) stringifyValue(w, fv) } w.Write([]byte{'}'}) default: if v.CanInterface() { fmt.Fprint(w, v.Interface()) } } }
[ "func", "stringifyValue", "(", "w", "io", ".", "Writer", ",", "val", "reflect", ".", "Value", ")", "{", "if", "val", ".", "Kind", "(", ")", "==", "reflect", ".", "Ptr", "&&", "val", ".", "IsNil", "(", ")", "{", "w", ".", "Write", "(", "[", "]", "byte", "(", "\"", "\"", ")", ")", "\n", "return", "\n", "}", "\n", "v", ":=", "reflect", ".", "Indirect", "(", "val", ")", "\n", "switch", "v", ".", "Kind", "(", ")", "{", "case", "reflect", ".", "String", ":", "fmt", ".", "Fprintf", "(", "w", ",", "`\"%s\"`", ",", "v", ")", "\n", "case", "reflect", ".", "Slice", ":", "w", ".", "Write", "(", "[", "]", "byte", "{", "'['", "}", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "v", ".", "Len", "(", ")", ";", "i", "++", "{", "if", "i", ">", "0", "{", "w", ".", "Write", "(", "[", "]", "byte", "{", "' '", "}", ")", "\n", "}", "\n", "stringifyValue", "(", "w", ",", "v", ".", "Index", "(", "i", ")", ")", "\n", "}", "\n", "w", ".", "Write", "(", "[", "]", "byte", "{", "']'", "}", ")", "\n", "return", "\n", "case", "reflect", ".", "Struct", ":", "if", "v", ".", "Type", "(", ")", ".", "Name", "(", ")", "!=", "\"", "\"", "{", "w", ".", "Write", "(", "[", "]", "byte", "(", "v", ".", "Type", "(", ")", ".", "String", "(", ")", ")", ")", "\n", "}", "\n", "w", ".", "Write", "(", "[", "]", "byte", "{", "'{'", "}", ")", "\n", "var", "sep", "bool", "\n", "for", "i", ":=", "0", ";", "i", "<", "v", ".", "NumField", "(", ")", ";", "i", "++", "{", "fv", ":=", "v", ".", "Field", "(", "i", ")", "\n", "if", "fv", ".", "Kind", "(", ")", "==", "reflect", ".", "Ptr", "&&", "fv", ".", "IsNil", "(", ")", "{", "continue", "\n", "}", "\n", "if", "fv", ".", "Kind", "(", ")", "==", "reflect", ".", "Slice", "&&", "fv", ".", "IsNil", "(", ")", "{", "continue", "\n", "}", "\n", "if", "sep", "{", "w", ".", "Write", "(", "[", "]", "byte", "(", "\"", "\"", ")", ")", "\n", "}", "else", "{", "sep", "=", "true", "\n", "}", "\n", "w", ".", "Write", "(", "[", "]", "byte", "(", "v", ".", "Type", "(", ")", ".", "Field", "(", "i", ")", ".", "Name", ")", ")", "\n", "w", ".", "Write", "(", "[", "]", "byte", "{", "':'", "}", ")", "\n", "stringifyValue", "(", "w", ",", "fv", ")", "\n", "}", "\n", "w", ".", "Write", "(", "[", "]", "byte", "{", "'}'", "}", ")", "\n", "default", ":", "if", "v", ".", "CanInterface", "(", ")", "{", "fmt", ".", "Fprint", "(", "w", ",", "v", ".", "Interface", "(", ")", ")", "\n", "}", "\n", "}", "\n", "}" ]
// 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
14,682
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
14,683
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", "(", ")", "\n", "}", "\n\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "v", ".", "Interface", "(", ")", ")", "\n", "}" ]
// 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
14,684
spotinst/spotinst-sdk-go
spotinst/util/jsonutil/json.go
includeField
func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]struct{}) bool { // The regular JSON encoding of a nil pointer is "null", which means "delete this field". // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set. // However, many fields are not pointers, so there would be no way to delete these fields. // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields. // Deletion will be handled by a separate mechanism. if f.Type.Kind() == reflect.Ptr && v.IsNil() { return false } // The "any" type is represented as an interface{}. If this interface // is nil, there is no reasonable representation to send. We ignore // these fields, for the same reasons as given above for pointers. if f.Type.Kind() == reflect.Interface && v.IsNil() { return false } _, ok := mustInclude[f.Name] return ok || !isEmptyValue(v) }
go
func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]struct{}) bool { // The regular JSON encoding of a nil pointer is "null", which means "delete this field". // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set. // However, many fields are not pointers, so there would be no way to delete these fields. // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields. // Deletion will be handled by a separate mechanism. if f.Type.Kind() == reflect.Ptr && v.IsNil() { return false } // The "any" type is represented as an interface{}. If this interface // is nil, there is no reasonable representation to send. We ignore // these fields, for the same reasons as given above for pointers. if f.Type.Kind() == reflect.Interface && v.IsNil() { return false } _, ok := mustInclude[f.Name] return ok || !isEmptyValue(v) }
[ "func", "includeField", "(", "v", "reflect", ".", "Value", ",", "f", "reflect", ".", "StructField", ",", "mustInclude", "map", "[", "string", "]", "struct", "{", "}", ")", "bool", "{", "// The regular JSON encoding of a nil pointer is \"null\", which means \"delete this field\".", "// Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set.", "// However, many fields are not pointers, so there would be no way to delete these fields.", "// Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields.", "// Deletion will be handled by a separate mechanism.", "if", "f", ".", "Type", ".", "Kind", "(", ")", "==", "reflect", ".", "Ptr", "&&", "v", ".", "IsNil", "(", ")", "{", "return", "false", "\n", "}", "\n\n", "// The \"any\" type is represented as an interface{}. If this interface", "// is nil, there is no reasonable representation to send. We ignore", "// these fields, for the same reasons as given above for pointers.", "if", "f", ".", "Type", ".", "Kind", "(", ")", "==", "reflect", ".", "Interface", "&&", "v", ".", "IsNil", "(", ")", "{", "return", "false", "\n", "}", "\n\n", "_", ",", "ok", ":=", "mustInclude", "[", "f", ".", "Name", "]", "\n", "return", "ok", "||", "!", "isEmptyValue", "(", "v", ")", "\n", "}" ]
// Reports whether the struct field "f" with value "v" should be included in JSON output.
[ "Reports", "whether", "the", "struct", "field", "f", "with", "value", "v", "should", "be", "included", "in", "JSON", "output", "." ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/util/jsonutil/json.go#L142-L161
14,685
spotinst/spotinst-sdk-go
spotinst/session/session.go
New
func New(cfgs ...*spotinst.Config) *Session { s := &Session{Config: spotinst.DefaultConfig()} s.Config.Merge(cfgs...) return s }
go
func New(cfgs ...*spotinst.Config) *Session { s := &Session{Config: spotinst.DefaultConfig()} s.Config.Merge(cfgs...) return s }
[ "func", "New", "(", "cfgs", "...", "*", "spotinst", ".", "Config", ")", "*", "Session", "{", "s", ":=", "&", "Session", "{", "Config", ":", "spotinst", ".", "DefaultConfig", "(", ")", "}", "\n", "s", ".", "Config", ".", "Merge", "(", "cfgs", "...", ")", "\n", "return", "s", "\n", "}" ]
// New creates a new instance of Session. Once the Session is created it // can be mutated to modify the Config. The Session is safe to be read // concurrently, but it should not be written to concurrently.
[ "New", "creates", "a", "new", "instance", "of", "Session", ".", "Once", "the", "Session", "is", "created", "it", "can", "be", "mutated", "to", "modify", "the", "Config", ".", "The", "Session", "is", "safe", "to", "be", "read", "concurrently", "but", "it", "should", "not", "be", "written", "to", "concurrently", "." ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/spotinst/session/session.go#L18-L22
14,686
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetCluster
func (o *Scaler) SetCluster(v *Cluster) *Scaler { if o.Cluster = v; o.Cluster == nil { o.nullFields = append(o.nullFields, "Cluster") } return o }
go
func (o *Scaler) SetCluster(v *Cluster) *Scaler { if o.Cluster = v; o.Cluster == nil { o.nullFields = append(o.nullFields, "Cluster") } return o }
[ "func", "(", "o", "*", "Scaler", ")", "SetCluster", "(", "v", "*", "Cluster", ")", "*", "Scaler", "{", "if", "o", ".", "Cluster", "=", "v", ";", "o", ".", "Cluster", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetCluster sets the Cluster object used when creating a new Scaler
[ "SetCluster", "sets", "the", "Cluster", "object", "used", "when", "creating", "a", "new", "Scaler" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L503-L508
14,687
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetLogURI
func (o *Cluster) SetLogURI(v *string) *Cluster { if o.LogURI = v; o.LogURI == nil { o.nullFields = append(o.nullFields, "LogURI") } return o }
go
func (o *Cluster) SetLogURI(v *string) *Cluster { if o.LogURI = v; o.LogURI == nil { o.nullFields = append(o.nullFields, "LogURI") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetLogURI", "(", "v", "*", "string", ")", "*", "Cluster", "{", "if", "o", ".", "LogURI", "=", "v", ";", "o", ".", "LogURI", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetLogURI sets the log uri when creating a new cluster
[ "SetLogURI", "sets", "the", "log", "uri", "when", "creating", "a", "new", "cluster" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L535-L540
14,688
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetAdditionalInfo
func (o *Cluster) SetAdditionalInfo(v *string) *Cluster { if o.AdditionalInfo = v; o.AdditionalInfo == nil { o.nullFields = append(o.nullFields, "AdditionalInfo") } return o }
go
func (o *Cluster) SetAdditionalInfo(v *string) *Cluster { if o.AdditionalInfo = v; o.AdditionalInfo == nil { o.nullFields = append(o.nullFields, "AdditionalInfo") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetAdditionalInfo", "(", "v", "*", "string", ")", "*", "Cluster", "{", "if", "o", ".", "AdditionalInfo", "=", "v", ";", "o", ".", "AdditionalInfo", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetAdditionalInfo sets the additional info field used by third party integrations when creating a new mrscaler
[ "SetAdditionalInfo", "sets", "the", "additional", "info", "field", "used", "by", "third", "party", "integrations", "when", "creating", "a", "new", "mrscaler" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L543-L548
14,689
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetJobFlowRole
func (o *Cluster) SetJobFlowRole(v *string) *Cluster { if o.JobFlowRole = v; o.JobFlowRole == nil { o.nullFields = append(o.nullFields, "JobFlowRole") } return o }
go
func (o *Cluster) SetJobFlowRole(v *string) *Cluster { if o.JobFlowRole = v; o.JobFlowRole == nil { o.nullFields = append(o.nullFields, "JobFlowRole") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetJobFlowRole", "(", "v", "*", "string", ")", "*", "Cluster", "{", "if", "o", ".", "JobFlowRole", "=", "v", ";", "o", ".", "JobFlowRole", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetJobFlowRole sets the IAM role that will be adopted by the launched EC2 instances
[ "SetJobFlowRole", "sets", "the", "IAM", "role", "that", "will", "be", "adopted", "by", "the", "launched", "EC2", "instances" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L551-L556
14,690
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetSecurityConfiguration
func (o *Cluster) SetSecurityConfiguration(v *string) *Cluster { if o.SecurityConfiguration = v; o.SecurityConfiguration == nil { o.nullFields = append(o.nullFields, "SecurityConfiguration") } return o }
go
func (o *Cluster) SetSecurityConfiguration(v *string) *Cluster { if o.SecurityConfiguration = v; o.SecurityConfiguration == nil { o.nullFields = append(o.nullFields, "SecurityConfiguration") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetSecurityConfiguration", "(", "v", "*", "string", ")", "*", "Cluster", "{", "if", "o", ".", "SecurityConfiguration", "=", "v", ";", "o", ".", "SecurityConfiguration", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetSecurityConfiguration sets the name of the security configuration to be applied to the cluster
[ "SetSecurityConfiguration", "sets", "the", "name", "of", "the", "security", "configuration", "to", "be", "applied", "to", "the", "cluster" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L559-L564
14,691
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetServiceRole
func (o *Cluster) SetServiceRole(v *string) *Cluster { if o.ServiceRole = v; o.ServiceRole == nil { o.nullFields = append(o.nullFields, "ServiceRole") } return o }
go
func (o *Cluster) SetServiceRole(v *string) *Cluster { if o.ServiceRole = v; o.ServiceRole == nil { o.nullFields = append(o.nullFields, "ServiceRole") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetServiceRole", "(", "v", "*", "string", ")", "*", "Cluster", "{", "if", "o", ".", "ServiceRole", "=", "v", ";", "o", ".", "ServiceRole", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetServiceRole sets the IAM role that the EMR will assume to access AWS resources on your behalf
[ "SetServiceRole", "sets", "the", "IAM", "role", "that", "the", "EMR", "will", "assume", "to", "access", "AWS", "resources", "on", "your", "behalf" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L567-L572
14,692
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetVisibleToAllUsers
func (o *Cluster) SetVisibleToAllUsers(v *bool) *Cluster { if o.VisibleToAllUsers = v; o.VisibleToAllUsers == nil { o.nullFields = append(o.nullFields, "VisibleToAllUsers") } return o }
go
func (o *Cluster) SetVisibleToAllUsers(v *bool) *Cluster { if o.VisibleToAllUsers = v; o.VisibleToAllUsers == nil { o.nullFields = append(o.nullFields, "VisibleToAllUsers") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetVisibleToAllUsers", "(", "v", "*", "bool", ")", "*", "Cluster", "{", "if", "o", ".", "VisibleToAllUsers", "=", "v", ";", "o", ".", "VisibleToAllUsers", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetVisibleToAllUsers sets a flag indicating if the cluster is visibile to all IAM users
[ "SetVisibleToAllUsers", "sets", "a", "flag", "indicating", "if", "the", "cluster", "is", "visibile", "to", "all", "IAM", "users" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L575-L580
14,693
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetTerminationProtected
func (o *Cluster) SetTerminationProtected(v *bool) *Cluster { if o.TerminationProtected = v; o.TerminationProtected == nil { o.nullFields = append(o.nullFields, "TerminationProtected") } return o }
go
func (o *Cluster) SetTerminationProtected(v *bool) *Cluster { if o.TerminationProtected = v; o.TerminationProtected == nil { o.nullFields = append(o.nullFields, "TerminationProtected") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetTerminationProtected", "(", "v", "*", "bool", ")", "*", "Cluster", "{", "if", "o", ".", "TerminationProtected", "=", "v", ";", "o", ".", "TerminationProtected", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetTerminationProtected sets whether the EC2 instances in the cluster are protected from terminating API calls
[ "SetTerminationProtected", "sets", "whether", "the", "EC2", "instances", "in", "the", "cluster", "are", "protected", "from", "terminating", "API", "calls" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L583-L588
14,694
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetKeepJobFlowAliveWhenNoSteps
func (o *Cluster) SetKeepJobFlowAliveWhenNoSteps(v *bool) *Cluster { if o.KeepJobFlowAliveWhenNoSteps = v; o.KeepJobFlowAliveWhenNoSteps == nil { o.nullFields = append(o.nullFields, "KeepJobFlowAliveWhenNoSteps") } return o }
go
func (o *Cluster) SetKeepJobFlowAliveWhenNoSteps(v *bool) *Cluster { if o.KeepJobFlowAliveWhenNoSteps = v; o.KeepJobFlowAliveWhenNoSteps == nil { o.nullFields = append(o.nullFields, "KeepJobFlowAliveWhenNoSteps") } return o }
[ "func", "(", "o", "*", "Cluster", ")", "SetKeepJobFlowAliveWhenNoSteps", "(", "v", "*", "bool", ")", "*", "Cluster", "{", "if", "o", ".", "KeepJobFlowAliveWhenNoSteps", "=", "v", ";", "o", ".", "KeepJobFlowAliveWhenNoSteps", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetKeepJobFlowAliveWhenNoSteps sets KeepJobFlowAliveWhenNoSteps
[ "SetKeepJobFlowAliveWhenNoSteps", "sets", "KeepJobFlowAliveWhenNoSteps" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L591-L596
14,695
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetInstanceGroupType
func (o *Task) SetInstanceGroupType(v *string) *Task { if o.InstanceGroupType = v; o.InstanceGroupType == nil { o.nullFields = append(o.nullFields, "InstanceGroupType") } return o }
go
func (o *Task) SetInstanceGroupType(v *string) *Task { if o.InstanceGroupType = v; o.InstanceGroupType == nil { o.nullFields = append(o.nullFields, "InstanceGroupType") } return o }
[ "func", "(", "o", "*", "Task", ")", "SetInstanceGroupType", "(", "v", "*", "string", ")", "*", "Task", "{", "if", "o", ".", "InstanceGroupType", "=", "v", ";", "o", ".", "InstanceGroupType", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetInstanceGroupType sets the instance group to apply the scheduled task to.
[ "SetInstanceGroupType", "sets", "the", "instance", "group", "to", "apply", "the", "scheduled", "task", "to", "." ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L640-L645
14,696
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetCreateNew
func (o *Strategy) SetCreateNew(v *CreateNew) *Strategy { if o.CreateNew = v; o.CreateNew == nil { o.nullFields = append(o.nullFields, "CreateNew") } return o }
go
func (o *Strategy) SetCreateNew(v *CreateNew) *Strategy { if o.CreateNew = v; o.CreateNew == nil { o.nullFields = append(o.nullFields, "CreateNew") } return o }
[ "func", "(", "o", "*", "Strategy", ")", "SetCreateNew", "(", "v", "*", "CreateNew", ")", "*", "Strategy", "{", "if", "o", ".", "CreateNew", "=", "v", ";", "o", ".", "CreateNew", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetCreateNew sets a new mrscaler object
[ "SetCreateNew", "sets", "a", "new", "mrscaler", "object" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L700-L705
14,697
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetProvisioningTimeout
func (o *Strategy) SetProvisioningTimeout(v *ProvisioningTimeout) *Strategy { if o.ProvisioningTimeout = v; o.ProvisioningTimeout == nil { o.nullFields = append(o.nullFields, "ProvisioningTimeout") } return o }
go
func (o *Strategy) SetProvisioningTimeout(v *ProvisioningTimeout) *Strategy { if o.ProvisioningTimeout = v; o.ProvisioningTimeout == nil { o.nullFields = append(o.nullFields, "ProvisioningTimeout") } return o }
[ "func", "(", "o", "*", "Strategy", ")", "SetProvisioningTimeout", "(", "v", "*", "ProvisioningTimeout", ")", "*", "Strategy", "{", "if", "o", ".", "ProvisioningTimeout", "=", "v", ";", "o", ".", "ProvisioningTimeout", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetProvisioningTimeout sets the timeout when creating or cloning a scaler
[ "SetProvisioningTimeout", "sets", "the", "timeout", "when", "creating", "or", "cloning", "a", "scaler" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L708-L713
14,698
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetReleaseLabel
func (o *CreateNew) SetReleaseLabel(v *string) *CreateNew { if o.ReleaseLabel = v; o.ReleaseLabel == nil { o.nullFields = append(o.nullFields, "ReleaseLabel") } return o }
go
func (o *CreateNew) SetReleaseLabel(v *string) *CreateNew { if o.ReleaseLabel = v; o.ReleaseLabel == nil { o.nullFields = append(o.nullFields, "ReleaseLabel") } return o }
[ "func", "(", "o", "*", "CreateNew", ")", "SetReleaseLabel", "(", "v", "*", "string", ")", "*", "CreateNew", "{", "if", "o", ".", "ReleaseLabel", "=", "v", ";", "o", ".", "ReleaseLabel", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetReleaseLabel sets the release label for a new scaler
[ "SetReleaseLabel", "sets", "the", "release", "label", "for", "a", "new", "scaler" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L768-L773
14,699
spotinst/spotinst-sdk-go
service/mrscaler/mrscaler.go
SetRetries
func (o *CreateNew) SetRetries(v *int) *CreateNew { if o.Retries = v; o.Retries == nil { o.nullFields = append(o.nullFields, "Retries") } return o }
go
func (o *CreateNew) SetRetries(v *int) *CreateNew { if o.Retries = v; o.Retries == nil { o.nullFields = append(o.nullFields, "Retries") } return o }
[ "func", "(", "o", "*", "CreateNew", ")", "SetRetries", "(", "v", "*", "int", ")", "*", "CreateNew", "{", "if", "o", ".", "Retries", "=", "v", ";", "o", ".", "Retries", "==", "nil", "{", "o", ".", "nullFields", "=", "append", "(", "o", ".", "nullFields", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "o", "\n", "}" ]
// SetRetries sets the number of retries to attempt when creating a new scaler
[ "SetRetries", "sets", "the", "number", "of", "retries", "to", "attempt", "when", "creating", "a", "new", "scaler" ]
8cd52da677ef8425428ef610f0243863759639c8
https://github.com/spotinst/spotinst-sdk-go/blob/8cd52da677ef8425428ef610f0243863759639c8/service/mrscaler/mrscaler.go#L776-L781