repo
stringlengths
5
67
path
stringlengths
4
218
func_name
stringlengths
0
151
original_string
stringlengths
52
373k
language
stringclasses
6 values
code
stringlengths
52
373k
code_tokens
listlengths
10
512
docstring
stringlengths
3
47.2k
docstring_tokens
listlengths
3
234
sha
stringlengths
40
40
url
stringlengths
85
339
partition
stringclasses
3 values
Diggs/go-backoff
backoff.go
NewBackoff
func NewBackoff(strategy BackoffStrategy, start time.Duration, limit time.Duration) *Backoff { backoff := Backoff{strategy: strategy, start: start, limit: limit} backoff.Reset() return &backoff }
go
func NewBackoff(strategy BackoffStrategy, start time.Duration, limit time.Duration) *Backoff { backoff := Backoff{strategy: strategy, start: start, limit: limit} backoff.Reset() return &backoff }
[ "func", "NewBackoff", "(", "strategy", "BackoffStrategy", ",", "start", "time", ".", "Duration", ",", "limit", "time", ".", "Duration", ")", "*", "Backoff", "{", "backoff", ":=", "Backoff", "{", "strategy", ":", "strategy", ",", "start", ":", "start", ",", "limit", ":", "limit", "}", "\n", "backoff", ".", "Reset", "(", ")", "\n", "return", "&", "backoff", "\n", "}" ]
// NewBackoff creates a new Backoff using the specified BackoffStrategy, start duration and limit.
[ "NewBackoff", "creates", "a", "new", "Backoff", "using", "the", "specified", "BackoffStrategy", "start", "duration", "and", "limit", "." ]
f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a
https://github.com/Diggs/go-backoff/blob/f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a/backoff.go#L30-L34
test
Diggs/go-backoff
backoff.go
Reset
func (b *Backoff) Reset() { b.count = 0 b.LastDuration = 0 b.NextDuration = b.getNextDuration() }
go
func (b *Backoff) Reset() { b.count = 0 b.LastDuration = 0 b.NextDuration = b.getNextDuration() }
[ "func", "(", "b", "*", "Backoff", ")", "Reset", "(", ")", "{", "b", ".", "count", "=", "0", "\n", "b", ".", "LastDuration", "=", "0", "\n", "b", ".", "NextDuration", "=", "b", ".", "getNextDuration", "(", ")", "\n", "}" ]
// Reset sets the Backoff to its initial conditions ready to start over.
[ "Reset", "sets", "the", "Backoff", "to", "its", "initial", "conditions", "ready", "to", "start", "over", "." ]
f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a
https://github.com/Diggs/go-backoff/blob/f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a/backoff.go#L37-L41
test
Diggs/go-backoff
backoff.go
NewExponential
func NewExponential(start time.Duration, limit time.Duration) *Backoff { return NewBackoff(exponential{}, start, limit) }
go
func NewExponential(start time.Duration, limit time.Duration) *Backoff { return NewBackoff(exponential{}, start, limit) }
[ "func", "NewExponential", "(", "start", "time", ".", "Duration", ",", "limit", "time", ".", "Duration", ")", "*", "Backoff", "{", "return", "NewBackoff", "(", "exponential", "{", "}", ",", "start", ",", "limit", ")", "\n", "}" ]
// NewExponential creates a new backoff using the exponential backoff algorithm.
[ "NewExponential", "creates", "a", "new", "backoff", "using", "the", "exponential", "backoff", "algorithm", "." ]
f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a
https://github.com/Diggs/go-backoff/blob/f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a/backoff.go#L67-L69
test
Diggs/go-backoff
backoff.go
NewExponentialFullJitter
func NewExponentialFullJitter(start time.Duration, limit time.Duration) *Backoff { return NewBackoff(exponentialFullJitter{limit: limit}, start, limit) }
go
func NewExponentialFullJitter(start time.Duration, limit time.Duration) *Backoff { return NewBackoff(exponentialFullJitter{limit: limit}, start, limit) }
[ "func", "NewExponentialFullJitter", "(", "start", "time", ".", "Duration", ",", "limit", "time", ".", "Duration", ")", "*", "Backoff", "{", "return", "NewBackoff", "(", "exponentialFullJitter", "{", "limit", ":", "limit", "}", ",", "start", ",", "limit", ")", "\n", "}" ]
// NewExponentialFullJitter creates a new backoff using the exponential with full jitter backoff algorithm.
[ "NewExponentialFullJitter", "creates", "a", "new", "backoff", "using", "the", "exponential", "with", "full", "jitter", "backoff", "algorithm", "." ]
f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a
https://github.com/Diggs/go-backoff/blob/f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a/backoff.go#L89-L91
test
Diggs/go-backoff
backoff.go
NewLinear
func NewLinear(start time.Duration, limit time.Duration) *Backoff { return NewBackoff(linear{}, start, limit) }
go
func NewLinear(start time.Duration, limit time.Duration) *Backoff { return NewBackoff(linear{}, start, limit) }
[ "func", "NewLinear", "(", "start", "time", ".", "Duration", ",", "limit", "time", ".", "Duration", ")", "*", "Backoff", "{", "return", "NewBackoff", "(", "linear", "{", "}", ",", "start", ",", "limit", ")", "\n", "}" ]
// NewLinear creates a new backoff using the linear backoff algorithm.
[ "NewLinear", "creates", "a", "new", "backoff", "using", "the", "linear", "backoff", "algorithm", "." ]
f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a
https://github.com/Diggs/go-backoff/blob/f7b9f7e6b83be485b2e1b3eebba36652c6c4cd8a/backoff.go#L100-L102
test
moul/sapin
sapin.go
GetLineSize
func (s *Sapin) GetLineSize(floor, line int) int { return 1 + line*2 + floor*4 + int(floor/2*2)*int((floor+1)/2) }
go
func (s *Sapin) GetLineSize(floor, line int) int { return 1 + line*2 + floor*4 + int(floor/2*2)*int((floor+1)/2) }
[ "func", "(", "s", "*", "Sapin", ")", "GetLineSize", "(", "floor", ",", "line", "int", ")", "int", "{", "return", "1", "+", "line", "*", "2", "+", "floor", "*", "4", "+", "int", "(", "floor", "/", "2", "*", "2", ")", "*", "int", "(", "(", "floor", "+", "1", ")", "/", "2", ")", "\n", "}" ]
// GetLineSize returns the size of the sapin for a specified floor and line.
[ "GetLineSize", "returns", "the", "size", "of", "the", "sapin", "for", "a", "specified", "floor", "and", "line", "." ]
03dc419f50a637fd6fd353ffa8f4c93b4f3a80a6
https://github.com/moul/sapin/blob/03dc419f50a637fd6fd353ffa8f4c93b4f3a80a6/sapin.go#L30-L32
test
moul/sapin
sapin.go
GetMaxSize
func (s *Sapin) GetMaxSize() int { return s.GetLineSize(s.Size-1, s.Size+3) }
go
func (s *Sapin) GetMaxSize() int { return s.GetLineSize(s.Size-1, s.Size+3) }
[ "func", "(", "s", "*", "Sapin", ")", "GetMaxSize", "(", ")", "int", "{", "return", "s", ".", "GetLineSize", "(", "s", ".", "Size", "-", "1", ",", "s", ".", "Size", "+", "3", ")", "\n", "}" ]
// GetMaxSize returns the size of the widest part of the sapin.
[ "GetMaxSize", "returns", "the", "size", "of", "the", "widest", "part", "of", "the", "sapin", "." ]
03dc419f50a637fd6fd353ffa8f4c93b4f3a80a6
https://github.com/moul/sapin/blob/03dc419f50a637fd6fd353ffa8f4c93b4f3a80a6/sapin.go#L35-L37
test
moul/sapin
sapin.go
compute
func (s *Sapin) compute() { if s.output != "" { return } // size of the last line of the last floor maxSize := s.GetMaxSize() // each floor in the floors for floor := 0; floor < s.Size; floor++ { // each line in the lines of the floor for line := 0; line < floor+4; line++ { // size of the current line lineSize := s.GetLineSize(floor, line) // pad left with spaces for i := (maxSize-lineSize)/2 - 1; i > 0; i-- { s.putchar(" ") } // draw the body for i := 0; i < lineSize; i++ { s.putchar("*") } // new line s.putchar("\n") } } // the trunc for i := 0; i < s.Size; i++ { lineSize := s.Size + (s.Size+1)%2 // pad left with spaces for i := (maxSize-lineSize)/2 - 1; i > 0; i-- { s.putchar(" ") } // draw the body for i := 0; i < lineSize; i++ { s.putchar("|") } // new line s.putchar("\n") } }
go
func (s *Sapin) compute() { if s.output != "" { return } // size of the last line of the last floor maxSize := s.GetMaxSize() // each floor in the floors for floor := 0; floor < s.Size; floor++ { // each line in the lines of the floor for line := 0; line < floor+4; line++ { // size of the current line lineSize := s.GetLineSize(floor, line) // pad left with spaces for i := (maxSize-lineSize)/2 - 1; i > 0; i-- { s.putchar(" ") } // draw the body for i := 0; i < lineSize; i++ { s.putchar("*") } // new line s.putchar("\n") } } // the trunc for i := 0; i < s.Size; i++ { lineSize := s.Size + (s.Size+1)%2 // pad left with spaces for i := (maxSize-lineSize)/2 - 1; i > 0; i-- { s.putchar(" ") } // draw the body for i := 0; i < lineSize; i++ { s.putchar("|") } // new line s.putchar("\n") } }
[ "func", "(", "s", "*", "Sapin", ")", "compute", "(", ")", "{", "if", "s", ".", "output", "!=", "\"\"", "{", "return", "\n", "}", "\n", "maxSize", ":=", "s", ".", "GetMaxSize", "(", ")", "\n", "for", "floor", ":=", "0", ";", "floor", "<", "s", ".", "Size", ";", "floor", "++", "{", "for", "line", ":=", "0", ";", "line", "<", "floor", "+", "4", ";", "line", "++", "{", "lineSize", ":=", "s", ".", "GetLineSize", "(", "floor", ",", "line", ")", "\n", "for", "i", ":=", "(", "maxSize", "-", "lineSize", ")", "/", "2", "-", "1", ";", "i", ">", "0", ";", "i", "--", "{", "s", ".", "putchar", "(", "\" \"", ")", "\n", "}", "\n", "for", "i", ":=", "0", ";", "i", "<", "lineSize", ";", "i", "++", "{", "s", ".", "putchar", "(", "\"*\"", ")", "\n", "}", "\n", "s", ".", "putchar", "(", "\"\\n\"", ")", "\n", "}", "\n", "}", "\n", "\\n", "\n", "}" ]
// compute iterates over floors and lines to generate the output of the sapin.
[ "compute", "iterates", "over", "floors", "and", "lines", "to", "generate", "the", "output", "of", "the", "sapin", "." ]
03dc419f50a637fd6fd353ffa8f4c93b4f3a80a6
https://github.com/moul/sapin/blob/03dc419f50a637fd6fd353ffa8f4c93b4f3a80a6/sapin.go#L51-L99
test
iron-io/functions_go
client/apps/post_apps_parameters.go
WithTimeout
func (o *PostAppsParams) WithTimeout(timeout time.Duration) *PostAppsParams { o.SetTimeout(timeout) return o }
go
func (o *PostAppsParams) WithTimeout(timeout time.Duration) *PostAppsParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "PostAppsParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "PostAppsParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the post apps params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "post", "apps", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/post_apps_parameters.go#L79-L82
test
iron-io/functions_go
client/apps/post_apps_parameters.go
WithContext
func (o *PostAppsParams) WithContext(ctx context.Context) *PostAppsParams { o.SetContext(ctx) return o }
go
func (o *PostAppsParams) WithContext(ctx context.Context) *PostAppsParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "PostAppsParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "PostAppsParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the post apps params
[ "WithContext", "adds", "the", "context", "to", "the", "post", "apps", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/post_apps_parameters.go#L90-L93
test
iron-io/functions_go
client/apps/post_apps_parameters.go
WithHTTPClient
func (o *PostAppsParams) WithHTTPClient(client *http.Client) *PostAppsParams { o.SetHTTPClient(client) return o }
go
func (o *PostAppsParams) WithHTTPClient(client *http.Client) *PostAppsParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "PostAppsParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "PostAppsParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the post apps params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "post", "apps", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/post_apps_parameters.go#L101-L104
test
iron-io/functions_go
client/apps/post_apps_parameters.go
WithBody
func (o *PostAppsParams) WithBody(body *models.AppWrapper) *PostAppsParams { o.SetBody(body) return o }
go
func (o *PostAppsParams) WithBody(body *models.AppWrapper) *PostAppsParams { o.SetBody(body) return o }
[ "func", "(", "o", "*", "PostAppsParams", ")", "WithBody", "(", "body", "*", "models", ".", "AppWrapper", ")", "*", "PostAppsParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
// WithBody adds the body to the post apps params
[ "WithBody", "adds", "the", "body", "to", "the", "post", "apps", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/post_apps_parameters.go#L112-L115
test
iron-io/functions_go
client/apps/get_apps_app_parameters.go
WithTimeout
func (o *GetAppsAppParams) WithTimeout(timeout time.Duration) *GetAppsAppParams { o.SetTimeout(timeout) return o }
go
func (o *GetAppsAppParams) WithTimeout(timeout time.Duration) *GetAppsAppParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "GetAppsAppParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetAppsAppParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the get apps app params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "get", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/get_apps_app_parameters.go#L77-L80
test
iron-io/functions_go
client/apps/get_apps_app_parameters.go
WithContext
func (o *GetAppsAppParams) WithContext(ctx context.Context) *GetAppsAppParams { o.SetContext(ctx) return o }
go
func (o *GetAppsAppParams) WithContext(ctx context.Context) *GetAppsAppParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "GetAppsAppParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetAppsAppParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the get apps app params
[ "WithContext", "adds", "the", "context", "to", "the", "get", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/get_apps_app_parameters.go#L88-L91
test
iron-io/functions_go
client/apps/get_apps_app_parameters.go
WithHTTPClient
func (o *GetAppsAppParams) WithHTTPClient(client *http.Client) *GetAppsAppParams { o.SetHTTPClient(client) return o }
go
func (o *GetAppsAppParams) WithHTTPClient(client *http.Client) *GetAppsAppParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "GetAppsAppParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetAppsAppParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the get apps app params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/get_apps_app_parameters.go#L99-L102
test
iron-io/functions_go
client/apps/get_apps_app_parameters.go
WithApp
func (o *GetAppsAppParams) WithApp(app string) *GetAppsAppParams { o.SetApp(app) return o }
go
func (o *GetAppsAppParams) WithApp(app string) *GetAppsAppParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "GetAppsAppParams", ")", "WithApp", "(", "app", "string", ")", "*", "GetAppsAppParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the get apps app params
[ "WithApp", "adds", "the", "app", "to", "the", "get", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/get_apps_app_parameters.go#L110-L113
test
iron-io/functions_go
models/route_wrapper.go
UnmarshalBinary
func (m *RouteWrapper) UnmarshalBinary(b []byte) error { var res RouteWrapper if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }
go
func (m *RouteWrapper) UnmarshalBinary(b []byte) error { var res RouteWrapper if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }
[ "func", "(", "m", "*", "RouteWrapper", ")", "UnmarshalBinary", "(", "b", "[", "]", "byte", ")", "error", "{", "var", "res", "RouteWrapper", "\n", "if", "err", ":=", "swag", ".", "ReadJSON", "(", "b", ",", "&", "res", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "*", "m", "=", "res", "\n", "return", "nil", "\n", "}" ]
// UnmarshalBinary interface implementation
[ "UnmarshalBinary", "interface", "implementation" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/models/route_wrapper.go#L105-L112
test
iron-io/functions_go
client/apps/get_apps_parameters.go
WithTimeout
func (o *GetAppsParams) WithTimeout(timeout time.Duration) *GetAppsParams { o.SetTimeout(timeout) return o }
go
func (o *GetAppsParams) WithTimeout(timeout time.Duration) *GetAppsParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "GetAppsParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetAppsParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the get apps params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "get", "apps", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/get_apps_parameters.go#L70-L73
test
iron-io/functions_go
client/apps/get_apps_parameters.go
WithContext
func (o *GetAppsParams) WithContext(ctx context.Context) *GetAppsParams { o.SetContext(ctx) return o }
go
func (o *GetAppsParams) WithContext(ctx context.Context) *GetAppsParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "GetAppsParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetAppsParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the get apps params
[ "WithContext", "adds", "the", "context", "to", "the", "get", "apps", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/get_apps_parameters.go#L81-L84
test
iron-io/functions_go
client/apps/get_apps_parameters.go
WithHTTPClient
func (o *GetAppsParams) WithHTTPClient(client *http.Client) *GetAppsParams { o.SetHTTPClient(client) return o }
go
func (o *GetAppsParams) WithHTTPClient(client *http.Client) *GetAppsParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "GetAppsParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetAppsParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the get apps params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "apps", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/get_apps_parameters.go#L92-L95
test
iron-io/functions_go
client/apps/delete_apps_app_parameters.go
WithTimeout
func (o *DeleteAppsAppParams) WithTimeout(timeout time.Duration) *DeleteAppsAppParams { o.SetTimeout(timeout) return o }
go
func (o *DeleteAppsAppParams) WithTimeout(timeout time.Duration) *DeleteAppsAppParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "DeleteAppsAppParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "DeleteAppsAppParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the delete apps app params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "delete", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/delete_apps_app_parameters.go#L77-L80
test
iron-io/functions_go
client/apps/delete_apps_app_parameters.go
WithContext
func (o *DeleteAppsAppParams) WithContext(ctx context.Context) *DeleteAppsAppParams { o.SetContext(ctx) return o }
go
func (o *DeleteAppsAppParams) WithContext(ctx context.Context) *DeleteAppsAppParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "DeleteAppsAppParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "DeleteAppsAppParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the delete apps app params
[ "WithContext", "adds", "the", "context", "to", "the", "delete", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/delete_apps_app_parameters.go#L88-L91
test
iron-io/functions_go
client/apps/delete_apps_app_parameters.go
WithHTTPClient
func (o *DeleteAppsAppParams) WithHTTPClient(client *http.Client) *DeleteAppsAppParams { o.SetHTTPClient(client) return o }
go
func (o *DeleteAppsAppParams) WithHTTPClient(client *http.Client) *DeleteAppsAppParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "DeleteAppsAppParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "DeleteAppsAppParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the delete apps app params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "delete", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/delete_apps_app_parameters.go#L99-L102
test
iron-io/functions_go
client/apps/delete_apps_app_parameters.go
WithApp
func (o *DeleteAppsAppParams) WithApp(app string) *DeleteAppsAppParams { o.SetApp(app) return o }
go
func (o *DeleteAppsAppParams) WithApp(app string) *DeleteAppsAppParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "DeleteAppsAppParams", ")", "WithApp", "(", "app", "string", ")", "*", "DeleteAppsAppParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the delete apps app params
[ "WithApp", "adds", "the", "app", "to", "the", "delete", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/delete_apps_app_parameters.go#L110-L113
test
iron-io/functions_go
client/routes/patch_apps_app_routes_route_parameters.go
WithTimeout
func (o *PatchAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *PatchAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
go
func (o *PatchAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *PatchAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the patch apps app routes route params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/patch_apps_app_routes_route_parameters.go#L89-L92
test
iron-io/functions_go
client/routes/patch_apps_app_routes_route_parameters.go
WithContext
func (o *PatchAppsAppRoutesRouteParams) WithContext(ctx context.Context) *PatchAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
go
func (o *PatchAppsAppRoutesRouteParams) WithContext(ctx context.Context) *PatchAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the patch apps app routes route params
[ "WithContext", "adds", "the", "context", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/patch_apps_app_routes_route_parameters.go#L100-L103
test
iron-io/functions_go
client/routes/patch_apps_app_routes_route_parameters.go
WithHTTPClient
func (o *PatchAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *PatchAppsAppRoutesRouteParams { o.SetHTTPClient(client) return o }
go
func (o *PatchAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *PatchAppsAppRoutesRouteParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the patch apps app routes route params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/patch_apps_app_routes_route_parameters.go#L111-L114
test
iron-io/functions_go
client/routes/patch_apps_app_routes_route_parameters.go
WithApp
func (o *PatchAppsAppRoutesRouteParams) WithApp(app string) *PatchAppsAppRoutesRouteParams { o.SetApp(app) return o }
go
func (o *PatchAppsAppRoutesRouteParams) WithApp(app string) *PatchAppsAppRoutesRouteParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithApp", "(", "app", "string", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the patch apps app routes route params
[ "WithApp", "adds", "the", "app", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/patch_apps_app_routes_route_parameters.go#L122-L125
test
iron-io/functions_go
client/routes/patch_apps_app_routes_route_parameters.go
WithBody
func (o *PatchAppsAppRoutesRouteParams) WithBody(body *models.RouteWrapper) *PatchAppsAppRoutesRouteParams { o.SetBody(body) return o }
go
func (o *PatchAppsAppRoutesRouteParams) WithBody(body *models.RouteWrapper) *PatchAppsAppRoutesRouteParams { o.SetBody(body) return o }
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithBody", "(", "body", "*", "models", ".", "RouteWrapper", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
// WithBody adds the body to the patch apps app routes route params
[ "WithBody", "adds", "the", "body", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/patch_apps_app_routes_route_parameters.go#L133-L136
test
iron-io/functions_go
client/routes/patch_apps_app_routes_route_parameters.go
WithRoute
func (o *PatchAppsAppRoutesRouteParams) WithRoute(route string) *PatchAppsAppRoutesRouteParams { o.SetRoute(route) return o }
go
func (o *PatchAppsAppRoutesRouteParams) WithRoute(route string) *PatchAppsAppRoutesRouteParams { o.SetRoute(route) return o }
[ "func", "(", "o", "*", "PatchAppsAppRoutesRouteParams", ")", "WithRoute", "(", "route", "string", ")", "*", "PatchAppsAppRoutesRouteParams", "{", "o", ".", "SetRoute", "(", "route", ")", "\n", "return", "o", "\n", "}" ]
// WithRoute adds the route to the patch apps app routes route params
[ "WithRoute", "adds", "the", "route", "to", "the", "patch", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/patch_apps_app_routes_route_parameters.go#L144-L147
test
iron-io/functions_go
client/routes/post_apps_app_routes_parameters.go
WithTimeout
func (o *PostAppsAppRoutesParams) WithTimeout(timeout time.Duration) *PostAppsAppRoutesParams { o.SetTimeout(timeout) return o }
go
func (o *PostAppsAppRoutesParams) WithTimeout(timeout time.Duration) *PostAppsAppRoutesParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "PostAppsAppRoutesParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "PostAppsAppRoutesParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the post apps app routes params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "post", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/post_apps_app_routes_parameters.go#L84-L87
test
iron-io/functions_go
client/routes/post_apps_app_routes_parameters.go
WithContext
func (o *PostAppsAppRoutesParams) WithContext(ctx context.Context) *PostAppsAppRoutesParams { o.SetContext(ctx) return o }
go
func (o *PostAppsAppRoutesParams) WithContext(ctx context.Context) *PostAppsAppRoutesParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "PostAppsAppRoutesParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "PostAppsAppRoutesParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the post apps app routes params
[ "WithContext", "adds", "the", "context", "to", "the", "post", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/post_apps_app_routes_parameters.go#L95-L98
test
iron-io/functions_go
client/routes/post_apps_app_routes_parameters.go
WithHTTPClient
func (o *PostAppsAppRoutesParams) WithHTTPClient(client *http.Client) *PostAppsAppRoutesParams { o.SetHTTPClient(client) return o }
go
func (o *PostAppsAppRoutesParams) WithHTTPClient(client *http.Client) *PostAppsAppRoutesParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "PostAppsAppRoutesParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "PostAppsAppRoutesParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the post apps app routes params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "post", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/post_apps_app_routes_parameters.go#L106-L109
test
iron-io/functions_go
client/routes/post_apps_app_routes_parameters.go
WithApp
func (o *PostAppsAppRoutesParams) WithApp(app string) *PostAppsAppRoutesParams { o.SetApp(app) return o }
go
func (o *PostAppsAppRoutesParams) WithApp(app string) *PostAppsAppRoutesParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "PostAppsAppRoutesParams", ")", "WithApp", "(", "app", "string", ")", "*", "PostAppsAppRoutesParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the post apps app routes params
[ "WithApp", "adds", "the", "app", "to", "the", "post", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/post_apps_app_routes_parameters.go#L117-L120
test
iron-io/functions_go
client/routes/post_apps_app_routes_parameters.go
WithBody
func (o *PostAppsAppRoutesParams) WithBody(body *models.RouteWrapper) *PostAppsAppRoutesParams { o.SetBody(body) return o }
go
func (o *PostAppsAppRoutesParams) WithBody(body *models.RouteWrapper) *PostAppsAppRoutesParams { o.SetBody(body) return o }
[ "func", "(", "o", "*", "PostAppsAppRoutesParams", ")", "WithBody", "(", "body", "*", "models", ".", "RouteWrapper", ")", "*", "PostAppsAppRoutesParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
// WithBody adds the body to the post apps app routes params
[ "WithBody", "adds", "the", "body", "to", "the", "post", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/post_apps_app_routes_parameters.go#L128-L131
test
iron-io/functions_go
client/routes/put_apps_app_routes_route_parameters.go
WithTimeout
func (o *PutAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *PutAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
go
func (o *PutAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *PutAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "PutAppsAppRoutesRouteParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "PutAppsAppRoutesRouteParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the put apps app routes route params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "put", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/put_apps_app_routes_route_parameters.go#L76-L79
test
iron-io/functions_go
client/routes/put_apps_app_routes_route_parameters.go
WithContext
func (o *PutAppsAppRoutesRouteParams) WithContext(ctx context.Context) *PutAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
go
func (o *PutAppsAppRoutesRouteParams) WithContext(ctx context.Context) *PutAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "PutAppsAppRoutesRouteParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "PutAppsAppRoutesRouteParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the put apps app routes route params
[ "WithContext", "adds", "the", "context", "to", "the", "put", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/put_apps_app_routes_route_parameters.go#L87-L90
test
iron-io/functions_go
client/routes/put_apps_app_routes_route_parameters.go
WithApp
func (o *PutAppsAppRoutesRouteParams) WithApp(app string) *PutAppsAppRoutesRouteParams { o.SetApp(app) return o }
go
func (o *PutAppsAppRoutesRouteParams) WithApp(app string) *PutAppsAppRoutesRouteParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "PutAppsAppRoutesRouteParams", ")", "WithApp", "(", "app", "string", ")", "*", "PutAppsAppRoutesRouteParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the put apps app routes route params
[ "WithApp", "adds", "the", "app", "to", "the", "put", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/put_apps_app_routes_route_parameters.go#L98-L101
test
iron-io/functions_go
client/routes/put_apps_app_routes_route_parameters.go
WithBody
func (o *PutAppsAppRoutesRouteParams) WithBody(body *models.RouteWrapper) *PutAppsAppRoutesRouteParams { o.SetBody(body) return o }
go
func (o *PutAppsAppRoutesRouteParams) WithBody(body *models.RouteWrapper) *PutAppsAppRoutesRouteParams { o.SetBody(body) return o }
[ "func", "(", "o", "*", "PutAppsAppRoutesRouteParams", ")", "WithBody", "(", "body", "*", "models", ".", "RouteWrapper", ")", "*", "PutAppsAppRoutesRouteParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
// WithBody adds the body to the put apps app routes route params
[ "WithBody", "adds", "the", "body", "to", "the", "put", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/put_apps_app_routes_route_parameters.go#L109-L112
test
iron-io/functions_go
client/routes/put_apps_app_routes_route_parameters.go
WithRoute
func (o *PutAppsAppRoutesRouteParams) WithRoute(route string) *PutAppsAppRoutesRouteParams { o.SetRoute(route) return o }
go
func (o *PutAppsAppRoutesRouteParams) WithRoute(route string) *PutAppsAppRoutesRouteParams { o.SetRoute(route) return o }
[ "func", "(", "o", "*", "PutAppsAppRoutesRouteParams", ")", "WithRoute", "(", "route", "string", ")", "*", "PutAppsAppRoutesRouteParams", "{", "o", ".", "SetRoute", "(", "route", ")", "\n", "return", "o", "\n", "}" ]
// WithRoute adds the route to the put apps app routes route params
[ "WithRoute", "adds", "the", "route", "to", "the", "put", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/put_apps_app_routes_route_parameters.go#L120-L123
test
iron-io/functions_go
client/routes/get_apps_app_routes_parameters.go
WithTimeout
func (o *GetAppsAppRoutesParams) WithTimeout(timeout time.Duration) *GetAppsAppRoutesParams { o.SetTimeout(timeout) return o }
go
func (o *GetAppsAppRoutesParams) WithTimeout(timeout time.Duration) *GetAppsAppRoutesParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetAppsAppRoutesParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the get apps app routes params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "get", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_parameters.go#L77-L80
test
iron-io/functions_go
client/routes/get_apps_app_routes_parameters.go
WithContext
func (o *GetAppsAppRoutesParams) WithContext(ctx context.Context) *GetAppsAppRoutesParams { o.SetContext(ctx) return o }
go
func (o *GetAppsAppRoutesParams) WithContext(ctx context.Context) *GetAppsAppRoutesParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetAppsAppRoutesParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the get apps app routes params
[ "WithContext", "adds", "the", "context", "to", "the", "get", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_parameters.go#L88-L91
test
iron-io/functions_go
client/routes/get_apps_app_routes_parameters.go
WithHTTPClient
func (o *GetAppsAppRoutesParams) WithHTTPClient(client *http.Client) *GetAppsAppRoutesParams { o.SetHTTPClient(client) return o }
go
func (o *GetAppsAppRoutesParams) WithHTTPClient(client *http.Client) *GetAppsAppRoutesParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetAppsAppRoutesParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the get apps app routes params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_parameters.go#L99-L102
test
iron-io/functions_go
client/routes/get_apps_app_routes_parameters.go
WithApp
func (o *GetAppsAppRoutesParams) WithApp(app string) *GetAppsAppRoutesParams { o.SetApp(app) return o }
go
func (o *GetAppsAppRoutesParams) WithApp(app string) *GetAppsAppRoutesParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesParams", ")", "WithApp", "(", "app", "string", ")", "*", "GetAppsAppRoutesParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the get apps app routes params
[ "WithApp", "adds", "the", "app", "to", "the", "get", "apps", "app", "routes", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_parameters.go#L110-L113
test
iron-io/functions_go
client/apps/patch_apps_app_parameters.go
WithTimeout
func (o *PatchAppsAppParams) WithTimeout(timeout time.Duration) *PatchAppsAppParams { o.SetTimeout(timeout) return o }
go
func (o *PatchAppsAppParams) WithTimeout(timeout time.Duration) *PatchAppsAppParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "PatchAppsAppParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "PatchAppsAppParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the patch apps app params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "patch", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/patch_apps_app_parameters.go#L84-L87
test
iron-io/functions_go
client/apps/patch_apps_app_parameters.go
WithContext
func (o *PatchAppsAppParams) WithContext(ctx context.Context) *PatchAppsAppParams { o.SetContext(ctx) return o }
go
func (o *PatchAppsAppParams) WithContext(ctx context.Context) *PatchAppsAppParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "PatchAppsAppParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "PatchAppsAppParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the patch apps app params
[ "WithContext", "adds", "the", "context", "to", "the", "patch", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/patch_apps_app_parameters.go#L95-L98
test
iron-io/functions_go
client/apps/patch_apps_app_parameters.go
WithHTTPClient
func (o *PatchAppsAppParams) WithHTTPClient(client *http.Client) *PatchAppsAppParams { o.SetHTTPClient(client) return o }
go
func (o *PatchAppsAppParams) WithHTTPClient(client *http.Client) *PatchAppsAppParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "PatchAppsAppParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "PatchAppsAppParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the patch apps app params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "patch", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/patch_apps_app_parameters.go#L106-L109
test
iron-io/functions_go
client/apps/patch_apps_app_parameters.go
WithApp
func (o *PatchAppsAppParams) WithApp(app string) *PatchAppsAppParams { o.SetApp(app) return o }
go
func (o *PatchAppsAppParams) WithApp(app string) *PatchAppsAppParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "PatchAppsAppParams", ")", "WithApp", "(", "app", "string", ")", "*", "PatchAppsAppParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the patch apps app params
[ "WithApp", "adds", "the", "app", "to", "the", "patch", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/patch_apps_app_parameters.go#L117-L120
test
iron-io/functions_go
client/apps/patch_apps_app_parameters.go
WithBody
func (o *PatchAppsAppParams) WithBody(body *models.AppWrapper) *PatchAppsAppParams { o.SetBody(body) return o }
go
func (o *PatchAppsAppParams) WithBody(body *models.AppWrapper) *PatchAppsAppParams { o.SetBody(body) return o }
[ "func", "(", "o", "*", "PatchAppsAppParams", ")", "WithBody", "(", "body", "*", "models", ".", "AppWrapper", ")", "*", "PatchAppsAppParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
// WithBody adds the body to the patch apps app params
[ "WithBody", "adds", "the", "body", "to", "the", "patch", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/patch_apps_app_parameters.go#L128-L131
test
iron-io/functions_go
client/apps/put_apps_app_parameters.go
WithTimeout
func (o *PutAppsAppParams) WithTimeout(timeout time.Duration) *PutAppsAppParams { o.SetTimeout(timeout) return o }
go
func (o *PutAppsAppParams) WithTimeout(timeout time.Duration) *PutAppsAppParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "PutAppsAppParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "PutAppsAppParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the put apps app params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "put", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/put_apps_app_parameters.go#L71-L74
test
iron-io/functions_go
client/apps/put_apps_app_parameters.go
WithContext
func (o *PutAppsAppParams) WithContext(ctx context.Context) *PutAppsAppParams { o.SetContext(ctx) return o }
go
func (o *PutAppsAppParams) WithContext(ctx context.Context) *PutAppsAppParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "PutAppsAppParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "PutAppsAppParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the put apps app params
[ "WithContext", "adds", "the", "context", "to", "the", "put", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/put_apps_app_parameters.go#L82-L85
test
iron-io/functions_go
client/apps/put_apps_app_parameters.go
WithApp
func (o *PutAppsAppParams) WithApp(app string) *PutAppsAppParams { o.SetApp(app) return o }
go
func (o *PutAppsAppParams) WithApp(app string) *PutAppsAppParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "PutAppsAppParams", ")", "WithApp", "(", "app", "string", ")", "*", "PutAppsAppParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the put apps app params
[ "WithApp", "adds", "the", "app", "to", "the", "put", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/put_apps_app_parameters.go#L93-L96
test
iron-io/functions_go
client/apps/put_apps_app_parameters.go
WithBody
func (o *PutAppsAppParams) WithBody(body *models.AppWrapper) *PutAppsAppParams { o.SetBody(body) return o }
go
func (o *PutAppsAppParams) WithBody(body *models.AppWrapper) *PutAppsAppParams { o.SetBody(body) return o }
[ "func", "(", "o", "*", "PutAppsAppParams", ")", "WithBody", "(", "body", "*", "models", ".", "AppWrapper", ")", "*", "PutAppsAppParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
// WithBody adds the body to the put apps app params
[ "WithBody", "adds", "the", "body", "to", "the", "put", "apps", "app", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/apps/put_apps_app_parameters.go#L104-L107
test
iron-io/functions_go
models/task.go
UnmarshalJSON
func (m *Task) UnmarshalJSON(raw []byte) error { var aO0 NewTask if err := swag.ReadJSON(raw, &aO0); err != nil { return err } m.NewTask = aO0 var aO1 TaskAllOf1 if err := swag.ReadJSON(raw, &aO1); err != nil { return err } m.TaskAllOf1 = aO1 return nil }
go
func (m *Task) UnmarshalJSON(raw []byte) error { var aO0 NewTask if err := swag.ReadJSON(raw, &aO0); err != nil { return err } m.NewTask = aO0 var aO1 TaskAllOf1 if err := swag.ReadJSON(raw, &aO1); err != nil { return err } m.TaskAllOf1 = aO1 return nil }
[ "func", "(", "m", "*", "Task", ")", "UnmarshalJSON", "(", "raw", "[", "]", "byte", ")", "error", "{", "var", "aO0", "NewTask", "\n", "if", "err", ":=", "swag", ".", "ReadJSON", "(", "raw", ",", "&", "aO0", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "m", ".", "NewTask", "=", "aO0", "\n", "var", "aO1", "TaskAllOf1", "\n", "if", "err", ":=", "swag", ".", "ReadJSON", "(", "raw", ",", "&", "aO1", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "m", ".", "TaskAllOf1", "=", "aO1", "\n", "return", "nil", "\n", "}" ]
// UnmarshalJSON unmarshals this object from a JSON structure
[ "UnmarshalJSON", "unmarshals", "this", "object", "from", "a", "JSON", "structure" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/models/task.go#L25-L40
test
iron-io/functions_go
models/task.go
MarshalJSON
func (m Task) MarshalJSON() ([]byte, error) { var _parts [][]byte aO0, err := swag.WriteJSON(m.NewTask) if err != nil { return nil, err } _parts = append(_parts, aO0) aO1, err := swag.WriteJSON(m.TaskAllOf1) if err != nil { return nil, err } _parts = append(_parts, aO1) return swag.ConcatJSON(_parts...), nil }
go
func (m Task) MarshalJSON() ([]byte, error) { var _parts [][]byte aO0, err := swag.WriteJSON(m.NewTask) if err != nil { return nil, err } _parts = append(_parts, aO0) aO1, err := swag.WriteJSON(m.TaskAllOf1) if err != nil { return nil, err } _parts = append(_parts, aO1) return swag.ConcatJSON(_parts...), nil }
[ "func", "(", "m", "Task", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "_parts", "[", "]", "[", "]", "byte", "\n", "aO0", ",", "err", ":=", "swag", ".", "WriteJSON", "(", "m", ".", "NewTask", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "_parts", "=", "append", "(", "_parts", ",", "aO0", ")", "\n", "aO1", ",", "err", ":=", "swag", ".", "WriteJSON", "(", "m", ".", "TaskAllOf1", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "_parts", "=", "append", "(", "_parts", ",", "aO1", ")", "\n", "return", "swag", ".", "ConcatJSON", "(", "_parts", "...", ")", ",", "nil", "\n", "}" ]
// MarshalJSON marshals this object to a JSON structure
[ "MarshalJSON", "marshals", "this", "object", "to", "a", "JSON", "structure" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/models/task.go#L43-L59
test
iron-io/functions_go
models/task.go
Validate
func (m *Task) Validate(formats strfmt.Registry) error { var res []error if err := m.NewTask.Validate(formats); err != nil { res = append(res, err) } if err := m.TaskAllOf1.Validate(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
go
func (m *Task) Validate(formats strfmt.Registry) error { var res []error if err := m.NewTask.Validate(formats); err != nil { res = append(res, err) } if err := m.TaskAllOf1.Validate(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
[ "func", "(", "m", "*", "Task", ")", "Validate", "(", "formats", "strfmt", ".", "Registry", ")", "error", "{", "var", "res", "[", "]", "error", "\n", "if", "err", ":=", "m", ".", "NewTask", ".", "Validate", "(", "formats", ")", ";", "err", "!=", "nil", "{", "res", "=", "append", "(", "res", ",", "err", ")", "\n", "}", "\n", "if", "err", ":=", "m", ".", "TaskAllOf1", ".", "Validate", "(", "formats", ")", ";", "err", "!=", "nil", "{", "res", "=", "append", "(", "res", ",", "err", ")", "\n", "}", "\n", "if", "len", "(", "res", ")", ">", "0", "{", "return", "errors", ".", "CompositeValidationError", "(", "res", "...", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
// Validate validates this task
[ "Validate", "validates", "this", "task" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/models/task.go#L62-L77
test
gopistolet/gospf
spf.go
GetRanges
func GetRanges(ips []string, ip4_cidr string, ip6_cidr string) ([]net.IPNet, error) { net_out := make([]net.IPNet, 0) for _, ip := range ips { cidr := "" if strings.Contains(ip, ":") { // IPv6 cidr = ip6_cidr if cidr == "" { cidr = "128" } if c, err := strconv.ParseInt(cidr, 10, 16); err != nil || c < 0 || c > 128 { return nil, &PermError{"Invalid IPv6 CIDR length: " + cidr} } } else { // IPv4 cidr = ip4_cidr if cidr == "" { cidr = "32" } if c, err := strconv.ParseInt(cidr, 10, 16); err != nil || c < 0 || c > 32 { return nil, &PermError{"Invalid IPv4 CIDR length: " + cidr} } } ip += "/" + cidr _, ipnet, err := net.ParseCIDR(ip) if err != nil { return nil, err } net_out = append(net_out, *ipnet) } return net_out, nil }
go
func GetRanges(ips []string, ip4_cidr string, ip6_cidr string) ([]net.IPNet, error) { net_out := make([]net.IPNet, 0) for _, ip := range ips { cidr := "" if strings.Contains(ip, ":") { // IPv6 cidr = ip6_cidr if cidr == "" { cidr = "128" } if c, err := strconv.ParseInt(cidr, 10, 16); err != nil || c < 0 || c > 128 { return nil, &PermError{"Invalid IPv6 CIDR length: " + cidr} } } else { // IPv4 cidr = ip4_cidr if cidr == "" { cidr = "32" } if c, err := strconv.ParseInt(cidr, 10, 16); err != nil || c < 0 || c > 32 { return nil, &PermError{"Invalid IPv4 CIDR length: " + cidr} } } ip += "/" + cidr _, ipnet, err := net.ParseCIDR(ip) if err != nil { return nil, err } net_out = append(net_out, *ipnet) } return net_out, nil }
[ "func", "GetRanges", "(", "ips", "[", "]", "string", ",", "ip4_cidr", "string", ",", "ip6_cidr", "string", ")", "(", "[", "]", "net", ".", "IPNet", ",", "error", ")", "{", "net_out", ":=", "make", "(", "[", "]", "net", ".", "IPNet", ",", "0", ")", "\n", "for", "_", ",", "ip", ":=", "range", "ips", "{", "cidr", ":=", "\"\"", "\n", "if", "strings", ".", "Contains", "(", "ip", ",", "\":\"", ")", "{", "cidr", "=", "ip6_cidr", "\n", "if", "cidr", "==", "\"\"", "{", "cidr", "=", "\"128\"", "\n", "}", "\n", "if", "c", ",", "err", ":=", "strconv", ".", "ParseInt", "(", "cidr", ",", "10", ",", "16", ")", ";", "err", "!=", "nil", "||", "c", "<", "0", "||", "c", ">", "128", "{", "return", "nil", ",", "&", "PermError", "{", "\"Invalid IPv6 CIDR length: \"", "+", "cidr", "}", "\n", "}", "\n", "}", "else", "{", "cidr", "=", "ip4_cidr", "\n", "if", "cidr", "==", "\"\"", "{", "cidr", "=", "\"32\"", "\n", "}", "\n", "if", "c", ",", "err", ":=", "strconv", ".", "ParseInt", "(", "cidr", ",", "10", ",", "16", ")", ";", "err", "!=", "nil", "||", "c", "<", "0", "||", "c", ">", "32", "{", "return", "nil", ",", "&", "PermError", "{", "\"Invalid IPv4 CIDR length: \"", "+", "cidr", "}", "\n", "}", "\n", "}", "\n", "ip", "+=", "\"/\"", "+", "cidr", "\n", "_", ",", "ipnet", ",", "err", ":=", "net", ".", "ParseCIDR", "(", "ip", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "net_out", "=", "append", "(", "net_out", ",", "*", "ipnet", ")", "\n", "}", "\n", "return", "net_out", ",", "nil", "\n", "}" ]
// GetRanges composes the CIDR IP ranges following RFC 4632 and RFC 4291 // of the given IPs, with a given IPv4 CIDR and IPv6 CIDR
[ "GetRanges", "composes", "the", "CIDR", "IP", "ranges", "following", "RFC", "4632", "and", "RFC", "4291", "of", "the", "given", "IPs", "with", "a", "given", "IPv4", "CIDR", "and", "IPv6", "CIDR" ]
a58dd1fcbf509d558a6809c54defbce6872c40c5
https://github.com/gopistolet/gospf/blob/a58dd1fcbf509d558a6809c54defbce6872c40c5/spf.go#L483-L519
test
iron-io/functions_go
client/routes/get_apps_app_routes_route_parameters.go
WithTimeout
func (o *GetAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *GetAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
go
func (o *GetAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *GetAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesRouteParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetAppsAppRoutesRouteParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the get apps app routes route params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "get", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_route_parameters.go#L82-L85
test
iron-io/functions_go
client/routes/get_apps_app_routes_route_parameters.go
WithContext
func (o *GetAppsAppRoutesRouteParams) WithContext(ctx context.Context) *GetAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
go
func (o *GetAppsAppRoutesRouteParams) WithContext(ctx context.Context) *GetAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesRouteParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetAppsAppRoutesRouteParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the get apps app routes route params
[ "WithContext", "adds", "the", "context", "to", "the", "get", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_route_parameters.go#L93-L96
test
iron-io/functions_go
client/routes/get_apps_app_routes_route_parameters.go
WithHTTPClient
func (o *GetAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *GetAppsAppRoutesRouteParams { o.SetHTTPClient(client) return o }
go
func (o *GetAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *GetAppsAppRoutesRouteParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesRouteParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetAppsAppRoutesRouteParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the get apps app routes route params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_route_parameters.go#L104-L107
test
iron-io/functions_go
client/routes/get_apps_app_routes_route_parameters.go
WithApp
func (o *GetAppsAppRoutesRouteParams) WithApp(app string) *GetAppsAppRoutesRouteParams { o.SetApp(app) return o }
go
func (o *GetAppsAppRoutesRouteParams) WithApp(app string) *GetAppsAppRoutesRouteParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesRouteParams", ")", "WithApp", "(", "app", "string", ")", "*", "GetAppsAppRoutesRouteParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the get apps app routes route params
[ "WithApp", "adds", "the", "app", "to", "the", "get", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_route_parameters.go#L115-L118
test
iron-io/functions_go
client/routes/get_apps_app_routes_route_parameters.go
WithRoute
func (o *GetAppsAppRoutesRouteParams) WithRoute(route string) *GetAppsAppRoutesRouteParams { o.SetRoute(route) return o }
go
func (o *GetAppsAppRoutesRouteParams) WithRoute(route string) *GetAppsAppRoutesRouteParams { o.SetRoute(route) return o }
[ "func", "(", "o", "*", "GetAppsAppRoutesRouteParams", ")", "WithRoute", "(", "route", "string", ")", "*", "GetAppsAppRoutesRouteParams", "{", "o", ".", "SetRoute", "(", "route", ")", "\n", "return", "o", "\n", "}" ]
// WithRoute adds the route to the get apps app routes route params
[ "WithRoute", "adds", "the", "route", "to", "the", "get", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/get_apps_app_routes_route_parameters.go#L126-L129
test
iron-io/functions_go
client/functions_client.go
New
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Functions { cli := new(Functions) cli.Transport = transport cli.Apps = apps.New(transport, formats) cli.Routes = routes.New(transport, formats) cli.Tasks = tasks.New(transport, formats) cli.Version = version.New(transport, formats) return cli }
go
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Functions { cli := new(Functions) cli.Transport = transport cli.Apps = apps.New(transport, formats) cli.Routes = routes.New(transport, formats) cli.Tasks = tasks.New(transport, formats) cli.Version = version.New(transport, formats) return cli }
[ "func", "New", "(", "transport", "runtime", ".", "ClientTransport", ",", "formats", "strfmt", ".", "Registry", ")", "*", "Functions", "{", "cli", ":=", "new", "(", "Functions", ")", "\n", "cli", ".", "Transport", "=", "transport", "\n", "cli", ".", "Apps", "=", "apps", ".", "New", "(", "transport", ",", "formats", ")", "\n", "cli", ".", "Routes", "=", "routes", ".", "New", "(", "transport", ",", "formats", ")", "\n", "cli", ".", "Tasks", "=", "tasks", ".", "New", "(", "transport", ",", "formats", ")", "\n", "cli", ".", "Version", "=", "version", ".", "New", "(", "transport", ",", "formats", ")", "\n", "return", "cli", "\n", "}" ]
// New creates a new functions client
[ "New", "creates", "a", "new", "functions", "client" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/functions_client.go#L57-L70
test
iron-io/functions_go
client/functions_client.go
SetTransport
func (c *Functions) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Apps.SetTransport(transport) c.Routes.SetTransport(transport) c.Tasks.SetTransport(transport) c.Version.SetTransport(transport) }
go
func (c *Functions) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Apps.SetTransport(transport) c.Routes.SetTransport(transport) c.Tasks.SetTransport(transport) c.Version.SetTransport(transport) }
[ "func", "(", "c", "*", "Functions", ")", "SetTransport", "(", "transport", "runtime", ".", "ClientTransport", ")", "{", "c", ".", "Transport", "=", "transport", "\n", "c", ".", "Apps", ".", "SetTransport", "(", "transport", ")", "\n", "c", ".", "Routes", ".", "SetTransport", "(", "transport", ")", "\n", "c", ".", "Tasks", ".", "SetTransport", "(", "transport", ")", "\n", "c", ".", "Version", ".", "SetTransport", "(", "transport", ")", "\n", "}" ]
// SetTransport changes the transport on the client and all its subresources
[ "SetTransport", "changes", "the", "transport", "on", "the", "client", "and", "all", "its", "subresources" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/functions_client.go#L125-L136
test
iron-io/functions_go
client/routes/delete_apps_app_routes_route_parameters.go
WithTimeout
func (o *DeleteAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *DeleteAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
go
func (o *DeleteAppsAppRoutesRouteParams) WithTimeout(timeout time.Duration) *DeleteAppsAppRoutesRouteParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "DeleteAppsAppRoutesRouteParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "DeleteAppsAppRoutesRouteParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the delete apps app routes route params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "delete", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/delete_apps_app_routes_route_parameters.go#L82-L85
test
iron-io/functions_go
client/routes/delete_apps_app_routes_route_parameters.go
WithContext
func (o *DeleteAppsAppRoutesRouteParams) WithContext(ctx context.Context) *DeleteAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
go
func (o *DeleteAppsAppRoutesRouteParams) WithContext(ctx context.Context) *DeleteAppsAppRoutesRouteParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "DeleteAppsAppRoutesRouteParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "DeleteAppsAppRoutesRouteParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the delete apps app routes route params
[ "WithContext", "adds", "the", "context", "to", "the", "delete", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/delete_apps_app_routes_route_parameters.go#L93-L96
test
iron-io/functions_go
client/routes/delete_apps_app_routes_route_parameters.go
WithHTTPClient
func (o *DeleteAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *DeleteAppsAppRoutesRouteParams { o.SetHTTPClient(client) return o }
go
func (o *DeleteAppsAppRoutesRouteParams) WithHTTPClient(client *http.Client) *DeleteAppsAppRoutesRouteParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "DeleteAppsAppRoutesRouteParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "DeleteAppsAppRoutesRouteParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the delete apps app routes route params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "delete", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/delete_apps_app_routes_route_parameters.go#L104-L107
test
iron-io/functions_go
client/routes/delete_apps_app_routes_route_parameters.go
WithApp
func (o *DeleteAppsAppRoutesRouteParams) WithApp(app string) *DeleteAppsAppRoutesRouteParams { o.SetApp(app) return o }
go
func (o *DeleteAppsAppRoutesRouteParams) WithApp(app string) *DeleteAppsAppRoutesRouteParams { o.SetApp(app) return o }
[ "func", "(", "o", "*", "DeleteAppsAppRoutesRouteParams", ")", "WithApp", "(", "app", "string", ")", "*", "DeleteAppsAppRoutesRouteParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "return", "o", "\n", "}" ]
// WithApp adds the app to the delete apps app routes route params
[ "WithApp", "adds", "the", "app", "to", "the", "delete", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/delete_apps_app_routes_route_parameters.go#L115-L118
test
iron-io/functions_go
client/routes/delete_apps_app_routes_route_parameters.go
WithRoute
func (o *DeleteAppsAppRoutesRouteParams) WithRoute(route string) *DeleteAppsAppRoutesRouteParams { o.SetRoute(route) return o }
go
func (o *DeleteAppsAppRoutesRouteParams) WithRoute(route string) *DeleteAppsAppRoutesRouteParams { o.SetRoute(route) return o }
[ "func", "(", "o", "*", "DeleteAppsAppRoutesRouteParams", ")", "WithRoute", "(", "route", "string", ")", "*", "DeleteAppsAppRoutesRouteParams", "{", "o", ".", "SetRoute", "(", "route", ")", "\n", "return", "o", "\n", "}" ]
// WithRoute adds the route to the delete apps app routes route params
[ "WithRoute", "adds", "the", "route", "to", "the", "delete", "apps", "app", "routes", "route", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/routes/delete_apps_app_routes_route_parameters.go#L126-L129
test
iron-io/functions_go
client/tasks/get_tasks_parameters.go
WithTimeout
func (o *GetTasksParams) WithTimeout(timeout time.Duration) *GetTasksParams { o.SetTimeout(timeout) return o }
go
func (o *GetTasksParams) WithTimeout(timeout time.Duration) *GetTasksParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "GetTasksParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetTasksParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the get tasks params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "get", "tasks", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/tasks/get_tasks_parameters.go#L70-L73
test
iron-io/functions_go
client/tasks/get_tasks_parameters.go
WithContext
func (o *GetTasksParams) WithContext(ctx context.Context) *GetTasksParams { o.SetContext(ctx) return o }
go
func (o *GetTasksParams) WithContext(ctx context.Context) *GetTasksParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "GetTasksParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetTasksParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the get tasks params
[ "WithContext", "adds", "the", "context", "to", "the", "get", "tasks", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/tasks/get_tasks_parameters.go#L81-L84
test
iron-io/functions_go
client/tasks/get_tasks_parameters.go
WithHTTPClient
func (o *GetTasksParams) WithHTTPClient(client *http.Client) *GetTasksParams { o.SetHTTPClient(client) return o }
go
func (o *GetTasksParams) WithHTTPClient(client *http.Client) *GetTasksParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "GetTasksParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetTasksParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the get tasks params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "tasks", "params" ]
91b84f5bbb17095bf1c7028ec6e70a3dc06a5893
https://github.com/iron-io/functions_go/blob/91b84f5bbb17095bf1c7028ec6e70a3dc06a5893/client/tasks/get_tasks_parameters.go#L92-L95
test
pandemicsyn/oort
api/valuestore_GEN_.go
NewValueStore
func NewValueStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) (store.ValueStore, error) { stor := &valueStore{ addr: addr, ftlsc: ftlsConfig, opts: opts, handlersDoneChan: make(chan struct{}), } stor.pendingLookupReqChan = make(chan *asyncValueLookupRequest, concurrency) stor.freeLookupReqChan = make(chan *asyncValueLookupRequest, concurrency) stor.freeLookupResChan = make(chan *asyncValueLookupResponse, concurrency) for i := 0; i < cap(stor.freeLookupReqChan); i++ { stor.freeLookupReqChan <- &asyncValueLookupRequest{resChan: make(chan *asyncValueLookupResponse, 1)} } for i := 0; i < cap(stor.freeLookupResChan); i++ { stor.freeLookupResChan <- &asyncValueLookupResponse{} } go stor.handleLookupStream() stor.pendingReadReqChan = make(chan *asyncValueReadRequest, concurrency) stor.freeReadReqChan = make(chan *asyncValueReadRequest, concurrency) stor.freeReadResChan = make(chan *asyncValueReadResponse, concurrency) for i := 0; i < cap(stor.freeReadReqChan); i++ { stor.freeReadReqChan <- &asyncValueReadRequest{resChan: make(chan *asyncValueReadResponse, 1)} } for i := 0; i < cap(stor.freeReadResChan); i++ { stor.freeReadResChan <- &asyncValueReadResponse{} } go stor.handleReadStream() stor.pendingWriteReqChan = make(chan *asyncValueWriteRequest, concurrency) stor.freeWriteReqChan = make(chan *asyncValueWriteRequest, concurrency) stor.freeWriteResChan = make(chan *asyncValueWriteResponse, concurrency) for i := 0; i < cap(stor.freeWriteReqChan); i++ { stor.freeWriteReqChan <- &asyncValueWriteRequest{resChan: make(chan *asyncValueWriteResponse, 1)} } for i := 0; i < cap(stor.freeWriteResChan); i++ { stor.freeWriteResChan <- &asyncValueWriteResponse{} } go stor.handleWriteStream() stor.pendingDeleteReqChan = make(chan *asyncValueDeleteRequest, concurrency) stor.freeDeleteReqChan = make(chan *asyncValueDeleteRequest, concurrency) stor.freeDeleteResChan = make(chan *asyncValueDeleteResponse, concurrency) for i := 0; i < cap(stor.freeDeleteReqChan); i++ { stor.freeDeleteReqChan <- &asyncValueDeleteRequest{resChan: make(chan *asyncValueDeleteResponse, 1)} } for i := 0; i < cap(stor.freeDeleteResChan); i++ { stor.freeDeleteResChan <- &asyncValueDeleteResponse{} } go stor.handleDeleteStream() return stor, nil }
go
func NewValueStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) (store.ValueStore, error) { stor := &valueStore{ addr: addr, ftlsc: ftlsConfig, opts: opts, handlersDoneChan: make(chan struct{}), } stor.pendingLookupReqChan = make(chan *asyncValueLookupRequest, concurrency) stor.freeLookupReqChan = make(chan *asyncValueLookupRequest, concurrency) stor.freeLookupResChan = make(chan *asyncValueLookupResponse, concurrency) for i := 0; i < cap(stor.freeLookupReqChan); i++ { stor.freeLookupReqChan <- &asyncValueLookupRequest{resChan: make(chan *asyncValueLookupResponse, 1)} } for i := 0; i < cap(stor.freeLookupResChan); i++ { stor.freeLookupResChan <- &asyncValueLookupResponse{} } go stor.handleLookupStream() stor.pendingReadReqChan = make(chan *asyncValueReadRequest, concurrency) stor.freeReadReqChan = make(chan *asyncValueReadRequest, concurrency) stor.freeReadResChan = make(chan *asyncValueReadResponse, concurrency) for i := 0; i < cap(stor.freeReadReqChan); i++ { stor.freeReadReqChan <- &asyncValueReadRequest{resChan: make(chan *asyncValueReadResponse, 1)} } for i := 0; i < cap(stor.freeReadResChan); i++ { stor.freeReadResChan <- &asyncValueReadResponse{} } go stor.handleReadStream() stor.pendingWriteReqChan = make(chan *asyncValueWriteRequest, concurrency) stor.freeWriteReqChan = make(chan *asyncValueWriteRequest, concurrency) stor.freeWriteResChan = make(chan *asyncValueWriteResponse, concurrency) for i := 0; i < cap(stor.freeWriteReqChan); i++ { stor.freeWriteReqChan <- &asyncValueWriteRequest{resChan: make(chan *asyncValueWriteResponse, 1)} } for i := 0; i < cap(stor.freeWriteResChan); i++ { stor.freeWriteResChan <- &asyncValueWriteResponse{} } go stor.handleWriteStream() stor.pendingDeleteReqChan = make(chan *asyncValueDeleteRequest, concurrency) stor.freeDeleteReqChan = make(chan *asyncValueDeleteRequest, concurrency) stor.freeDeleteResChan = make(chan *asyncValueDeleteResponse, concurrency) for i := 0; i < cap(stor.freeDeleteReqChan); i++ { stor.freeDeleteReqChan <- &asyncValueDeleteRequest{resChan: make(chan *asyncValueDeleteResponse, 1)} } for i := 0; i < cap(stor.freeDeleteResChan); i++ { stor.freeDeleteResChan <- &asyncValueDeleteResponse{} } go stor.handleDeleteStream() return stor, nil }
[ "func", "NewValueStore", "(", "addr", "string", ",", "concurrency", "int", ",", "ftlsConfig", "*", "ftls", ".", "Config", ",", "opts", "...", "grpc", ".", "DialOption", ")", "(", "store", ".", "ValueStore", ",", "error", ")", "{", "stor", ":=", "&", "valueStore", "{", "addr", ":", "addr", ",", "ftlsc", ":", "ftlsConfig", ",", "opts", ":", "opts", ",", "handlersDoneChan", ":", "make", "(", "chan", "struct", "{", "}", ")", ",", "}", "\n", "stor", ".", "pendingLookupReqChan", "=", "make", "(", "chan", "*", "asyncValueLookupRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeLookupReqChan", "=", "make", "(", "chan", "*", "asyncValueLookupRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeLookupResChan", "=", "make", "(", "chan", "*", "asyncValueLookupResponse", ",", "concurrency", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeLookupReqChan", ")", ";", "i", "++", "{", "stor", ".", "freeLookupReqChan", "<-", "&", "asyncValueLookupRequest", "{", "resChan", ":", "make", "(", "chan", "*", "asyncValueLookupResponse", ",", "1", ")", "}", "\n", "}", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeLookupResChan", ")", ";", "i", "++", "{", "stor", ".", "freeLookupResChan", "<-", "&", "asyncValueLookupResponse", "{", "}", "\n", "}", "\n", "go", "stor", ".", "handleLookupStream", "(", ")", "\n", "stor", ".", "pendingReadReqChan", "=", "make", "(", "chan", "*", "asyncValueReadRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeReadReqChan", "=", "make", "(", "chan", "*", "asyncValueReadRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeReadResChan", "=", "make", "(", "chan", "*", "asyncValueReadResponse", ",", "concurrency", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeReadReqChan", ")", ";", "i", "++", "{", "stor", ".", "freeReadReqChan", "<-", "&", "asyncValueReadRequest", "{", "resChan", ":", "make", "(", "chan", "*", "asyncValueReadResponse", ",", "1", ")", "}", "\n", "}", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeReadResChan", ")", ";", "i", "++", "{", "stor", ".", "freeReadResChan", "<-", "&", "asyncValueReadResponse", "{", "}", "\n", "}", "\n", "go", "stor", ".", "handleReadStream", "(", ")", "\n", "stor", ".", "pendingWriteReqChan", "=", "make", "(", "chan", "*", "asyncValueWriteRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeWriteReqChan", "=", "make", "(", "chan", "*", "asyncValueWriteRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeWriteResChan", "=", "make", "(", "chan", "*", "asyncValueWriteResponse", ",", "concurrency", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeWriteReqChan", ")", ";", "i", "++", "{", "stor", ".", "freeWriteReqChan", "<-", "&", "asyncValueWriteRequest", "{", "resChan", ":", "make", "(", "chan", "*", "asyncValueWriteResponse", ",", "1", ")", "}", "\n", "}", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeWriteResChan", ")", ";", "i", "++", "{", "stor", ".", "freeWriteResChan", "<-", "&", "asyncValueWriteResponse", "{", "}", "\n", "}", "\n", "go", "stor", ".", "handleWriteStream", "(", ")", "\n", "stor", ".", "pendingDeleteReqChan", "=", "make", "(", "chan", "*", "asyncValueDeleteRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeDeleteReqChan", "=", "make", "(", "chan", "*", "asyncValueDeleteRequest", ",", "concurrency", ")", "\n", "stor", ".", "freeDeleteResChan", "=", "make", "(", "chan", "*", "asyncValueDeleteResponse", ",", "concurrency", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeDeleteReqChan", ")", ";", "i", "++", "{", "stor", ".", "freeDeleteReqChan", "<-", "&", "asyncValueDeleteRequest", "{", "resChan", ":", "make", "(", "chan", "*", "asyncValueDeleteResponse", ",", "1", ")", "}", "\n", "}", "\n", "for", "i", ":=", "0", ";", "i", "<", "cap", "(", "stor", ".", "freeDeleteResChan", ")", ";", "i", "++", "{", "stor", ".", "freeDeleteResChan", "<-", "&", "asyncValueDeleteResponse", "{", "}", "\n", "}", "\n", "go", "stor", ".", "handleDeleteStream", "(", ")", "\n", "return", "stor", ",", "nil", "\n", "}" ]
// NewValueStore creates a ValueStore connection via grpc to the given // address.
[ "NewValueStore", "creates", "a", "ValueStore", "connection", "via", "grpc", "to", "the", "given", "address", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/api/valuestore_GEN_.go#L44-L97
test
pandemicsyn/oort
api/valuestore_GEN_.go
Close
func (stor *valueStore) Close() { stor.lock.Lock() stor.shutdown() close(stor.handlersDoneChan) stor.lock.Unlock() }
go
func (stor *valueStore) Close() { stor.lock.Lock() stor.shutdown() close(stor.handlersDoneChan) stor.lock.Unlock() }
[ "func", "(", "stor", "*", "valueStore", ")", "Close", "(", ")", "{", "stor", ".", "lock", ".", "Lock", "(", ")", "\n", "stor", ".", "shutdown", "(", ")", "\n", "close", "(", "stor", ".", "handlersDoneChan", ")", "\n", "stor", ".", "lock", ".", "Unlock", "(", ")", "\n", "}" ]
// Close will shutdown outgoing connectivity and stop all background // goroutines; note that the valueStore is no longer usable after a call to // Close, including using Startup.
[ "Close", "will", "shutdown", "outgoing", "connectivity", "and", "stop", "all", "background", "goroutines", ";", "note", "that", "the", "valueStore", "is", "no", "longer", "usable", "after", "a", "call", "to", "Close", "including", "using", "Startup", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/api/valuestore_GEN_.go#L151-L156
test
pandemicsyn/oort
oort/oort.go
SetBackend
func (o *Server) SetBackend(backend OortService) { o.Lock() o.backend = backend o.Unlock() }
go
func (o *Server) SetBackend(backend OortService) { o.Lock() o.backend = backend o.Unlock() }
[ "func", "(", "o", "*", "Server", ")", "SetBackend", "(", "backend", "OortService", ")", "{", "o", ".", "Lock", "(", ")", "\n", "o", ".", "backend", "=", "backend", "\n", "o", ".", "Unlock", "(", ")", "\n", "}" ]
//SetBackend sets the current backend
[ "SetBackend", "sets", "the", "current", "backend" ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/oort.go#L77-L81
test
pandemicsyn/oort
oort/oort.go
Ring
func (o *Server) Ring() ring.Ring { o.RLock() defer o.RUnlock() return o.ring }
go
func (o *Server) Ring() ring.Ring { o.RLock() defer o.RUnlock() return o.ring }
[ "func", "(", "o", "*", "Server", ")", "Ring", "(", ")", "ring", ".", "Ring", "{", "o", ".", "RLock", "(", ")", "\n", "defer", "o", ".", "RUnlock", "(", ")", "\n", "return", "o", ".", "ring", "\n", "}" ]
// Ring returns an instance of the current Ring
[ "Ring", "returns", "an", "instance", "of", "the", "current", "Ring" ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/oort.go#L94-L98
test
pandemicsyn/oort
oort/oort.go
GetLocalID
func (o *Server) GetLocalID() uint64 { o.RLock() defer o.RUnlock() return o.localID }
go
func (o *Server) GetLocalID() uint64 { o.RLock() defer o.RUnlock() return o.localID }
[ "func", "(", "o", "*", "Server", ")", "GetLocalID", "(", ")", "uint64", "{", "o", ".", "RLock", "(", ")", "\n", "defer", "o", ".", "RUnlock", "(", ")", "\n", "return", "o", ".", "localID", "\n", "}" ]
// GetLocalID returns the current local id
[ "GetLocalID", "returns", "the", "current", "local", "id" ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/oort.go#L101-L105
test
pandemicsyn/oort
oort/oort.go
GetListenAddr
func (o *Server) GetListenAddr() string { o.RLock() defer o.RUnlock() return o.ring.LocalNode().Address(2) }
go
func (o *Server) GetListenAddr() string { o.RLock() defer o.RUnlock() return o.ring.LocalNode().Address(2) }
[ "func", "(", "o", "*", "Server", ")", "GetListenAddr", "(", ")", "string", "{", "o", ".", "RLock", "(", ")", "\n", "defer", "o", ".", "RUnlock", "(", ")", "\n", "return", "o", ".", "ring", ".", "LocalNode", "(", ")", ".", "Address", "(", "2", ")", "\n", "}" ]
// GetListenAddr returns the current localnode.address2 instance
[ "GetListenAddr", "returns", "the", "current", "localnode", ".", "address2", "instance" ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/oort.go#L108-L112
test
pandemicsyn/oort
api/groupreplstore_GEN_.go
Startup
func (rs *ReplGroupStore) Startup(ctx context.Context) error { rs.ringLock.Lock() if rs.ringServerExitChan == nil { rs.ringServerExitChan = make(chan struct{}) go rs.ringServerConnector(rs.ringServerExitChan) } rs.ringLock.Unlock() return nil }
go
func (rs *ReplGroupStore) Startup(ctx context.Context) error { rs.ringLock.Lock() if rs.ringServerExitChan == nil { rs.ringServerExitChan = make(chan struct{}) go rs.ringServerConnector(rs.ringServerExitChan) } rs.ringLock.Unlock() return nil }
[ "func", "(", "rs", "*", "ReplGroupStore", ")", "Startup", "(", "ctx", "context", ".", "Context", ")", "error", "{", "rs", ".", "ringLock", ".", "Lock", "(", ")", "\n", "if", "rs", ".", "ringServerExitChan", "==", "nil", "{", "rs", ".", "ringServerExitChan", "=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "go", "rs", ".", "ringServerConnector", "(", "rs", ".", "ringServerExitChan", ")", "\n", "}", "\n", "rs", ".", "ringLock", ".", "Unlock", "(", ")", "\n", "return", "nil", "\n", "}" ]
// Startup is not required to use the ReplGroupStore; it will automatically // connect to backend stores as needed. However, if you'd like to use the ring // service to receive ring updates and have the ReplGroupStore automatically // update itself accordingly, Startup will launch a connector to that service. // Otherwise, you will need to call SetRing yourself to inform the // ReplGroupStore of which backends to connect to.
[ "Startup", "is", "not", "required", "to", "use", "the", "ReplGroupStore", ";", "it", "will", "automatically", "connect", "to", "backend", "stores", "as", "needed", ".", "However", "if", "you", "d", "like", "to", "use", "the", "ring", "service", "to", "receive", "ring", "updates", "and", "have", "the", "ReplGroupStore", "automatically", "update", "itself", "accordingly", "Startup", "will", "launch", "a", "connector", "to", "that", "service", ".", "Otherwise", "you", "will", "need", "to", "call", "SetRing", "yourself", "to", "inform", "the", "ReplGroupStore", "of", "which", "backends", "to", "connect", "to", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/api/groupreplstore_GEN_.go#L356-L364
test
pandemicsyn/oort
oort/cmdctrl.go
shutdownFinished
func (o *Server) shutdownFinished() { time.Sleep(10 * time.Millisecond) close(o.ShutdownComplete) }
go
func (o *Server) shutdownFinished() { time.Sleep(10 * time.Millisecond) close(o.ShutdownComplete) }
[ "func", "(", "o", "*", "Server", ")", "shutdownFinished", "(", ")", "{", "time", ".", "Sleep", "(", "10", "*", "time", ".", "Millisecond", ")", "\n", "close", "(", "o", ".", "ShutdownComplete", ")", "\n", "}" ]
// shutdownFinished closes the shutdownComplete channel // 10 miliseconds after being invoked (to give a cmd ctrl client // a chance to return.
[ "shutdownFinished", "closes", "the", "shutdownComplete", "channel", "10", "miliseconds", "after", "being", "invoked", "(", "to", "give", "a", "cmd", "ctrl", "client", "a", "chance", "to", "return", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/cmdctrl.go#L106-L109
test
pandemicsyn/oort
oort/cmdctrl.go
Stop
func (o *Server) Stop() error { o.cmdCtrlLock.Lock() defer o.cmdCtrlLock.Unlock() if o.stopped { return fmt.Errorf("Service already stopped") } close(o.ch) o.backend.StopListenAndServe() o.backend.Wait() o.backend.Stop() o.stopped = true return nil }
go
func (o *Server) Stop() error { o.cmdCtrlLock.Lock() defer o.cmdCtrlLock.Unlock() if o.stopped { return fmt.Errorf("Service already stopped") } close(o.ch) o.backend.StopListenAndServe() o.backend.Wait() o.backend.Stop() o.stopped = true return nil }
[ "func", "(", "o", "*", "Server", ")", "Stop", "(", ")", "error", "{", "o", ".", "cmdCtrlLock", ".", "Lock", "(", ")", "\n", "defer", "o", ".", "cmdCtrlLock", ".", "Unlock", "(", ")", "\n", "if", "o", ".", "stopped", "{", "return", "fmt", ".", "Errorf", "(", "\"Service already stopped\"", ")", "\n", "}", "\n", "close", "(", "o", ".", "ch", ")", "\n", "o", ".", "backend", ".", "StopListenAndServe", "(", ")", "\n", "o", ".", "backend", ".", "Wait", "(", ")", "\n", "o", ".", "backend", ".", "Stop", "(", ")", "\n", "o", ".", "stopped", "=", "true", "\n", "return", "nil", "\n", "}" ]
// Stop the backend and shutdown all listeners. // Does NOT exist the process.
[ "Stop", "the", "backend", "and", "shutdown", "all", "listeners", ".", "Does", "NOT", "exist", "the", "process", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/cmdctrl.go#L113-L125
test
pandemicsyn/oort
oort/cmdctrl.go
Exit
func (o *Server) Exit() error { o.cmdCtrlLock.Lock() defer o.cmdCtrlLock.Unlock() if o.stopped { o.backend.Stop() defer o.shutdownFinished() return nil } close(o.ch) o.backend.StopListenAndServe() o.backend.Wait() o.backend.Stop() o.stopped = true defer o.shutdownFinished() return nil }
go
func (o *Server) Exit() error { o.cmdCtrlLock.Lock() defer o.cmdCtrlLock.Unlock() if o.stopped { o.backend.Stop() defer o.shutdownFinished() return nil } close(o.ch) o.backend.StopListenAndServe() o.backend.Wait() o.backend.Stop() o.stopped = true defer o.shutdownFinished() return nil }
[ "func", "(", "o", "*", "Server", ")", "Exit", "(", ")", "error", "{", "o", ".", "cmdCtrlLock", ".", "Lock", "(", ")", "\n", "defer", "o", ".", "cmdCtrlLock", ".", "Unlock", "(", ")", "\n", "if", "o", ".", "stopped", "{", "o", ".", "backend", ".", "Stop", "(", ")", "\n", "defer", "o", ".", "shutdownFinished", "(", ")", "\n", "return", "nil", "\n", "}", "\n", "close", "(", "o", ".", "ch", ")", "\n", "o", ".", "backend", ".", "StopListenAndServe", "(", ")", "\n", "o", ".", "backend", ".", "Wait", "(", ")", "\n", "o", ".", "backend", ".", "Stop", "(", ")", "\n", "o", ".", "stopped", "=", "true", "\n", "defer", "o", ".", "shutdownFinished", "(", ")", "\n", "return", "nil", "\n", "}" ]
// Exit the backend and shutdown all listeners. // Closes the ShutdownComplete chan when finsihed.
[ "Exit", "the", "backend", "and", "shutdown", "all", "listeners", ".", "Closes", "the", "ShutdownComplete", "chan", "when", "finsihed", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/cmdctrl.go#L129-L144
test
pandemicsyn/oort
oort/cmdctrl.go
SelfUpgrade
func (o *Server) SelfUpgrade(version string, bindiff, checksum []byte) (bool, string) { o.cmdCtrlLock.Lock() defer o.cmdCtrlLock.Unlock() err := o.binaryUpgrade.Upgrade(version) if err != nil { return false, err.Error() } return true, "" }
go
func (o *Server) SelfUpgrade(version string, bindiff, checksum []byte) (bool, string) { o.cmdCtrlLock.Lock() defer o.cmdCtrlLock.Unlock() err := o.binaryUpgrade.Upgrade(version) if err != nil { return false, err.Error() } return true, "" }
[ "func", "(", "o", "*", "Server", ")", "SelfUpgrade", "(", "version", "string", ",", "bindiff", ",", "checksum", "[", "]", "byte", ")", "(", "bool", ",", "string", ")", "{", "o", ".", "cmdCtrlLock", ".", "Lock", "(", ")", "\n", "defer", "o", ".", "cmdCtrlLock", ".", "Unlock", "(", ")", "\n", "err", ":=", "o", ".", "binaryUpgrade", ".", "Upgrade", "(", "version", ")", "\n", "if", "err", "!=", "nil", "{", "return", "false", ",", "err", ".", "Error", "(", ")", "\n", "}", "\n", "return", "true", ",", "\"\"", "\n", "}" ]
// SelfUpgrade deploys an updated binary to disk using cmdctrl.GithubUpdater
[ "SelfUpgrade", "deploys", "an", "updated", "binary", "to", "disk", "using", "cmdctrl", ".", "GithubUpdater" ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/cmdctrl.go#L147-L155
test
pandemicsyn/oort
oort/cmdctrl.go
SoftwareVersion
func (o *Server) SoftwareVersion() string { o.cmdCtrlLock.RLock() defer o.cmdCtrlLock.RUnlock() return o.binaryUpgrade.GetCurrentVersion() }
go
func (o *Server) SoftwareVersion() string { o.cmdCtrlLock.RLock() defer o.cmdCtrlLock.RUnlock() return o.binaryUpgrade.GetCurrentVersion() }
[ "func", "(", "o", "*", "Server", ")", "SoftwareVersion", "(", ")", "string", "{", "o", ".", "cmdCtrlLock", ".", "RLock", "(", ")", "\n", "defer", "o", ".", "cmdCtrlLock", ".", "RUnlock", "(", ")", "\n", "return", "o", ".", "binaryUpgrade", ".", "GetCurrentVersion", "(", ")", "\n", "}" ]
// SoftwareVersion returns the version of the currently running instance
[ "SoftwareVersion", "returns", "the", "version", "of", "the", "currently", "running", "instance" ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/cmdctrl.go#L158-L162
test
pandemicsyn/oort
api/groupstore_GEN_.go
Shutdown
func (stor *groupStore) Shutdown(ctx context.Context) error { stor.lock.Lock() err := stor.shutdown() stor.lock.Unlock() return err }
go
func (stor *groupStore) Shutdown(ctx context.Context) error { stor.lock.Lock() err := stor.shutdown() stor.lock.Unlock() return err }
[ "func", "(", "stor", "*", "groupStore", ")", "Shutdown", "(", "ctx", "context", ".", "Context", ")", "error", "{", "stor", ".", "lock", ".", "Lock", "(", ")", "\n", "err", ":=", "stor", ".", "shutdown", "(", ")", "\n", "stor", ".", "lock", ".", "Unlock", "(", ")", "\n", "return", "err", "\n", "}" ]
// Shutdown will close any existing connections; note that Startup may // automatically get called with any further activity, but it will use a new // connection. To ensure the groupStore has no further activity, use Close.
[ "Shutdown", "will", "close", "any", "existing", "connections", ";", "note", "that", "Startup", "may", "automatically", "get", "called", "with", "any", "further", "activity", "but", "it", "will", "use", "a", "new", "connection", ".", "To", "ensure", "the", "groupStore", "has", "no", "further", "activity", "use", "Close", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/api/groupstore_GEN_.go#L161-L166
test
jayeshsolanki93/devgorant
devrant.go
Rant
func (c *Client) Rant(rantId int) (RantModel, []CommentModel, error) { url := fmt.Sprintf(RANT_PATH, API, rantId, APP_VERSION) res, err := http.Get(url) if err != nil { return RantModel{}, nil, err } var data RantResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return RantModel{}, nil, errors.New(data.Error) } return data.Rant, data.Comments, nil }
go
func (c *Client) Rant(rantId int) (RantModel, []CommentModel, error) { url := fmt.Sprintf(RANT_PATH, API, rantId, APP_VERSION) res, err := http.Get(url) if err != nil { return RantModel{}, nil, err } var data RantResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return RantModel{}, nil, errors.New(data.Error) } return data.Rant, data.Comments, nil }
[ "func", "(", "c", "*", "Client", ")", "Rant", "(", "rantId", "int", ")", "(", "RantModel", ",", "[", "]", "CommentModel", ",", "error", ")", "{", "url", ":=", "fmt", ".", "Sprintf", "(", "RANT_PATH", ",", "API", ",", "rantId", ",", "APP_VERSION", ")", "\n", "res", ",", "err", ":=", "http", ".", "Get", "(", "url", ")", "\n", "if", "err", "!=", "nil", "{", "return", "RantModel", "{", "}", ",", "nil", ",", "err", "\n", "}", "\n", "var", "data", "RantResponse", "\n", "json", ".", "NewDecoder", "(", "res", ".", "Body", ")", ".", "Decode", "(", "&", "data", ")", "\n", "if", "!", "data", ".", "Success", "&&", "data", ".", "Error", "!=", "\"\"", "{", "return", "RantModel", "{", "}", ",", "nil", ",", "errors", ".", "New", "(", "data", ".", "Error", ")", "\n", "}", "\n", "return", "data", ".", "Rant", ",", "data", ".", "Comments", ",", "nil", "\n", "}" ]
// Fetches a rant and its comments given a valid rant id
[ "Fetches", "a", "rant", "and", "its", "comments", "given", "a", "valid", "rant", "id" ]
69fb03e5c3b1da904aacf77240e04d85dd8e1c3c
https://github.com/jayeshsolanki93/devgorant/blob/69fb03e5c3b1da904aacf77240e04d85dd8e1c3c/devrant.go#L50-L62
test
jayeshsolanki93/devgorant
devrant.go
Profile
func (c *Client) Profile(username string) (UserModel, ContentModel, error) { userId, err := getUserId(username) if err != nil { return UserModel{}, ContentModel{}, err } url := fmt.Sprintf(USER_PATH, API, userId, APP_VERSION) res, err := http.Get(url) if err != nil { return UserModel{}, ContentModel{}, err } var data UserResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return UserModel{}, ContentModel{}, errors.New(data.Error) } return data.Profile, data.Profile.Content.Content, nil }
go
func (c *Client) Profile(username string) (UserModel, ContentModel, error) { userId, err := getUserId(username) if err != nil { return UserModel{}, ContentModel{}, err } url := fmt.Sprintf(USER_PATH, API, userId, APP_VERSION) res, err := http.Get(url) if err != nil { return UserModel{}, ContentModel{}, err } var data UserResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return UserModel{}, ContentModel{}, errors.New(data.Error) } return data.Profile, data.Profile.Content.Content, nil }
[ "func", "(", "c", "*", "Client", ")", "Profile", "(", "username", "string", ")", "(", "UserModel", ",", "ContentModel", ",", "error", ")", "{", "userId", ",", "err", ":=", "getUserId", "(", "username", ")", "\n", "if", "err", "!=", "nil", "{", "return", "UserModel", "{", "}", ",", "ContentModel", "{", "}", ",", "err", "\n", "}", "\n", "url", ":=", "fmt", ".", "Sprintf", "(", "USER_PATH", ",", "API", ",", "userId", ",", "APP_VERSION", ")", "\n", "res", ",", "err", ":=", "http", ".", "Get", "(", "url", ")", "\n", "if", "err", "!=", "nil", "{", "return", "UserModel", "{", "}", ",", "ContentModel", "{", "}", ",", "err", "\n", "}", "\n", "var", "data", "UserResponse", "\n", "json", ".", "NewDecoder", "(", "res", ".", "Body", ")", ".", "Decode", "(", "&", "data", ")", "\n", "if", "!", "data", ".", "Success", "&&", "data", ".", "Error", "!=", "\"\"", "{", "return", "UserModel", "{", "}", ",", "ContentModel", "{", "}", ",", "errors", ".", "New", "(", "data", ".", "Error", ")", "\n", "}", "\n", "return", "data", ".", "Profile", ",", "data", ".", "Profile", ".", "Content", ".", "Content", ",", "nil", "\n", "}" ]
// Fetches ranter's profile data
[ "Fetches", "ranter", "s", "profile", "data" ]
69fb03e5c3b1da904aacf77240e04d85dd8e1c3c
https://github.com/jayeshsolanki93/devgorant/blob/69fb03e5c3b1da904aacf77240e04d85dd8e1c3c/devrant.go#L65-L81
test
jayeshsolanki93/devgorant
devrant.go
Search
func (c *Client) Search(term string) ([]RantModel, error) { url := fmt.Sprintf(SEARCH_PATH, API, term, APP_VERSION) res, err := http.Get(url) if err != nil { return nil, err } var data SearchResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return nil, errors.New(data.Error) } return data.Rants, nil }
go
func (c *Client) Search(term string) ([]RantModel, error) { url := fmt.Sprintf(SEARCH_PATH, API, term, APP_VERSION) res, err := http.Get(url) if err != nil { return nil, err } var data SearchResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return nil, errors.New(data.Error) } return data.Rants, nil }
[ "func", "(", "c", "*", "Client", ")", "Search", "(", "term", "string", ")", "(", "[", "]", "RantModel", ",", "error", ")", "{", "url", ":=", "fmt", ".", "Sprintf", "(", "SEARCH_PATH", ",", "API", ",", "term", ",", "APP_VERSION", ")", "\n", "res", ",", "err", ":=", "http", ".", "Get", "(", "url", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "var", "data", "SearchResponse", "\n", "json", ".", "NewDecoder", "(", "res", ".", "Body", ")", ".", "Decode", "(", "&", "data", ")", "\n", "if", "!", "data", ".", "Success", "&&", "data", ".", "Error", "!=", "\"\"", "{", "return", "nil", ",", "errors", ".", "New", "(", "data", ".", "Error", ")", "\n", "}", "\n", "return", "data", ".", "Rants", ",", "nil", "\n", "}" ]
// Search for rants matching the search term
[ "Search", "for", "rants", "matching", "the", "search", "term" ]
69fb03e5c3b1da904aacf77240e04d85dd8e1c3c
https://github.com/jayeshsolanki93/devgorant/blob/69fb03e5c3b1da904aacf77240e04d85dd8e1c3c/devrant.go#L84-L96
test
jayeshsolanki93/devgorant
devrant.go
Surprise
func (c *Client) Surprise() (RantModel, error) { url := fmt.Sprintf(SURPRISE_PATH, API, APP_VERSION) res, err := http.Get(url) if err != nil { return RantModel{}, err } var data RantResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return RantModel{}, errors.New(data.Error) } return data.Rant, nil }
go
func (c *Client) Surprise() (RantModel, error) { url := fmt.Sprintf(SURPRISE_PATH, API, APP_VERSION) res, err := http.Get(url) if err != nil { return RantModel{}, err } var data RantResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return RantModel{}, errors.New(data.Error) } return data.Rant, nil }
[ "func", "(", "c", "*", "Client", ")", "Surprise", "(", ")", "(", "RantModel", ",", "error", ")", "{", "url", ":=", "fmt", ".", "Sprintf", "(", "SURPRISE_PATH", ",", "API", ",", "APP_VERSION", ")", "\n", "res", ",", "err", ":=", "http", ".", "Get", "(", "url", ")", "\n", "if", "err", "!=", "nil", "{", "return", "RantModel", "{", "}", ",", "err", "\n", "}", "\n", "var", "data", "RantResponse", "\n", "json", ".", "NewDecoder", "(", "res", ".", "Body", ")", ".", "Decode", "(", "&", "data", ")", "\n", "if", "!", "data", ".", "Success", "&&", "data", ".", "Error", "!=", "\"\"", "{", "return", "RantModel", "{", "}", ",", "errors", ".", "New", "(", "data", ".", "Error", ")", "\n", "}", "\n", "return", "data", ".", "Rant", ",", "nil", "\n", "}" ]
// Returns a random rant
[ "Returns", "a", "random", "rant" ]
69fb03e5c3b1da904aacf77240e04d85dd8e1c3c
https://github.com/jayeshsolanki93/devgorant/blob/69fb03e5c3b1da904aacf77240e04d85dd8e1c3c/devrant.go#L99-L111
test
jayeshsolanki93/devgorant
devrant.go
WeeklyRants
func (c *Client) WeeklyRants() ([]RantModel, error) { url := fmt.Sprintf(WEEKLY_PATH, API, APP_VERSION) res, err := http.Get(url) if err != nil { return nil, err } var data RantsResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return nil, errors.New(data.Error) } return data.Rants, nil }
go
func (c *Client) WeeklyRants() ([]RantModel, error) { url := fmt.Sprintf(WEEKLY_PATH, API, APP_VERSION) res, err := http.Get(url) if err != nil { return nil, err } var data RantsResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return nil, errors.New(data.Error) } return data.Rants, nil }
[ "func", "(", "c", "*", "Client", ")", "WeeklyRants", "(", ")", "(", "[", "]", "RantModel", ",", "error", ")", "{", "url", ":=", "fmt", ".", "Sprintf", "(", "WEEKLY_PATH", ",", "API", ",", "APP_VERSION", ")", "\n", "res", ",", "err", ":=", "http", ".", "Get", "(", "url", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "var", "data", "RantsResponse", "\n", "json", ".", "NewDecoder", "(", "res", ".", "Body", ")", ".", "Decode", "(", "&", "data", ")", "\n", "if", "!", "data", ".", "Success", "&&", "data", ".", "Error", "!=", "\"\"", "{", "return", "nil", ",", "errors", ".", "New", "(", "data", ".", "Error", ")", "\n", "}", "\n", "return", "data", ".", "Rants", ",", "nil", "\n", "}" ]
// Returns the rants tagged for 'weekly'
[ "Returns", "the", "rants", "tagged", "for", "weekly" ]
69fb03e5c3b1da904aacf77240e04d85dd8e1c3c
https://github.com/jayeshsolanki93/devgorant/blob/69fb03e5c3b1da904aacf77240e04d85dd8e1c3c/devrant.go#L114-L126
test
jayeshsolanki93/devgorant
devrant.go
getUserId
func getUserId(username string) (int, error) { url := fmt.Sprintf(USER_ID_PATH, API, username, APP_VERSION) res, err := http.Get(url) if err != nil { return 0, err } var data GetUserIdResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return 0, errors.New(data.Error) } return data.UserId, nil }
go
func getUserId(username string) (int, error) { url := fmt.Sprintf(USER_ID_PATH, API, username, APP_VERSION) res, err := http.Get(url) if err != nil { return 0, err } var data GetUserIdResponse json.NewDecoder(res.Body).Decode(&data) if !data.Success && data.Error != "" { return 0, errors.New(data.Error) } return data.UserId, nil }
[ "func", "getUserId", "(", "username", "string", ")", "(", "int", ",", "error", ")", "{", "url", ":=", "fmt", ".", "Sprintf", "(", "USER_ID_PATH", ",", "API", ",", "username", ",", "APP_VERSION", ")", "\n", "res", ",", "err", ":=", "http", ".", "Get", "(", "url", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n", "var", "data", "GetUserIdResponse", "\n", "json", ".", "NewDecoder", "(", "res", ".", "Body", ")", ".", "Decode", "(", "&", "data", ")", "\n", "if", "!", "data", ".", "Success", "&&", "data", ".", "Error", "!=", "\"\"", "{", "return", "0", ",", "errors", ".", "New", "(", "data", ".", "Error", ")", "\n", "}", "\n", "return", "data", ".", "UserId", ",", "nil", "\n", "}" ]
// Fetches the userId given a valid username
[ "Fetches", "the", "userId", "given", "a", "valid", "username" ]
69fb03e5c3b1da904aacf77240e04d85dd8e1c3c
https://github.com/jayeshsolanki93/devgorant/blob/69fb03e5c3b1da904aacf77240e04d85dd8e1c3c/devrant.go#L129-L141
test
pandemicsyn/oort
api/valuereplstore_GEN_.go
Shutdown
func (rs *ReplValueStore) Shutdown(ctx context.Context) error { rs.ringLock.Lock() if rs.ringServerExitChan != nil { close(rs.ringServerExitChan) rs.ringServerExitChan = nil } rs.storesLock.Lock() for addr, stc := range rs.stores { if err := stc.store.Shutdown(ctx); err != nil { rs.logDebug("replValueStore: error during shutdown of store %s: %s", addr, err) } delete(rs.stores, addr) select { case <-ctx.Done(): rs.storesLock.Unlock() return ctx.Err() default: } } rs.storesLock.Unlock() rs.ringLock.Unlock() return nil }
go
func (rs *ReplValueStore) Shutdown(ctx context.Context) error { rs.ringLock.Lock() if rs.ringServerExitChan != nil { close(rs.ringServerExitChan) rs.ringServerExitChan = nil } rs.storesLock.Lock() for addr, stc := range rs.stores { if err := stc.store.Shutdown(ctx); err != nil { rs.logDebug("replValueStore: error during shutdown of store %s: %s", addr, err) } delete(rs.stores, addr) select { case <-ctx.Done(): rs.storesLock.Unlock() return ctx.Err() default: } } rs.storesLock.Unlock() rs.ringLock.Unlock() return nil }
[ "func", "(", "rs", "*", "ReplValueStore", ")", "Shutdown", "(", "ctx", "context", ".", "Context", ")", "error", "{", "rs", ".", "ringLock", ".", "Lock", "(", ")", "\n", "if", "rs", ".", "ringServerExitChan", "!=", "nil", "{", "close", "(", "rs", ".", "ringServerExitChan", ")", "\n", "rs", ".", "ringServerExitChan", "=", "nil", "\n", "}", "\n", "rs", ".", "storesLock", ".", "Lock", "(", ")", "\n", "for", "addr", ",", "stc", ":=", "range", "rs", ".", "stores", "{", "if", "err", ":=", "stc", ".", "store", ".", "Shutdown", "(", "ctx", ")", ";", "err", "!=", "nil", "{", "rs", ".", "logDebug", "(", "\"replValueStore: error during shutdown of store %s: %s\"", ",", "addr", ",", "err", ")", "\n", "}", "\n", "delete", "(", "rs", ".", "stores", ",", "addr", ")", "\n", "select", "{", "case", "<-", "ctx", ".", "Done", "(", ")", ":", "rs", ".", "storesLock", ".", "Unlock", "(", ")", "\n", "return", "ctx", ".", "Err", "(", ")", "\n", "default", ":", "}", "\n", "}", "\n", "rs", ".", "storesLock", ".", "Unlock", "(", ")", "\n", "rs", ".", "ringLock", ".", "Unlock", "(", ")", "\n", "return", "nil", "\n", "}" ]
// Shutdown will close all connections to backend stores and shutdown any // running ring service connector. Note that the ReplValueStore can still be // used after Shutdown, it will just start reconnecting to backends again. To // relaunch the ring service connector, you will need to call Startup.
[ "Shutdown", "will", "close", "all", "connections", "to", "backend", "stores", "and", "shutdown", "any", "running", "ring", "service", "connector", ".", "Note", "that", "the", "ReplValueStore", "can", "still", "be", "used", "after", "Shutdown", "it", "will", "just", "start", "reconnecting", "to", "backends", "again", ".", "To", "relaunch", "the", "ring", "service", "connector", "you", "will", "need", "to", "call", "Startup", "." ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/api/valuereplstore_GEN_.go#L370-L392
test
pandemicsyn/oort
oort/config.go
FExists
func FExists(name string) bool { if _, err := os.Stat(name); os.IsNotExist(err) { return false } return true }
go
func FExists(name string) bool { if _, err := os.Stat(name); os.IsNotExist(err) { return false } return true }
[ "func", "FExists", "(", "name", "string", ")", "bool", "{", "if", "_", ",", "err", ":=", "os", ".", "Stat", "(", "name", ")", ";", "os", ".", "IsNotExist", "(", "err", ")", "{", "return", "false", "\n", "}", "\n", "return", "true", "\n", "}" ]
// FExists true if a file or dir exists
[ "FExists", "true", "if", "a", "file", "or", "dir", "exists" ]
fca1d3baddc1d944387cc8bbe8b21f911ec9091b
https://github.com/pandemicsyn/oort/blob/fca1d3baddc1d944387cc8bbe8b21f911ec9091b/oort/config.go#L19-L24
test
shaleman/libOpenflow
util/stream.go
outbound
func (m *MessageStream) outbound() { for { select { case <-m.Shutdown: log.Infof("Closing OpenFlow message stream.") m.conn.Close() return case msg := <-m.Outbound: // Forward outbound messages to conn data, _ := msg.MarshalBinary() if _, err := m.conn.Write(data); err != nil { log.Warnln("OutboundError:", err) m.Error <- err m.Shutdown <- true } log.Debugf("Sent(%d): %v", len(data), data) } } }
go
func (m *MessageStream) outbound() { for { select { case <-m.Shutdown: log.Infof("Closing OpenFlow message stream.") m.conn.Close() return case msg := <-m.Outbound: // Forward outbound messages to conn data, _ := msg.MarshalBinary() if _, err := m.conn.Write(data); err != nil { log.Warnln("OutboundError:", err) m.Error <- err m.Shutdown <- true } log.Debugf("Sent(%d): %v", len(data), data) } } }
[ "func", "(", "m", "*", "MessageStream", ")", "outbound", "(", ")", "{", "for", "{", "select", "{", "case", "<-", "m", ".", "Shutdown", ":", "log", ".", "Infof", "(", "\"Closing OpenFlow message stream.\"", ")", "\n", "m", ".", "conn", ".", "Close", "(", ")", "\n", "return", "\n", "case", "msg", ":=", "<-", "m", ".", "Outbound", ":", "data", ",", "_", ":=", "msg", ".", "MarshalBinary", "(", ")", "\n", "if", "_", ",", "err", ":=", "m", ".", "conn", ".", "Write", "(", "data", ")", ";", "err", "!=", "nil", "{", "log", ".", "Warnln", "(", "\"OutboundError:\"", ",", "err", ")", "\n", "m", ".", "Error", "<-", "err", "\n", "m", ".", "Shutdown", "<-", "true", "\n", "}", "\n", "log", ".", "Debugf", "(", "\"Sent(%d): %v\"", ",", "len", "(", "data", ")", ",", "data", ")", "\n", "}", "\n", "}", "\n", "}" ]
// Listen for a Shutdown signal or Outbound messages.
[ "Listen", "for", "a", "Shutdown", "signal", "or", "Outbound", "messages", "." ]
ef74a407cc85370620a5515d627580b20f18a582
https://github.com/shaleman/libOpenflow/blob/ef74a407cc85370620a5515d627580b20f18a582/util/stream.go#L78-L97
test
shaleman/libOpenflow
util/stream.go
parse
func (m *MessageStream) parse() { for { b := <-m.pool.Full log.Debugf("Rcvd: %v", b.Bytes()) msg, err := m.parser.Parse(b.Bytes()) // Log all message parsing errors. if err != nil { log.Print(err) } m.Inbound <- msg b.Reset() m.pool.Empty <- b } }
go
func (m *MessageStream) parse() { for { b := <-m.pool.Full log.Debugf("Rcvd: %v", b.Bytes()) msg, err := m.parser.Parse(b.Bytes()) // Log all message parsing errors. if err != nil { log.Print(err) } m.Inbound <- msg b.Reset() m.pool.Empty <- b } }
[ "func", "(", "m", "*", "MessageStream", ")", "parse", "(", ")", "{", "for", "{", "b", ":=", "<-", "m", ".", "pool", ".", "Full", "\n", "log", ".", "Debugf", "(", "\"Rcvd: %v\"", ",", "b", ".", "Bytes", "(", ")", ")", "\n", "msg", ",", "err", ":=", "m", ".", "parser", ".", "Parse", "(", "b", ".", "Bytes", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Print", "(", "err", ")", "\n", "}", "\n", "m", ".", "Inbound", "<-", "msg", "\n", "b", ".", "Reset", "(", ")", "\n", "m", ".", "pool", ".", "Empty", "<-", "b", "\n", "}", "\n", "}" ]
// Parse incoming message
[ "Parse", "incoming", "message" ]
ef74a407cc85370620a5515d627580b20f18a582
https://github.com/shaleman/libOpenflow/blob/ef74a407cc85370620a5515d627580b20f18a582/util/stream.go#L145-L159
test
blacksails/cgp
group.go
Group
func (dom *Domain) Group(name string, members []*Account) *Group { return &Group{Domain: dom, Name: name, Members: members} }
go
func (dom *Domain) Group(name string, members []*Account) *Group { return &Group{Domain: dom, Name: name, Members: members} }
[ "func", "(", "dom", "*", "Domain", ")", "Group", "(", "name", "string", ",", "members", "[", "]", "*", "Account", ")", "*", "Group", "{", "return", "&", "Group", "{", "Domain", ":", "dom", ",", "Name", ":", "name", ",", "Members", ":", "members", "}", "\n", "}" ]
// Group creates a Group type from a domain, with the given name and members
[ "Group", "creates", "a", "Group", "type", "from", "a", "domain", "with", "the", "given", "name", "and", "members" ]
570ac705cf2d7a9235d911d00b6f976ab3386c2f
https://github.com/blacksails/cgp/blob/570ac705cf2d7a9235d911d00b6f976ab3386c2f/group.go#L18-L20
test
blacksails/cgp
group.go
Groups
func (dom *Domain) Groups() ([]*Group, error) { var vl valueList err := dom.cgp.request(listGroups{Domain: dom.Name}, &vl) if err != nil { return []*Group{}, err } vals := vl.compact() grps := make([]*Group, len(vals)) for i, v := range vals { g, err := dom.GetGroup(v) if err != nil { return grps, err } grps[i] = g } return grps, nil }
go
func (dom *Domain) Groups() ([]*Group, error) { var vl valueList err := dom.cgp.request(listGroups{Domain: dom.Name}, &vl) if err != nil { return []*Group{}, err } vals := vl.compact() grps := make([]*Group, len(vals)) for i, v := range vals { g, err := dom.GetGroup(v) if err != nil { return grps, err } grps[i] = g } return grps, nil }
[ "func", "(", "dom", "*", "Domain", ")", "Groups", "(", ")", "(", "[", "]", "*", "Group", ",", "error", ")", "{", "var", "vl", "valueList", "\n", "err", ":=", "dom", ".", "cgp", ".", "request", "(", "listGroups", "{", "Domain", ":", "dom", ".", "Name", "}", ",", "&", "vl", ")", "\n", "if", "err", "!=", "nil", "{", "return", "[", "]", "*", "Group", "{", "}", ",", "err", "\n", "}", "\n", "vals", ":=", "vl", ".", "compact", "(", ")", "\n", "grps", ":=", "make", "(", "[", "]", "*", "Group", ",", "len", "(", "vals", ")", ")", "\n", "for", "i", ",", "v", ":=", "range", "vals", "{", "g", ",", "err", ":=", "dom", ".", "GetGroup", "(", "v", ")", "\n", "if", "err", "!=", "nil", "{", "return", "grps", ",", "err", "\n", "}", "\n", "grps", "[", "i", "]", "=", "g", "\n", "}", "\n", "return", "grps", ",", "nil", "\n", "}" ]
// Groups lists the groups of a domain
[ "Groups", "lists", "the", "groups", "of", "a", "domain" ]
570ac705cf2d7a9235d911d00b6f976ab3386c2f
https://github.com/blacksails/cgp/blob/570ac705cf2d7a9235d911d00b6f976ab3386c2f/group.go#L28-L44
test
blacksails/cgp
group.go
GetGroup
func (dom *Domain) GetGroup(name string) (*Group, error) { var d dictionary err := dom.cgp.request(getGroup{Name: fmt.Sprintf("%s@%s", name, dom.Name)}, &d) if err != nil { return &Group{}, err } memStr := d.toMap()["Members"] var mems []*Account dec := xml.NewDecoder(bytes.NewBufferString(memStr)) for { var a string err := dec.Decode(&a) if err == io.EOF { break } if err != nil { return dom.Group(name, mems), err } if a == "" { continue } mems = append(mems, dom.Account(a)) } return dom.Group(name, mems), nil }
go
func (dom *Domain) GetGroup(name string) (*Group, error) { var d dictionary err := dom.cgp.request(getGroup{Name: fmt.Sprintf("%s@%s", name, dom.Name)}, &d) if err != nil { return &Group{}, err } memStr := d.toMap()["Members"] var mems []*Account dec := xml.NewDecoder(bytes.NewBufferString(memStr)) for { var a string err := dec.Decode(&a) if err == io.EOF { break } if err != nil { return dom.Group(name, mems), err } if a == "" { continue } mems = append(mems, dom.Account(a)) } return dom.Group(name, mems), nil }
[ "func", "(", "dom", "*", "Domain", ")", "GetGroup", "(", "name", "string", ")", "(", "*", "Group", ",", "error", ")", "{", "var", "d", "dictionary", "\n", "err", ":=", "dom", ".", "cgp", ".", "request", "(", "getGroup", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"%s@%s\"", ",", "name", ",", "dom", ".", "Name", ")", "}", ",", "&", "d", ")", "\n", "if", "err", "!=", "nil", "{", "return", "&", "Group", "{", "}", ",", "err", "\n", "}", "\n", "memStr", ":=", "d", ".", "toMap", "(", ")", "[", "\"Members\"", "]", "\n", "var", "mems", "[", "]", "*", "Account", "\n", "dec", ":=", "xml", ".", "NewDecoder", "(", "bytes", ".", "NewBufferString", "(", "memStr", ")", ")", "\n", "for", "{", "var", "a", "string", "\n", "err", ":=", "dec", ".", "Decode", "(", "&", "a", ")", "\n", "if", "err", "==", "io", ".", "EOF", "{", "break", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "return", "dom", ".", "Group", "(", "name", ",", "mems", ")", ",", "err", "\n", "}", "\n", "if", "a", "==", "\"\"", "{", "continue", "\n", "}", "\n", "mems", "=", "append", "(", "mems", ",", "dom", ".", "Account", "(", "a", ")", ")", "\n", "}", "\n", "return", "dom", ".", "Group", "(", "name", ",", "mems", ")", ",", "nil", "\n", "}" ]
// GetGroup retrieves a group from a domain with the given group name
[ "GetGroup", "retrieves", "a", "group", "from", "a", "domain", "with", "the", "given", "group", "name" ]
570ac705cf2d7a9235d911d00b6f976ab3386c2f
https://github.com/blacksails/cgp/blob/570ac705cf2d7a9235d911d00b6f976ab3386c2f/group.go#L52-L76
test
fcavani/text
util.go
Reticence
func Reticence(str string, length int) string { if length > len(str) { return str } var i int F: for i = len(str) - 1; i >= 0; i-- { switch str[i] { case ' ', ',', '?', ';', ':', '\'', '"', '!': if i <= length { break F } case '.': if i-2 >= 0 { s := str[i-2 : i] if s == ".." { i = i - 2 if i <= length { break F } } } if i <= length { break F } } } if i-1 > 0 { switch str[i-1] { case ' ', ',', '?', ';', ':', '\'', '"', '!': i-- case '.': if i-2 > 0 && str[i-2:i] == ".." { i -= 3 } } } if i >= 2 { if i+3 >= len(str) { return str } return str[:i] + "..." } if length >= 2 && length < len(str) { if length+3 >= len(str) { return str } return str[:length] + "..." } return str }
go
func Reticence(str string, length int) string { if length > len(str) { return str } var i int F: for i = len(str) - 1; i >= 0; i-- { switch str[i] { case ' ', ',', '?', ';', ':', '\'', '"', '!': if i <= length { break F } case '.': if i-2 >= 0 { s := str[i-2 : i] if s == ".." { i = i - 2 if i <= length { break F } } } if i <= length { break F } } } if i-1 > 0 { switch str[i-1] { case ' ', ',', '?', ';', ':', '\'', '"', '!': i-- case '.': if i-2 > 0 && str[i-2:i] == ".." { i -= 3 } } } if i >= 2 { if i+3 >= len(str) { return str } return str[:i] + "..." } if length >= 2 && length < len(str) { if length+3 >= len(str) { return str } return str[:length] + "..." } return str }
[ "func", "Reticence", "(", "str", "string", ",", "length", "int", ")", "string", "{", "if", "length", ">", "len", "(", "str", ")", "{", "return", "str", "\n", "}", "\n", "var", "i", "int", "\n", "F", ":", "for", "i", "=", "len", "(", "str", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", "{", "switch", "str", "[", "i", "]", "{", "case", "' '", ",", "','", ",", "'?'", ",", "';'", ",", "':'", ",", "'\\''", ",", "'\"'", ",", "'!'", ":", "if", "i", "<=", "length", "{", "break", "F", "\n", "}", "\n", "case", "'.'", ":", "if", "i", "-", "2", ">=", "0", "{", "s", ":=", "str", "[", "i", "-", "2", ":", "i", "]", "\n", "if", "s", "==", "\"..\"", "{", "i", "=", "i", "-", "2", "\n", "if", "i", "<=", "length", "{", "break", "F", "\n", "}", "\n", "}", "\n", "}", "\n", "if", "i", "<=", "length", "{", "break", "F", "\n", "}", "\n", "}", "\n", "}", "\n", "if", "i", "-", "1", ">", "0", "{", "switch", "str", "[", "i", "-", "1", "]", "{", "case", "' '", ",", "','", ",", "'?'", ",", "';'", ",", "':'", ",", "'\\''", ",", "'\"'", ",", "'!'", ":", "i", "--", "\n", "case", "'.'", ":", "if", "i", "-", "2", ">", "0", "&&", "str", "[", "i", "-", "2", ":", "i", "]", "==", "\"..\"", "{", "i", "-=", "3", "\n", "}", "\n", "}", "\n", "}", "\n", "if", "i", ">=", "2", "{", "if", "i", "+", "3", ">=", "len", "(", "str", ")", "{", "return", "str", "\n", "}", "\n", "return", "str", "[", ":", "i", "]", "+", "\"...\"", "\n", "}", "\n", "if", "length", ">=", "2", "&&", "length", "<", "len", "(", "str", ")", "{", "if", "length", "+", "3", ">=", "len", "(", "str", ")", "{", "return", "str", "\n", "}", "\n", "return", "str", "[", ":", "length", "]", "+", "\"...\"", "\n", "}", "\n", "return", "str", "\n", "}" ]
// Reticence trucate the string in the space or on pontuation mark and put // reticences in the resulting string.
[ "Reticence", "trucate", "the", "string", "in", "the", "space", "or", "on", "pontuation", "mark", "and", "put", "reticences", "in", "the", "resulting", "string", "." ]
023e76809b57fc8cfc80c855ba59537720821cb5
https://github.com/fcavani/text/blob/023e76809b57fc8cfc80c855ba59537720821cb5/util.go#L27-L77
test
fcavani/text
validation.go
CheckPassword
func CheckPassword(pass string, min, max int) error { if len(pass) < min || len(pass) > max { return e.New(ErrInvalidPassLength) } for _, r := range pass { if !unicode.IsGraphic(r) { return e.New(ErrInvalidPassChar) } } return nil }
go
func CheckPassword(pass string, min, max int) error { if len(pass) < min || len(pass) > max { return e.New(ErrInvalidPassLength) } for _, r := range pass { if !unicode.IsGraphic(r) { return e.New(ErrInvalidPassChar) } } return nil }
[ "func", "CheckPassword", "(", "pass", "string", ",", "min", ",", "max", "int", ")", "error", "{", "if", "len", "(", "pass", ")", "<", "min", "||", "len", "(", "pass", ")", ">", "max", "{", "return", "e", ".", "New", "(", "ErrInvalidPassLength", ")", "\n", "}", "\n", "for", "_", ",", "r", ":=", "range", "pass", "{", "if", "!", "unicode", ".", "IsGraphic", "(", "r", ")", "{", "return", "e", ".", "New", "(", "ErrInvalidPassChar", ")", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
// Check the user password. Graphics character are allowed. See unicode.IsGraphic.
[ "Check", "the", "user", "password", ".", "Graphics", "character", "are", "allowed", ".", "See", "unicode", ".", "IsGraphic", "." ]
023e76809b57fc8cfc80c855ba59537720821cb5
https://github.com/fcavani/text/blob/023e76809b57fc8cfc80c855ba59537720821cb5/validation.go#L84-L94
test