id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
157,900
go-swagger/go-swagger
examples/oauth2/restapi/operations/oauth_sample_api.go
NewOauthSampleAPI
func NewOauthSampleAPI(spec *loads.Document) *OauthSampleAPI { return &OauthSampleAPI{ handlers: make(map[string]map[string]http.Handler), formats: strfmt.Default, defaultConsumes: "application/json", defaultProduces: "application/json", customConsumers: make(map[string]runtime.Consumer), customProducers: make(map[string]runtime.Producer), ServerShutdown: func() {}, spec: spec, ServeError: errors.ServeError, BasicAuthenticator: security.BasicAuth, APIKeyAuthenticator: security.APIKeyAuth, BearerAuthenticator: security.BearerAuth, JSONConsumer: runtime.JSONConsumer(), JSONProducer: runtime.JSONProducer(), GetAuthCallbackHandler: GetAuthCallbackHandlerFunc(func(params GetAuthCallbackParams) middleware.Responder { return middleware.NotImplemented("operation GetAuthCallback has not yet been implemented") }), GetLoginHandler: GetLoginHandlerFunc(func(params GetLoginParams) middleware.Responder { return middleware.NotImplemented("operation GetLogin has not yet been implemented") }), CustomersCreateHandler: customers.CreateHandlerFunc(func(params customers.CreateParams, principal *models.Principal) middleware.Responder { return middleware.NotImplemented("operation CustomersCreate has not yet been implemented") }), CustomersGetIDHandler: customers.GetIDHandlerFunc(func(params customers.GetIDParams, principal *models.Principal) middleware.Responder { return middleware.NotImplemented("operation CustomersGetID has not yet been implemented") }), OauthSecurityAuth: func(token string, scopes []string) (*models.Principal, error) { return nil, errors.NotImplemented("oauth2 bearer auth (OauthSecurity) has not yet been implemented") }, // default authorizer is authorized meaning no requests are blocked APIAuthorizer: security.Authorized(), } }
go
func NewOauthSampleAPI(spec *loads.Document) *OauthSampleAPI { return &OauthSampleAPI{ handlers: make(map[string]map[string]http.Handler), formats: strfmt.Default, defaultConsumes: "application/json", defaultProduces: "application/json", customConsumers: make(map[string]runtime.Consumer), customProducers: make(map[string]runtime.Producer), ServerShutdown: func() {}, spec: spec, ServeError: errors.ServeError, BasicAuthenticator: security.BasicAuth, APIKeyAuthenticator: security.APIKeyAuth, BearerAuthenticator: security.BearerAuth, JSONConsumer: runtime.JSONConsumer(), JSONProducer: runtime.JSONProducer(), GetAuthCallbackHandler: GetAuthCallbackHandlerFunc(func(params GetAuthCallbackParams) middleware.Responder { return middleware.NotImplemented("operation GetAuthCallback has not yet been implemented") }), GetLoginHandler: GetLoginHandlerFunc(func(params GetLoginParams) middleware.Responder { return middleware.NotImplemented("operation GetLogin has not yet been implemented") }), CustomersCreateHandler: customers.CreateHandlerFunc(func(params customers.CreateParams, principal *models.Principal) middleware.Responder { return middleware.NotImplemented("operation CustomersCreate has not yet been implemented") }), CustomersGetIDHandler: customers.GetIDHandlerFunc(func(params customers.GetIDParams, principal *models.Principal) middleware.Responder { return middleware.NotImplemented("operation CustomersGetID has not yet been implemented") }), OauthSecurityAuth: func(token string, scopes []string) (*models.Principal, error) { return nil, errors.NotImplemented("oauth2 bearer auth (OauthSecurity) has not yet been implemented") }, // default authorizer is authorized meaning no requests are blocked APIAuthorizer: security.Authorized(), } }
[ "func", "NewOauthSampleAPI", "(", "spec", "*", "loads", ".", "Document", ")", "*", "OauthSampleAPI", "{", "return", "&", "OauthSampleAPI", "{", "handlers", ":", "make", "(", "map", "[", "string", "]", "map", "[", "string", "]", "http", ".", "Handler", ")...
// NewOauthSampleAPI creates a new OauthSample instance
[ "NewOauthSampleAPI", "creates", "a", "new", "OauthSample", "instance" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/oauth2/restapi/operations/oauth_sample_api.go#L28-L64
157,901
go-swagger/go-swagger
examples/oauth2/restapi/operations/oauth_sample_api.go
Validate
func (o *OauthSampleAPI) Validate() error { var unregistered []string if o.JSONConsumer == nil { unregistered = append(unregistered, "JSONConsumer") } if o.JSONProducer == nil { unregistered = append(unregistered, "JSONProducer") } if o.OauthSecurityAuth == nil { unregistered = append(unregistered, "OauthSecurityAuth") } if o.GetAuthCallbackHandler == nil { unregistered = append(unregistered, "GetAuthCallbackHandler") } if o.GetLoginHandler == nil { unregistered = append(unregistered, "GetLoginHandler") } if o.CustomersCreateHandler == nil { unregistered = append(unregistered, "customers.CreateHandler") } if o.CustomersGetIDHandler == nil { unregistered = append(unregistered, "customers.GetIDHandler") } if len(unregistered) > 0 { return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) } return nil }
go
func (o *OauthSampleAPI) Validate() error { var unregistered []string if o.JSONConsumer == nil { unregistered = append(unregistered, "JSONConsumer") } if o.JSONProducer == nil { unregistered = append(unregistered, "JSONProducer") } if o.OauthSecurityAuth == nil { unregistered = append(unregistered, "OauthSecurityAuth") } if o.GetAuthCallbackHandler == nil { unregistered = append(unregistered, "GetAuthCallbackHandler") } if o.GetLoginHandler == nil { unregistered = append(unregistered, "GetLoginHandler") } if o.CustomersCreateHandler == nil { unregistered = append(unregistered, "customers.CreateHandler") } if o.CustomersGetIDHandler == nil { unregistered = append(unregistered, "customers.GetIDHandler") } if len(unregistered) > 0 { return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) } return nil }
[ "func", "(", "o", "*", "OauthSampleAPI", ")", "Validate", "(", ")", "error", "{", "var", "unregistered", "[", "]", "string", "\n\n", "if", "o", ".", "JSONConsumer", "==", "nil", "{", "unregistered", "=", "append", "(", "unregistered", ",", "\"", "\"", ...
// Validate validates the registrations in the OauthSampleAPI
[ "Validate", "validates", "the", "registrations", "in", "the", "OauthSampleAPI" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/oauth2/restapi/operations/oauth_sample_api.go#L161-L197
157,902
go-swagger/go-swagger
examples/oauth2/restapi/operations/oauth_sample_api.go
Context
func (o *OauthSampleAPI) Context() *middleware.Context { if o.context == nil { o.context = middleware.NewRoutableContext(o.spec, o, nil) } return o.context }
go
func (o *OauthSampleAPI) Context() *middleware.Context { if o.context == nil { o.context = middleware.NewRoutableContext(o.spec, o, nil) } return o.context }
[ "func", "(", "o", "*", "OauthSampleAPI", ")", "Context", "(", ")", "*", "middleware", ".", "Context", "{", "if", "o", ".", "context", "==", "nil", "{", "o", ".", "context", "=", "middleware", ".", "NewRoutableContext", "(", "o", ".", "spec", ",", "o"...
// Context returns the middleware context for the oauth sample API
[ "Context", "returns", "the", "middleware", "context", "for", "the", "oauth", "sample", "API" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/oauth2/restapi/operations/oauth_sample_api.go#L287-L293
157,903
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
NewListTasksParams
func NewListTasksParams() *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, timeout: cr.DefaultTimeout, } }
go
func NewListTasksParams() *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, timeout: cr.DefaultTimeout, } }
[ "func", "NewListTasksParams", "(", ")", "*", "ListTasksParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "ListTasksParams", "{", "PageSize", ":", "&", "pageSizeDefault", ",", "timeout", ":", "cr", "....
// NewListTasksParams creates a new ListTasksParams object // with the default values initialized.
[ "NewListTasksParams", "creates", "a", "new", "ListTasksParams", "object", "with", "the", "default", "values", "initialized", "." ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L23-L32
157,904
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
NewListTasksParamsWithTimeout
func NewListTasksParamsWithTimeout(timeout time.Duration) *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, timeout: timeout, } }
go
func NewListTasksParamsWithTimeout(timeout time.Duration) *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, timeout: timeout, } }
[ "func", "NewListTasksParamsWithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "ListTasksParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "ListTasksParams", "{", "PageSize", ":", "&", "pa...
// NewListTasksParamsWithTimeout creates a new ListTasksParams object // with the default values initialized, and the ability to set a timeout on a request
[ "NewListTasksParamsWithTimeout", "creates", "a", "new", "ListTasksParams", "object", "with", "the", "default", "values", "initialized", "and", "the", "ability", "to", "set", "a", "timeout", "on", "a", "request" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L36-L45
157,905
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
NewListTasksParamsWithContext
func NewListTasksParamsWithContext(ctx context.Context) *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, Context: ctx, } }
go
func NewListTasksParamsWithContext(ctx context.Context) *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, Context: ctx, } }
[ "func", "NewListTasksParamsWithContext", "(", "ctx", "context", ".", "Context", ")", "*", "ListTasksParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "ListTasksParams", "{", "PageSize", ":", "&", "page...
// NewListTasksParamsWithContext creates a new ListTasksParams object // with the default values initialized, and the ability to set a context for a request
[ "NewListTasksParamsWithContext", "creates", "a", "new", "ListTasksParams", "object", "with", "the", "default", "values", "initialized", "and", "the", "ability", "to", "set", "a", "context", "for", "a", "request" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L49-L58
157,906
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
NewListTasksParamsWithHTTPClient
func NewListTasksParamsWithHTTPClient(client *http.Client) *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, HTTPClient: client, } }
go
func NewListTasksParamsWithHTTPClient(client *http.Client) *ListTasksParams { var ( pageSizeDefault = int32(20) ) return &ListTasksParams{ PageSize: &pageSizeDefault, HTTPClient: client, } }
[ "func", "NewListTasksParamsWithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "ListTasksParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "ListTasksParams", "{", "PageSize", ":", "&"...
// NewListTasksParamsWithHTTPClient creates a new ListTasksParams object // with the default values initialized, and the ability to set a custom HTTPClient for a request
[ "NewListTasksParamsWithHTTPClient", "creates", "a", "new", "ListTasksParams", "object", "with", "the", "default", "values", "initialized", "and", "the", "ability", "to", "set", "a", "custom", "HTTPClient", "for", "a", "request" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L62-L70
157,907
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
WithTimeout
func (o *ListTasksParams) WithTimeout(timeout time.Duration) *ListTasksParams { o.SetTimeout(timeout) return o }
go
func (o *ListTasksParams) WithTimeout(timeout time.Duration) *ListTasksParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "ListTasksParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "ListTasksParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the list tasks params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "list", "tasks", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L104-L107
157,908
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
WithContext
func (o *ListTasksParams) WithContext(ctx context.Context) *ListTasksParams { o.SetContext(ctx) return o }
go
func (o *ListTasksParams) WithContext(ctx context.Context) *ListTasksParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "ListTasksParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "ListTasksParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the list tasks params
[ "WithContext", "adds", "the", "context", "to", "the", "list", "tasks", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L115-L118
157,909
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
WithHTTPClient
func (o *ListTasksParams) WithHTTPClient(client *http.Client) *ListTasksParams { o.SetHTTPClient(client) return o }
go
func (o *ListTasksParams) WithHTTPClient(client *http.Client) *ListTasksParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "ListTasksParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "ListTasksParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the list tasks params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "list", "tasks", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L126-L129
157,910
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
WithPageSize
func (o *ListTasksParams) WithPageSize(pageSize *int32) *ListTasksParams { o.SetPageSize(pageSize) return o }
go
func (o *ListTasksParams) WithPageSize(pageSize *int32) *ListTasksParams { o.SetPageSize(pageSize) return o }
[ "func", "(", "o", "*", "ListTasksParams", ")", "WithPageSize", "(", "pageSize", "*", "int32", ")", "*", "ListTasksParams", "{", "o", ".", "SetPageSize", "(", "pageSize", ")", "\n", "return", "o", "\n", "}" ]
// WithPageSize adds the pageSize to the list tasks params
[ "WithPageSize", "adds", "the", "pageSize", "to", "the", "list", "tasks", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L137-L140
157,911
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
WithSinceID
func (o *ListTasksParams) WithSinceID(sinceID *int64) *ListTasksParams { o.SetSinceID(sinceID) return o }
go
func (o *ListTasksParams) WithSinceID(sinceID *int64) *ListTasksParams { o.SetSinceID(sinceID) return o }
[ "func", "(", "o", "*", "ListTasksParams", ")", "WithSinceID", "(", "sinceID", "*", "int64", ")", "*", "ListTasksParams", "{", "o", ".", "SetSinceID", "(", "sinceID", ")", "\n", "return", "o", "\n", "}" ]
// WithSinceID adds the sinceID to the list tasks params
[ "WithSinceID", "adds", "the", "sinceID", "to", "the", "list", "tasks", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L148-L151
157,912
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
WithStatus
func (o *ListTasksParams) WithStatus(status []string) *ListTasksParams { o.SetStatus(status) return o }
go
func (o *ListTasksParams) WithStatus(status []string) *ListTasksParams { o.SetStatus(status) return o }
[ "func", "(", "o", "*", "ListTasksParams", ")", "WithStatus", "(", "status", "[", "]", "string", ")", "*", "ListTasksParams", "{", "o", ".", "SetStatus", "(", "status", ")", "\n", "return", "o", "\n", "}" ]
// WithStatus adds the status to the list tasks params
[ "WithStatus", "adds", "the", "status", "to", "the", "list", "tasks", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L159-L162
157,913
go-swagger/go-swagger
examples/task-tracker/client/tasks/list_tasks_parameters.go
WithTags
func (o *ListTasksParams) WithTags(tags []string) *ListTasksParams { o.SetTags(tags) return o }
go
func (o *ListTasksParams) WithTags(tags []string) *ListTasksParams { o.SetTags(tags) return o }
[ "func", "(", "o", "*", "ListTasksParams", ")", "WithTags", "(", "tags", "[", "]", "string", ")", "*", "ListTasksParams", "{", "o", ".", "SetTags", "(", "tags", ")", "\n", "return", "o", "\n", "}" ]
// WithTags adds the tags to the list tasks params
[ "WithTags", "adds", "the", "tags", "to", "the", "list", "tasks", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/list_tasks_parameters.go#L170-L173
157,914
go-swagger/go-swagger
examples/todo-list/client/todos/find_parameters.go
WithTimeout
func (o *FindParams) WithTimeout(timeout time.Duration) *FindParams { o.SetTimeout(timeout) return o }
go
func (o *FindParams) WithTimeout(timeout time.Duration) *FindParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "FindParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "FindParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the find params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "find", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/todo-list/client/todos/find_parameters.go#L78-L81
157,915
go-swagger/go-swagger
examples/todo-list/client/todos/find_parameters.go
WithContext
func (o *FindParams) WithContext(ctx context.Context) *FindParams { o.SetContext(ctx) return o }
go
func (o *FindParams) WithContext(ctx context.Context) *FindParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "FindParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "FindParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the find params
[ "WithContext", "adds", "the", "context", "to", "the", "find", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/todo-list/client/todos/find_parameters.go#L89-L92
157,916
go-swagger/go-swagger
examples/todo-list/client/todos/find_parameters.go
WithHTTPClient
func (o *FindParams) WithHTTPClient(client *http.Client) *FindParams { o.SetHTTPClient(client) return o }
go
func (o *FindParams) WithHTTPClient(client *http.Client) *FindParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "FindParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "FindParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the find params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "find", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/todo-list/client/todos/find_parameters.go#L100-L103
157,917
go-swagger/go-swagger
examples/todo-list/client/todos/find_parameters.go
WithXRateLimit
func (o *FindParams) WithXRateLimit(xRateLimit int32) *FindParams { o.SetXRateLimit(xRateLimit) return o }
go
func (o *FindParams) WithXRateLimit(xRateLimit int32) *FindParams { o.SetXRateLimit(xRateLimit) return o }
[ "func", "(", "o", "*", "FindParams", ")", "WithXRateLimit", "(", "xRateLimit", "int32", ")", "*", "FindParams", "{", "o", ".", "SetXRateLimit", "(", "xRateLimit", ")", "\n", "return", "o", "\n", "}" ]
// WithXRateLimit adds the xRateLimit to the find params
[ "WithXRateLimit", "adds", "the", "xRateLimit", "to", "the", "find", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/todo-list/client/todos/find_parameters.go#L111-L114
157,918
go-swagger/go-swagger
examples/todo-list/client/todos/find_parameters.go
WithLimit
func (o *FindParams) WithLimit(limit int32) *FindParams { o.SetLimit(limit) return o }
go
func (o *FindParams) WithLimit(limit int32) *FindParams { o.SetLimit(limit) return o }
[ "func", "(", "o", "*", "FindParams", ")", "WithLimit", "(", "limit", "int32", ")", "*", "FindParams", "{", "o", ".", "SetLimit", "(", "limit", ")", "\n", "return", "o", "\n", "}" ]
// WithLimit adds the limit to the find params
[ "WithLimit", "adds", "the", "limit", "to", "the", "find", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/todo-list/client/todos/find_parameters.go#L122-L125
157,919
go-swagger/go-swagger
examples/todo-list/client/todos/find_parameters.go
WithTags
func (o *FindParams) WithTags(tags []int32) *FindParams { o.SetTags(tags) return o }
go
func (o *FindParams) WithTags(tags []int32) *FindParams { o.SetTags(tags) return o }
[ "func", "(", "o", "*", "FindParams", ")", "WithTags", "(", "tags", "[", "]", "int32", ")", "*", "FindParams", "{", "o", ".", "SetTags", "(", "tags", ")", "\n", "return", "o", "\n", "}" ]
// WithTags adds the tags to the find params
[ "WithTags", "adds", "the", "tags", "to", "the", "find", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/todo-list/client/todos/find_parameters.go#L133-L136
157,920
go-swagger/go-swagger
examples/composed-auth/restapi/operations/get_account_responses.go
WithStatusCode
func (o *GetAccountDefault) WithStatusCode(code int) *GetAccountDefault { o._statusCode = code return o }
go
func (o *GetAccountDefault) WithStatusCode(code int) *GetAccountDefault { o._statusCode = code return o }
[ "func", "(", "o", "*", "GetAccountDefault", ")", "WithStatusCode", "(", "code", "int", ")", "*", "GetAccountDefault", "{", "o", ".", "_statusCode", "=", "code", "\n", "return", "o", "\n", "}" ]
// WithStatusCode adds the status to the get account default response
[ "WithStatusCode", "adds", "the", "status", "to", "the", "get", "account", "default", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/composed-auth/restapi/operations/get_account_responses.go#L107-L110
157,921
go-swagger/go-swagger
examples/composed-auth/restapi/operations/get_account_responses.go
WithPayload
func (o *GetAccountDefault) WithPayload(payload *models.Error) *GetAccountDefault { o.Payload = payload return o }
go
func (o *GetAccountDefault) WithPayload(payload *models.Error) *GetAccountDefault { o.Payload = payload return o }
[ "func", "(", "o", "*", "GetAccountDefault", ")", "WithPayload", "(", "payload", "*", "models", ".", "Error", ")", "*", "GetAccountDefault", "{", "o", ".", "Payload", "=", "payload", "\n", "return", "o", "\n", "}" ]
// WithPayload adds the payload to the get account default response
[ "WithPayload", "adds", "the", "payload", "to", "the", "get", "account", "default", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/composed-auth/restapi/operations/get_account_responses.go#L118-L121
157,922
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
NewGetTaskCommentsParams
func NewGetTaskCommentsParams() *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, timeout: cr.DefaultTimeout, } }
go
func NewGetTaskCommentsParams() *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, timeout: cr.DefaultTimeout, } }
[ "func", "NewGetTaskCommentsParams", "(", ")", "*", "GetTaskCommentsParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "GetTaskCommentsParams", "{", "PageSize", ":", "&", "pageSizeDefault", ",", "timeout", ...
// NewGetTaskCommentsParams creates a new GetTaskCommentsParams object // with the default values initialized.
[ "NewGetTaskCommentsParams", "creates", "a", "new", "GetTaskCommentsParams", "object", "with", "the", "default", "values", "initialized", "." ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L23-L32
157,923
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
NewGetTaskCommentsParamsWithTimeout
func NewGetTaskCommentsParamsWithTimeout(timeout time.Duration) *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, timeout: timeout, } }
go
func NewGetTaskCommentsParamsWithTimeout(timeout time.Duration) *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, timeout: timeout, } }
[ "func", "NewGetTaskCommentsParamsWithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetTaskCommentsParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "GetTaskCommentsParams", "{", "PageSize", ...
// NewGetTaskCommentsParamsWithTimeout creates a new GetTaskCommentsParams object // with the default values initialized, and the ability to set a timeout on a request
[ "NewGetTaskCommentsParamsWithTimeout", "creates", "a", "new", "GetTaskCommentsParams", "object", "with", "the", "default", "values", "initialized", "and", "the", "ability", "to", "set", "a", "timeout", "on", "a", "request" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L36-L45
157,924
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
NewGetTaskCommentsParamsWithContext
func NewGetTaskCommentsParamsWithContext(ctx context.Context) *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, Context: ctx, } }
go
func NewGetTaskCommentsParamsWithContext(ctx context.Context) *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, Context: ctx, } }
[ "func", "NewGetTaskCommentsParamsWithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetTaskCommentsParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "GetTaskCommentsParams", "{", "PageSize", "...
// NewGetTaskCommentsParamsWithContext creates a new GetTaskCommentsParams object // with the default values initialized, and the ability to set a context for a request
[ "NewGetTaskCommentsParamsWithContext", "creates", "a", "new", "GetTaskCommentsParams", "object", "with", "the", "default", "values", "initialized", "and", "the", "ability", "to", "set", "a", "context", "for", "a", "request" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L49-L58
157,925
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
NewGetTaskCommentsParamsWithHTTPClient
func NewGetTaskCommentsParamsWithHTTPClient(client *http.Client) *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, HTTPClient: client, } }
go
func NewGetTaskCommentsParamsWithHTTPClient(client *http.Client) *GetTaskCommentsParams { var ( pageSizeDefault = int32(20) ) return &GetTaskCommentsParams{ PageSize: &pageSizeDefault, HTTPClient: client, } }
[ "func", "NewGetTaskCommentsParamsWithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetTaskCommentsParams", "{", "var", "(", "pageSizeDefault", "=", "int32", "(", "20", ")", "\n", ")", "\n", "return", "&", "GetTaskCommentsParams", "{", "PageS...
// NewGetTaskCommentsParamsWithHTTPClient creates a new GetTaskCommentsParams object // with the default values initialized, and the ability to set a custom HTTPClient for a request
[ "NewGetTaskCommentsParamsWithHTTPClient", "creates", "a", "new", "GetTaskCommentsParams", "object", "with", "the", "default", "values", "initialized", "and", "the", "ability", "to", "set", "a", "custom", "HTTPClient", "for", "a", "request" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L62-L70
157,926
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
WithTimeout
func (o *GetTaskCommentsParams) WithTimeout(timeout time.Duration) *GetTaskCommentsParams { o.SetTimeout(timeout) return o }
go
func (o *GetTaskCommentsParams) WithTimeout(timeout time.Duration) *GetTaskCommentsParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "GetTaskCommentsParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetTaskCommentsParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the get task comments params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "get", "task", "comments", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L99-L102
157,927
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
WithContext
func (o *GetTaskCommentsParams) WithContext(ctx context.Context) *GetTaskCommentsParams { o.SetContext(ctx) return o }
go
func (o *GetTaskCommentsParams) WithContext(ctx context.Context) *GetTaskCommentsParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "GetTaskCommentsParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetTaskCommentsParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the get task comments params
[ "WithContext", "adds", "the", "context", "to", "the", "get", "task", "comments", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L110-L113
157,928
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
WithHTTPClient
func (o *GetTaskCommentsParams) WithHTTPClient(client *http.Client) *GetTaskCommentsParams { o.SetHTTPClient(client) return o }
go
func (o *GetTaskCommentsParams) WithHTTPClient(client *http.Client) *GetTaskCommentsParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "GetTaskCommentsParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetTaskCommentsParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the get task comments params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "task", "comments", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L121-L124
157,929
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
WithID
func (o *GetTaskCommentsParams) WithID(id int64) *GetTaskCommentsParams { o.SetID(id) return o }
go
func (o *GetTaskCommentsParams) WithID(id int64) *GetTaskCommentsParams { o.SetID(id) return o }
[ "func", "(", "o", "*", "GetTaskCommentsParams", ")", "WithID", "(", "id", "int64", ")", "*", "GetTaskCommentsParams", "{", "o", ".", "SetID", "(", "id", ")", "\n", "return", "o", "\n", "}" ]
// WithID adds the id to the get task comments params
[ "WithID", "adds", "the", "id", "to", "the", "get", "task", "comments", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L132-L135
157,930
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
WithPageSize
func (o *GetTaskCommentsParams) WithPageSize(pageSize *int32) *GetTaskCommentsParams { o.SetPageSize(pageSize) return o }
go
func (o *GetTaskCommentsParams) WithPageSize(pageSize *int32) *GetTaskCommentsParams { o.SetPageSize(pageSize) return o }
[ "func", "(", "o", "*", "GetTaskCommentsParams", ")", "WithPageSize", "(", "pageSize", "*", "int32", ")", "*", "GetTaskCommentsParams", "{", "o", ".", "SetPageSize", "(", "pageSize", ")", "\n", "return", "o", "\n", "}" ]
// WithPageSize adds the pageSize to the get task comments params
[ "WithPageSize", "adds", "the", "pageSize", "to", "the", "get", "task", "comments", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L143-L146
157,931
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_comments_parameters.go
WithSince
func (o *GetTaskCommentsParams) WithSince(since *strfmt.DateTime) *GetTaskCommentsParams { o.SetSince(since) return o }
go
func (o *GetTaskCommentsParams) WithSince(since *strfmt.DateTime) *GetTaskCommentsParams { o.SetSince(since) return o }
[ "func", "(", "o", "*", "GetTaskCommentsParams", ")", "WithSince", "(", "since", "*", "strfmt", ".", "DateTime", ")", "*", "GetTaskCommentsParams", "{", "o", ".", "SetSince", "(", "since", ")", "\n", "return", "o", "\n", "}" ]
// WithSince adds the since to the get task comments params
[ "WithSince", "adds", "the", "since", "to", "the", "get", "task", "comments", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_comments_parameters.go#L154-L157
157,932
go-swagger/go-swagger
examples/task-tracker/restapi/operations/tasks/add_comment_to_task_responses.go
WithStatusCode
func (o *AddCommentToTaskDefault) WithStatusCode(code int) *AddCommentToTaskDefault { o._statusCode = code return o }
go
func (o *AddCommentToTaskDefault) WithStatusCode(code int) *AddCommentToTaskDefault { o._statusCode = code return o }
[ "func", "(", "o", "*", "AddCommentToTaskDefault", ")", "WithStatusCode", "(", "code", "int", ")", "*", "AddCommentToTaskDefault", "{", "o", ".", "_statusCode", "=", "code", "\n", "return", "o", "\n", "}" ]
// WithStatusCode adds the status to the add comment to task default response
[ "WithStatusCode", "adds", "the", "status", "to", "the", "add", "comment", "to", "task", "default", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/restapi/operations/tasks/add_comment_to_task_responses.go#L69-L72
157,933
go-swagger/go-swagger
examples/task-tracker/restapi/operations/tasks/add_comment_to_task_responses.go
WithXErrorCode
func (o *AddCommentToTaskDefault) WithXErrorCode(xErrorCode string) *AddCommentToTaskDefault { o.XErrorCode = xErrorCode return o }
go
func (o *AddCommentToTaskDefault) WithXErrorCode(xErrorCode string) *AddCommentToTaskDefault { o.XErrorCode = xErrorCode return o }
[ "func", "(", "o", "*", "AddCommentToTaskDefault", ")", "WithXErrorCode", "(", "xErrorCode", "string", ")", "*", "AddCommentToTaskDefault", "{", "o", ".", "XErrorCode", "=", "xErrorCode", "\n", "return", "o", "\n", "}" ]
// WithXErrorCode adds the xErrorCode to the add comment to task default response
[ "WithXErrorCode", "adds", "the", "xErrorCode", "to", "the", "add", "comment", "to", "task", "default", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/restapi/operations/tasks/add_comment_to_task_responses.go#L80-L83
157,934
go-swagger/go-swagger
examples/task-tracker/restapi/operations/tasks/add_comment_to_task_responses.go
WithPayload
func (o *AddCommentToTaskDefault) WithPayload(payload *models.Error) *AddCommentToTaskDefault { o.Payload = payload return o }
go
func (o *AddCommentToTaskDefault) WithPayload(payload *models.Error) *AddCommentToTaskDefault { o.Payload = payload return o }
[ "func", "(", "o", "*", "AddCommentToTaskDefault", ")", "WithPayload", "(", "payload", "*", "models", ".", "Error", ")", "*", "AddCommentToTaskDefault", "{", "o", ".", "Payload", "=", "payload", "\n", "return", "o", "\n", "}" ]
// WithPayload adds the payload to the add comment to task default response
[ "WithPayload", "adds", "the", "payload", "to", "the", "add", "comment", "to", "task", "default", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/restapi/operations/tasks/add_comment_to_task_responses.go#L91-L94
157,935
go-swagger/go-swagger
examples/task-tracker/restapi/operations/tasks/get_task_comments.go
NewGetTaskComments
func NewGetTaskComments(ctx *middleware.Context, handler GetTaskCommentsHandler) *GetTaskComments { return &GetTaskComments{Context: ctx, Handler: handler} }
go
func NewGetTaskComments(ctx *middleware.Context, handler GetTaskCommentsHandler) *GetTaskComments { return &GetTaskComments{Context: ctx, Handler: handler} }
[ "func", "NewGetTaskComments", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "GetTaskCommentsHandler", ")", "*", "GetTaskComments", "{", "return", "&", "GetTaskComments", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}...
// NewGetTaskComments creates a new http.Handler for the get task comments operation
[ "NewGetTaskComments", "creates", "a", "new", "http", ".", "Handler", "for", "the", "get", "task", "comments", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/restapi/operations/tasks/get_task_comments.go#L28-L30
157,936
go-swagger/go-swagger
examples/generated/restapi/operations/store/get_order_by_id_responses.go
WithPayload
func (o *GetOrderByIDOK) WithPayload(payload *models.Order) *GetOrderByIDOK { o.Payload = payload return o }
go
func (o *GetOrderByIDOK) WithPayload(payload *models.Order) *GetOrderByIDOK { o.Payload = payload return o }
[ "func", "(", "o", "*", "GetOrderByIDOK", ")", "WithPayload", "(", "payload", "*", "models", ".", "Order", ")", "*", "GetOrderByIDOK", "{", "o", ".", "Payload", "=", "payload", "\n", "return", "o", "\n", "}" ]
// WithPayload adds the payload to the get order by Id o k response
[ "WithPayload", "adds", "the", "payload", "to", "the", "get", "order", "by", "Id", "o", "k", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/generated/restapi/operations/store/get_order_by_id_responses.go#L38-L41
157,937
go-swagger/go-swagger
examples/generated/restapi/operations/store/place_order.go
NewPlaceOrder
func NewPlaceOrder(ctx *middleware.Context, handler PlaceOrderHandler) *PlaceOrder { return &PlaceOrder{Context: ctx, Handler: handler} }
go
func NewPlaceOrder(ctx *middleware.Context, handler PlaceOrderHandler) *PlaceOrder { return &PlaceOrder{Context: ctx, Handler: handler} }
[ "func", "NewPlaceOrder", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "PlaceOrderHandler", ")", "*", "PlaceOrder", "{", "return", "&", "PlaceOrder", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}" ]
// NewPlaceOrder creates a new http.Handler for the place order operation
[ "NewPlaceOrder", "creates", "a", "new", "http", ".", "Handler", "for", "the", "place", "order", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/generated/restapi/operations/store/place_order.go#L28-L30
157,938
go-swagger/go-swagger
cmd/swagger/commands/generate/shared.go
SetFlattenOptions
func (f *FlattenCmdOptions) SetFlattenOptions(dflt *analysis.FlattenOpts) (res *analysis.FlattenOpts) { res = &analysis.FlattenOpts{} if dflt != nil { *res = *dflt } if f == nil { return } verboseIsSet := false minimalIsSet := false //removeUnusedIsSet := false expandIsSet := false if f.WithExpand { res.Expand = true expandIsSet = true } for _, opt := range f.WithFlatten { if opt == "verbose" { res.Verbose = true verboseIsSet = true } if opt == "noverbose" && !verboseIsSet { // verbose flag takes precedence res.Verbose = false verboseIsSet = true } if opt == "remove-unused" { res.RemoveUnused = true //removeUnusedIsSet = true } if opt == "expand" { res.Expand = true expandIsSet = true } if opt == "full" && !minimalIsSet && !expandIsSet { // minimal flag takes precedence res.Minimal = false minimalIsSet = true } if opt == "minimal" && !expandIsSet { // expand flag takes precedence res.Minimal = true minimalIsSet = true } } return }
go
func (f *FlattenCmdOptions) SetFlattenOptions(dflt *analysis.FlattenOpts) (res *analysis.FlattenOpts) { res = &analysis.FlattenOpts{} if dflt != nil { *res = *dflt } if f == nil { return } verboseIsSet := false minimalIsSet := false //removeUnusedIsSet := false expandIsSet := false if f.WithExpand { res.Expand = true expandIsSet = true } for _, opt := range f.WithFlatten { if opt == "verbose" { res.Verbose = true verboseIsSet = true } if opt == "noverbose" && !verboseIsSet { // verbose flag takes precedence res.Verbose = false verboseIsSet = true } if opt == "remove-unused" { res.RemoveUnused = true //removeUnusedIsSet = true } if opt == "expand" { res.Expand = true expandIsSet = true } if opt == "full" && !minimalIsSet && !expandIsSet { // minimal flag takes precedence res.Minimal = false minimalIsSet = true } if opt == "minimal" && !expandIsSet { // expand flag takes precedence res.Minimal = true minimalIsSet = true } } return }
[ "func", "(", "f", "*", "FlattenCmdOptions", ")", "SetFlattenOptions", "(", "dflt", "*", "analysis", ".", "FlattenOpts", ")", "(", "res", "*", "analysis", ".", "FlattenOpts", ")", "{", "res", "=", "&", "analysis", ".", "FlattenOpts", "{", "}", "\n", "if",...
// SetFlattenOptions builds flatten options from command line args
[ "SetFlattenOptions", "builds", "flatten", "options", "from", "command", "line", "args" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/cmd/swagger/commands/generate/shared.go#L23-L69
157,939
go-swagger/go-swagger
examples/contributed-templates/stratoscale/restapi/operations/pet/pet_list.go
NewPetList
func NewPetList(ctx *middleware.Context, handler PetListHandler) *PetList { return &PetList{Context: ctx, Handler: handler} }
go
func NewPetList(ctx *middleware.Context, handler PetListHandler) *PetList { return &PetList{Context: ctx, Handler: handler} }
[ "func", "NewPetList", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "PetListHandler", ")", "*", "PetList", "{", "return", "&", "PetList", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}" ]
// NewPetList creates a new http.Handler for the pet list operation
[ "NewPetList", "creates", "a", "new", "http", ".", "Handler", "for", "the", "pet", "list", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/contributed-templates/stratoscale/restapi/operations/pet/pet_list.go#L28-L30
157,940
go-swagger/go-swagger
examples/composed-auth/restapi/operations/get_orders_for_item_parameters.go
bindItemID
func (o *GetOrdersForItemParams) bindItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: true // Parameter is provided by construction from the route o.ItemID = raw return nil }
go
func (o *GetOrdersForItemParams) bindItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: true // Parameter is provided by construction from the route o.ItemID = raw return nil }
[ "func", "(", "o", "*", "GetOrdersForItemParams", ")", "bindItemID", "(", "rawData", "[", "]", "string", ",", "hasKey", "bool", ",", "formats", "strfmt", ".", "Registry", ")", "error", "{", "var", "raw", "string", "\n", "if", "len", "(", "rawData", ")", ...
// bindItemID binds and validates parameter ItemID from path.
[ "bindItemID", "binds", "and", "validates", "parameter", "ItemID", "from", "path", "." ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/composed-auth/restapi/operations/get_orders_for_item_parameters.go#L61-L73
157,941
go-swagger/go-swagger
cmd/swagger/commands/mixin.go
MixinFiles
func (c *MixinSpec) MixinFiles(primaryFile string, mixinFiles []string, w io.Writer) ([]string, error) { primaryDoc, err := loads.Spec(primaryFile) if err != nil { return nil, err } primary := primaryDoc.Spec() var mixins []*spec.Swagger for _, mixinFile := range mixinFiles { mixin, lerr := loads.Spec(mixinFile) if lerr != nil { return nil, lerr } mixins = append(mixins, mixin.Spec()) } collisions := analysis.Mixin(primary, mixins...) analysis.FixEmptyResponseDescriptions(primary) return collisions, writeToFile(primary, !c.Compact, c.Format, string(c.Output)) }
go
func (c *MixinSpec) MixinFiles(primaryFile string, mixinFiles []string, w io.Writer) ([]string, error) { primaryDoc, err := loads.Spec(primaryFile) if err != nil { return nil, err } primary := primaryDoc.Spec() var mixins []*spec.Swagger for _, mixinFile := range mixinFiles { mixin, lerr := loads.Spec(mixinFile) if lerr != nil { return nil, lerr } mixins = append(mixins, mixin.Spec()) } collisions := analysis.Mixin(primary, mixins...) analysis.FixEmptyResponseDescriptions(primary) return collisions, writeToFile(primary, !c.Compact, c.Format, string(c.Output)) }
[ "func", "(", "c", "*", "MixinSpec", ")", "MixinFiles", "(", "primaryFile", "string", ",", "mixinFiles", "[", "]", "string", ",", "w", "io", ".", "Writer", ")", "(", "[", "]", "string", ",", "error", ")", "{", "primaryDoc", ",", "err", ":=", "loads", ...
// MixinFiles is a convenience function for Mixin that reads the given // swagger files, adds the mixins to primary, calls // FixEmptyResponseDescriptions on the primary, and writes the primary // with mixins to the given writer in JSON. Returns the warning // messages for collisions that occurred during mixin process and any // error.
[ "MixinFiles", "is", "a", "convenience", "function", "for", "Mixin", "that", "reads", "the", "given", "swagger", "files", "adds", "the", "mixins", "to", "primary", "calls", "FixEmptyResponseDescriptions", "on", "the", "primary", "and", "writes", "the", "primary", ...
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/cmd/swagger/commands/mixin.go#L82-L103
157,942
go-swagger/go-swagger
examples/generated/restapi/operations/pet/delete_pet.go
NewDeletePet
func NewDeletePet(ctx *middleware.Context, handler DeletePetHandler) *DeletePet { return &DeletePet{Context: ctx, Handler: handler} }
go
func NewDeletePet(ctx *middleware.Context, handler DeletePetHandler) *DeletePet { return &DeletePet{Context: ctx, Handler: handler} }
[ "func", "NewDeletePet", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "DeletePetHandler", ")", "*", "DeletePet", "{", "return", "&", "DeletePet", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}" ]
// NewDeletePet creates a new http.Handler for the delete pet operation
[ "NewDeletePet", "creates", "a", "new", "http", ".", "Handler", "for", "the", "delete", "pet", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/generated/restapi/operations/pet/delete_pet.go#L28-L30
157,943
go-swagger/go-swagger
examples/task-tracker/client/tasks/upload_task_file_parameters.go
WithTimeout
func (o *UploadTaskFileParams) WithTimeout(timeout time.Duration) *UploadTaskFileParams { o.SetTimeout(timeout) return o }
go
func (o *UploadTaskFileParams) WithTimeout(timeout time.Duration) *UploadTaskFileParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "UploadTaskFileParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "UploadTaskFileParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the upload task file params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "upload", "task", "file", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/upload_task_file_parameters.go#L87-L90
157,944
go-swagger/go-swagger
examples/task-tracker/client/tasks/upload_task_file_parameters.go
WithContext
func (o *UploadTaskFileParams) WithContext(ctx context.Context) *UploadTaskFileParams { o.SetContext(ctx) return o }
go
func (o *UploadTaskFileParams) WithContext(ctx context.Context) *UploadTaskFileParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "UploadTaskFileParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "UploadTaskFileParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the upload task file params
[ "WithContext", "adds", "the", "context", "to", "the", "upload", "task", "file", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/upload_task_file_parameters.go#L98-L101
157,945
go-swagger/go-swagger
examples/task-tracker/client/tasks/upload_task_file_parameters.go
WithHTTPClient
func (o *UploadTaskFileParams) WithHTTPClient(client *http.Client) *UploadTaskFileParams { o.SetHTTPClient(client) return o }
go
func (o *UploadTaskFileParams) WithHTTPClient(client *http.Client) *UploadTaskFileParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "UploadTaskFileParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "UploadTaskFileParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the upload task file params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "upload", "task", "file", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/upload_task_file_parameters.go#L109-L112
157,946
go-swagger/go-swagger
examples/task-tracker/client/tasks/upload_task_file_parameters.go
WithDescription
func (o *UploadTaskFileParams) WithDescription(description *string) *UploadTaskFileParams { o.SetDescription(description) return o }
go
func (o *UploadTaskFileParams) WithDescription(description *string) *UploadTaskFileParams { o.SetDescription(description) return o }
[ "func", "(", "o", "*", "UploadTaskFileParams", ")", "WithDescription", "(", "description", "*", "string", ")", "*", "UploadTaskFileParams", "{", "o", ".", "SetDescription", "(", "description", ")", "\n", "return", "o", "\n", "}" ]
// WithDescription adds the description to the upload task file params
[ "WithDescription", "adds", "the", "description", "to", "the", "upload", "task", "file", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/upload_task_file_parameters.go#L120-L123
157,947
go-swagger/go-swagger
examples/task-tracker/client/tasks/upload_task_file_parameters.go
WithFile
func (o *UploadTaskFileParams) WithFile(file runtime.NamedReadCloser) *UploadTaskFileParams { o.SetFile(file) return o }
go
func (o *UploadTaskFileParams) WithFile(file runtime.NamedReadCloser) *UploadTaskFileParams { o.SetFile(file) return o }
[ "func", "(", "o", "*", "UploadTaskFileParams", ")", "WithFile", "(", "file", "runtime", ".", "NamedReadCloser", ")", "*", "UploadTaskFileParams", "{", "o", ".", "SetFile", "(", "file", ")", "\n", "return", "o", "\n", "}" ]
// WithFile adds the file to the upload task file params
[ "WithFile", "adds", "the", "file", "to", "the", "upload", "task", "file", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/upload_task_file_parameters.go#L131-L134
157,948
go-swagger/go-swagger
examples/task-tracker/client/tasks/upload_task_file_parameters.go
WithID
func (o *UploadTaskFileParams) WithID(id int64) *UploadTaskFileParams { o.SetID(id) return o }
go
func (o *UploadTaskFileParams) WithID(id int64) *UploadTaskFileParams { o.SetID(id) return o }
[ "func", "(", "o", "*", "UploadTaskFileParams", ")", "WithID", "(", "id", "int64", ")", "*", "UploadTaskFileParams", "{", "o", ".", "SetID", "(", "id", ")", "\n", "return", "o", "\n", "}" ]
// WithID adds the id to the upload task file params
[ "WithID", "adds", "the", "id", "to", "the", "upload", "task", "file", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/upload_task_file_parameters.go#L142-L145
157,949
go-swagger/go-swagger
examples/generated/restapi/operations/user/get_user_by_name.go
NewGetUserByName
func NewGetUserByName(ctx *middleware.Context, handler GetUserByNameHandler) *GetUserByName { return &GetUserByName{Context: ctx, Handler: handler} }
go
func NewGetUserByName(ctx *middleware.Context, handler GetUserByNameHandler) *GetUserByName { return &GetUserByName{Context: ctx, Handler: handler} }
[ "func", "NewGetUserByName", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "GetUserByNameHandler", ")", "*", "GetUserByName", "{", "return", "&", "GetUserByName", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}" ]
// NewGetUserByName creates a new http.Handler for the get user by name operation
[ "NewGetUserByName", "creates", "a", "new", "http", ".", "Handler", "for", "the", "get", "user", "by", "name", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/generated/restapi/operations/user/get_user_by_name.go#L28-L30
157,950
go-swagger/go-swagger
examples/contributed-templates/stratoscale/restapi/operations/store/order_get.go
NewOrderGet
func NewOrderGet(ctx *middleware.Context, handler OrderGetHandler) *OrderGet { return &OrderGet{Context: ctx, Handler: handler} }
go
func NewOrderGet(ctx *middleware.Context, handler OrderGetHandler) *OrderGet { return &OrderGet{Context: ctx, Handler: handler} }
[ "func", "NewOrderGet", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "OrderGetHandler", ")", "*", "OrderGet", "{", "return", "&", "OrderGet", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}" ]
// NewOrderGet creates a new http.Handler for the order get operation
[ "NewOrderGet", "creates", "a", "new", "http", ".", "Handler", "for", "the", "order", "get", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/contributed-templates/stratoscale/restapi/operations/store/order_get.go#L28-L30
157,951
go-swagger/go-swagger
examples/task-tracker/restapi/operations/tasks/add_comment_to_task.go
NewAddCommentToTask
func NewAddCommentToTask(ctx *middleware.Context, handler AddCommentToTaskHandler) *AddCommentToTask { return &AddCommentToTask{Context: ctx, Handler: handler} }
go
func NewAddCommentToTask(ctx *middleware.Context, handler AddCommentToTaskHandler) *AddCommentToTask { return &AddCommentToTask{Context: ctx, Handler: handler} }
[ "func", "NewAddCommentToTask", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "AddCommentToTaskHandler", ")", "*", "AddCommentToTask", "{", "return", "&", "AddCommentToTask", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", ...
// NewAddCommentToTask creates a new http.Handler for the add comment to task operation
[ "NewAddCommentToTask", "creates", "a", "new", "http", ".", "Handler", "for", "the", "add", "comment", "to", "task", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/restapi/operations/tasks/add_comment_to_task.go#L32-L34
157,952
go-swagger/go-swagger
examples/stream-server/models/mark.go
Validate
func (m *Mark) Validate(formats strfmt.Registry) error { var res []error if err := m.validateRemains(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
go
func (m *Mark) Validate(formats strfmt.Registry) error { var res []error if err := m.validateRemains(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
[ "func", "(", "m", "*", "Mark", ")", "Validate", "(", "formats", "strfmt", ".", "Registry", ")", "error", "{", "var", "res", "[", "]", "error", "\n\n", "if", "err", ":=", "m", ".", "validateRemains", "(", "formats", ")", ";", "err", "!=", "nil", "{"...
// Validate validates this mark
[ "Validate", "validates", "this", "mark" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/stream-server/models/mark.go#L26-L37
157,953
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_details_parameters.go
WithTimeout
func (o *GetTaskDetailsParams) WithTimeout(timeout time.Duration) *GetTaskDetailsParams { o.SetTimeout(timeout) return o }
go
func (o *GetTaskDetailsParams) WithTimeout(timeout time.Duration) *GetTaskDetailsParams { o.SetTimeout(timeout) return o }
[ "func", "(", "o", "*", "GetTaskDetailsParams", ")", "WithTimeout", "(", "timeout", "time", ".", "Duration", ")", "*", "GetTaskDetailsParams", "{", "o", ".", "SetTimeout", "(", "timeout", ")", "\n", "return", "o", "\n", "}" ]
// WithTimeout adds the timeout to the get task details params
[ "WithTimeout", "adds", "the", "timeout", "to", "the", "get", "task", "details", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_details_parameters.go#L77-L80
157,954
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_details_parameters.go
WithContext
func (o *GetTaskDetailsParams) WithContext(ctx context.Context) *GetTaskDetailsParams { o.SetContext(ctx) return o }
go
func (o *GetTaskDetailsParams) WithContext(ctx context.Context) *GetTaskDetailsParams { o.SetContext(ctx) return o }
[ "func", "(", "o", "*", "GetTaskDetailsParams", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "GetTaskDetailsParams", "{", "o", ".", "SetContext", "(", "ctx", ")", "\n", "return", "o", "\n", "}" ]
// WithContext adds the context to the get task details params
[ "WithContext", "adds", "the", "context", "to", "the", "get", "task", "details", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_details_parameters.go#L88-L91
157,955
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_details_parameters.go
WithHTTPClient
func (o *GetTaskDetailsParams) WithHTTPClient(client *http.Client) *GetTaskDetailsParams { o.SetHTTPClient(client) return o }
go
func (o *GetTaskDetailsParams) WithHTTPClient(client *http.Client) *GetTaskDetailsParams { o.SetHTTPClient(client) return o }
[ "func", "(", "o", "*", "GetTaskDetailsParams", ")", "WithHTTPClient", "(", "client", "*", "http", ".", "Client", ")", "*", "GetTaskDetailsParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
// WithHTTPClient adds the HTTPClient to the get task details params
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "get", "task", "details", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_details_parameters.go#L99-L102
157,956
go-swagger/go-swagger
examples/task-tracker/client/tasks/get_task_details_parameters.go
WithID
func (o *GetTaskDetailsParams) WithID(id int64) *GetTaskDetailsParams { o.SetID(id) return o }
go
func (o *GetTaskDetailsParams) WithID(id int64) *GetTaskDetailsParams { o.SetID(id) return o }
[ "func", "(", "o", "*", "GetTaskDetailsParams", ")", "WithID", "(", "id", "int64", ")", "*", "GetTaskDetailsParams", "{", "o", ".", "SetID", "(", "id", ")", "\n", "return", "o", "\n", "}" ]
// WithID adds the id to the get task details params
[ "WithID", "adds", "the", "id", "to", "the", "get", "task", "details", "params" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/client/tasks/get_task_details_parameters.go#L110-L113
157,957
go-swagger/go-swagger
examples/tutorials/custom-server/gen/restapi/operations/greeter_api.go
NewGreeterAPI
func NewGreeterAPI(spec *loads.Document) *GreeterAPI { return &GreeterAPI{ handlers: make(map[string]map[string]http.Handler), formats: strfmt.Default, defaultConsumes: "application/json", defaultProduces: "application/json", customConsumers: make(map[string]runtime.Consumer), customProducers: make(map[string]runtime.Producer), ServerShutdown: func() {}, spec: spec, ServeError: errors.ServeError, BasicAuthenticator: security.BasicAuth, APIKeyAuthenticator: security.APIKeyAuth, BearerAuthenticator: security.BearerAuth, JSONConsumer: runtime.JSONConsumer(), TxtProducer: runtime.TextProducer(), GetGreetingHandler: GetGreetingHandlerFunc(func(params GetGreetingParams) middleware.Responder { return middleware.NotImplemented("operation GetGreeting has not yet been implemented") }), } }
go
func NewGreeterAPI(spec *loads.Document) *GreeterAPI { return &GreeterAPI{ handlers: make(map[string]map[string]http.Handler), formats: strfmt.Default, defaultConsumes: "application/json", defaultProduces: "application/json", customConsumers: make(map[string]runtime.Consumer), customProducers: make(map[string]runtime.Producer), ServerShutdown: func() {}, spec: spec, ServeError: errors.ServeError, BasicAuthenticator: security.BasicAuth, APIKeyAuthenticator: security.APIKeyAuth, BearerAuthenticator: security.BearerAuth, JSONConsumer: runtime.JSONConsumer(), TxtProducer: runtime.TextProducer(), GetGreetingHandler: GetGreetingHandlerFunc(func(params GetGreetingParams) middleware.Responder { return middleware.NotImplemented("operation GetGreeting has not yet been implemented") }), } }
[ "func", "NewGreeterAPI", "(", "spec", "*", "loads", ".", "Document", ")", "*", "GreeterAPI", "{", "return", "&", "GreeterAPI", "{", "handlers", ":", "make", "(", "map", "[", "string", "]", "map", "[", "string", "]", "http", ".", "Handler", ")", ",", ...
// NewGreeterAPI creates a new Greeter instance
[ "NewGreeterAPI", "creates", "a", "new", "Greeter", "instance" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/tutorials/custom-server/gen/restapi/operations/greeter_api.go#L24-L44
157,958
go-swagger/go-swagger
examples/tutorials/custom-server/gen/restapi/operations/greeter_api.go
Validate
func (o *GreeterAPI) Validate() error { var unregistered []string if o.JSONConsumer == nil { unregistered = append(unregistered, "JSONConsumer") } if o.TxtProducer == nil { unregistered = append(unregistered, "TxtProducer") } if o.GetGreetingHandler == nil { unregistered = append(unregistered, "GetGreetingHandler") } if len(unregistered) > 0 { return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) } return nil }
go
func (o *GreeterAPI) Validate() error { var unregistered []string if o.JSONConsumer == nil { unregistered = append(unregistered, "JSONConsumer") } if o.TxtProducer == nil { unregistered = append(unregistered, "TxtProducer") } if o.GetGreetingHandler == nil { unregistered = append(unregistered, "GetGreetingHandler") } if len(unregistered) > 0 { return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) } return nil }
[ "func", "(", "o", "*", "GreeterAPI", ")", "Validate", "(", ")", "error", "{", "var", "unregistered", "[", "]", "string", "\n\n", "if", "o", ".", "JSONConsumer", "==", "nil", "{", "unregistered", "=", "append", "(", "unregistered", ",", "\"", "\"", ")",...
// Validate validates the registrations in the GreeterAPI
[ "Validate", "validates", "the", "registrations", "in", "the", "GreeterAPI" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/tutorials/custom-server/gen/restapi/operations/greeter_api.go#L128-L148
157,959
go-swagger/go-swagger
examples/tutorials/custom-server/gen/restapi/operations/greeter_api.go
Context
func (o *GreeterAPI) Context() *middleware.Context { if o.context == nil { o.context = middleware.NewRoutableContext(o.spec, o, nil) } return o.context }
go
func (o *GreeterAPI) Context() *middleware.Context { if o.context == nil { o.context = middleware.NewRoutableContext(o.spec, o, nil) } return o.context }
[ "func", "(", "o", "*", "GreeterAPI", ")", "Context", "(", ")", "*", "middleware", ".", "Context", "{", "if", "o", ".", "context", "==", "nil", "{", "o", ".", "context", "=", "middleware", ".", "NewRoutableContext", "(", "o", ".", "spec", ",", "o", ...
// Context returns the middleware context for the greeter API
[ "Context", "returns", "the", "middleware", "context", "for", "the", "greeter", "API" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/tutorials/custom-server/gen/restapi/operations/greeter_api.go#L226-L232
157,960
go-swagger/go-swagger
examples/tutorials/custom-server/gen/restapi/operations/get_greeting_responses.go
WithPayload
func (o *GetGreetingOK) WithPayload(payload string) *GetGreetingOK { o.Payload = payload return o }
go
func (o *GetGreetingOK) WithPayload(payload string) *GetGreetingOK { o.Payload = payload return o }
[ "func", "(", "o", "*", "GetGreetingOK", ")", "WithPayload", "(", "payload", "string", ")", "*", "GetGreetingOK", "{", "o", ".", "Payload", "=", "payload", "\n", "return", "o", "\n", "}" ]
// WithPayload adds the payload to the get greeting o k response
[ "WithPayload", "adds", "the", "payload", "to", "the", "get", "greeting", "o", "k", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/tutorials/custom-server/gen/restapi/operations/get_greeting_responses.go#L36-L39
157,961
go-swagger/go-swagger
examples/generated/restapi/operations/user/get_user_by_name_responses.go
WithPayload
func (o *GetUserByNameOK) WithPayload(payload *models.User) *GetUserByNameOK { o.Payload = payload return o }
go
func (o *GetUserByNameOK) WithPayload(payload *models.User) *GetUserByNameOK { o.Payload = payload return o }
[ "func", "(", "o", "*", "GetUserByNameOK", ")", "WithPayload", "(", "payload", "*", "models", ".", "User", ")", "*", "GetUserByNameOK", "{", "o", ".", "Payload", "=", "payload", "\n", "return", "o", "\n", "}" ]
// WithPayload adds the payload to the get user by name o k response
[ "WithPayload", "adds", "the", "payload", "to", "the", "get", "user", "by", "name", "o", "k", "response" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/generated/restapi/operations/user/get_user_by_name_responses.go#L38-L41
157,962
go-swagger/go-swagger
examples/contributed-templates/stratoscale/restapi/configure_petstore.go
Handler
func Handler(c Config) (http.Handler, error) { h, _, err := HandlerAPI(c) return h, err }
go
func Handler(c Config) (http.Handler, error) { h, _, err := HandlerAPI(c) return h, err }
[ "func", "Handler", "(", "c", "Config", ")", "(", "http", ".", "Handler", ",", "error", ")", "{", "h", ",", "_", ",", "err", ":=", "HandlerAPI", "(", "c", ")", "\n", "return", "h", ",", "err", "\n", "}" ]
// Handler returns an http.Handler given the handler configuration // It mounts all the business logic implementers in the right routing.
[ "Handler", "returns", "an", "http", ".", "Handler", "given", "the", "handler", "configuration", "It", "mounts", "all", "the", "business", "logic", "implementers", "in", "the", "right", "routing", "." ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/contributed-templates/stratoscale/restapi/configure_petstore.go#L68-L71
157,963
go-swagger/go-swagger
examples/contributed-templates/stratoscale/restapi/configure_petstore.go
swaggerCopy
func swaggerCopy(orig json.RawMessage) json.RawMessage { c := make(json.RawMessage, len(orig)) copy(c, orig) return c }
go
func swaggerCopy(orig json.RawMessage) json.RawMessage { c := make(json.RawMessage, len(orig)) copy(c, orig) return c }
[ "func", "swaggerCopy", "(", "orig", "json", ".", "RawMessage", ")", "json", ".", "RawMessage", "{", "c", ":=", "make", "(", "json", ".", "RawMessage", ",", "len", "(", "orig", ")", ")", "\n", "copy", "(", "c", ",", "orig", ")", "\n", "return", "c",...
// swaggerCopy copies the swagger json to prevent data races in runtime
[ "swaggerCopy", "copies", "the", "swagger", "json", "to", "prevent", "data", "races", "in", "runtime" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/contributed-templates/stratoscale/restapi/configure_petstore.go#L150-L154
157,964
go-swagger/go-swagger
examples/contributed-templates/stratoscale/restapi/operations/store/order_create.go
NewOrderCreate
func NewOrderCreate(ctx *middleware.Context, handler OrderCreateHandler) *OrderCreate { return &OrderCreate{Context: ctx, Handler: handler} }
go
func NewOrderCreate(ctx *middleware.Context, handler OrderCreateHandler) *OrderCreate { return &OrderCreate{Context: ctx, Handler: handler} }
[ "func", "NewOrderCreate", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "OrderCreateHandler", ")", "*", "OrderCreate", "{", "return", "&", "OrderCreate", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}" ]
// NewOrderCreate creates a new http.Handler for the order create operation
[ "NewOrderCreate", "creates", "a", "new", "http", ".", "Handler", "for", "the", "order", "create", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/contributed-templates/stratoscale/restapi/operations/store/order_create.go#L28-L30
157,965
go-swagger/go-swagger
examples/task-tracker/restapi/operations/tasks/delete_task.go
NewDeleteTask
func NewDeleteTask(ctx *middleware.Context, handler DeleteTaskHandler) *DeleteTask { return &DeleteTask{Context: ctx, Handler: handler} }
go
func NewDeleteTask(ctx *middleware.Context, handler DeleteTaskHandler) *DeleteTask { return &DeleteTask{Context: ctx, Handler: handler} }
[ "func", "NewDeleteTask", "(", "ctx", "*", "middleware", ".", "Context", ",", "handler", "DeleteTaskHandler", ")", "*", "DeleteTask", "{", "return", "&", "DeleteTask", "{", "Context", ":", "ctx", ",", "Handler", ":", "handler", "}", "\n", "}" ]
// NewDeleteTask creates a new http.Handler for the delete task operation
[ "NewDeleteTask", "creates", "a", "new", "http", ".", "Handler", "for", "the", "delete", "task", "operation" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/task-tracker/restapi/operations/tasks/delete_task.go#L28-L30
157,966
go-swagger/go-swagger
examples/authentication/client/auth_sample_client.go
New
func New(transport runtime.ClientTransport, formats strfmt.Registry) *AuthSample { // ensure nullable parameters have default if formats == nil { formats = strfmt.Default } cli := new(AuthSample) cli.Transport = transport cli.Customers = customers.New(transport, formats) return cli }
go
func New(transport runtime.ClientTransport, formats strfmt.Registry) *AuthSample { // ensure nullable parameters have default if formats == nil { formats = strfmt.Default } cli := new(AuthSample) cli.Transport = transport cli.Customers = customers.New(transport, formats) return cli }
[ "func", "New", "(", "transport", "runtime", ".", "ClientTransport", ",", "formats", "strfmt", ".", "Registry", ")", "*", "AuthSample", "{", "// ensure nullable parameters have default", "if", "formats", "==", "nil", "{", "formats", "=", "strfmt", ".", "Default", ...
// New creates a new auth sample client
[ "New", "creates", "a", "new", "auth", "sample", "client" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/examples/authentication/client/auth_sample_client.go#L51-L63
157,967
go-swagger/go-swagger
generator/support.go
GenerateServer
func GenerateServer(name string, modelNames, operationIDs []string, opts *GenOpts) error { generator, err := newAppGenerator(name, modelNames, operationIDs, opts) if err != nil { return err } return generator.Generate() }
go
func GenerateServer(name string, modelNames, operationIDs []string, opts *GenOpts) error { generator, err := newAppGenerator(name, modelNames, operationIDs, opts) if err != nil { return err } return generator.Generate() }
[ "func", "GenerateServer", "(", "name", "string", ",", "modelNames", ",", "operationIDs", "[", "]", "string", ",", "opts", "*", "GenOpts", ")", "error", "{", "generator", ",", "err", ":=", "newAppGenerator", "(", "name", ",", "modelNames", ",", "operationIDs"...
// GenerateServer generates a server application
[ "GenerateServer", "generates", "a", "server", "application" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/generator/support.go#L39-L45
157,968
go-swagger/go-swagger
generator/support.go
GenerateSupport
func GenerateSupport(name string, modelNames, operationIDs []string, opts *GenOpts) error { generator, err := newAppGenerator(name, modelNames, operationIDs, opts) if err != nil { return err } return generator.GenerateSupport(nil) }
go
func GenerateSupport(name string, modelNames, operationIDs []string, opts *GenOpts) error { generator, err := newAppGenerator(name, modelNames, operationIDs, opts) if err != nil { return err } return generator.GenerateSupport(nil) }
[ "func", "GenerateSupport", "(", "name", "string", ",", "modelNames", ",", "operationIDs", "[", "]", "string", ",", "opts", "*", "GenOpts", ")", "error", "{", "generator", ",", "err", ":=", "newAppGenerator", "(", "name", ",", "modelNames", ",", "operationIDs...
// GenerateSupport generates the supporting files for an API
[ "GenerateSupport", "generates", "the", "supporting", "files", "for", "an", "API" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/generator/support.go#L48-L54
157,969
go-swagger/go-swagger
generator/support.go
checkPrefixAndFetchRelativePath
func checkPrefixAndFetchRelativePath(childpath string, parentpath string) (bool, string) { // Windows (local) file systems - NTFS, as well as FAT and variants // are case insensitive. cp, pp := childpath, parentpath if goruntime.GOOS == "windows" { cp = strings.ToLower(cp) pp = strings.ToLower(pp) } if strings.HasPrefix(cp, pp) { pth, err := filepath.Rel(parentpath, childpath) if err != nil { log.Fatalln(err) } return true, pth } return false, "" }
go
func checkPrefixAndFetchRelativePath(childpath string, parentpath string) (bool, string) { // Windows (local) file systems - NTFS, as well as FAT and variants // are case insensitive. cp, pp := childpath, parentpath if goruntime.GOOS == "windows" { cp = strings.ToLower(cp) pp = strings.ToLower(pp) } if strings.HasPrefix(cp, pp) { pth, err := filepath.Rel(parentpath, childpath) if err != nil { log.Fatalln(err) } return true, pth } return false, "" }
[ "func", "checkPrefixAndFetchRelativePath", "(", "childpath", "string", ",", "parentpath", "string", ")", "(", "bool", ",", "string", ")", "{", "// Windows (local) file systems - NTFS, as well as FAT and variants", "// are case insensitive.", "cp", ",", "pp", ":=", "childpat...
// 1. Checks if the child path and parent path coincide. // 2. If they do return child path relative to parent path. // 3. Everything else return false
[ "1", ".", "Checks", "if", "the", "child", "path", "and", "parent", "path", "coincide", ".", "2", ".", "If", "they", "do", "return", "child", "path", "relative", "to", "parent", "path", ".", "3", ".", "Everything", "else", "return", "false" ]
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/generator/support.go#L177-L196
157,970
go-swagger/go-swagger
generator/support.go
generateReadableSpec
func generateReadableSpec(spec []byte) string { buf := &bytes.Buffer{} for _, b := range string(spec) { if b == '`' { buf.WriteString("`+\"`\"+`") } else { buf.WriteRune(b) } } return buf.String() }
go
func generateReadableSpec(spec []byte) string { buf := &bytes.Buffer{} for _, b := range string(spec) { if b == '`' { buf.WriteString("`+\"`\"+`") } else { buf.WriteRune(b) } } return buf.String() }
[ "func", "generateReadableSpec", "(", "spec", "[", "]", "byte", ")", "string", "{", "buf", ":=", "&", "bytes", ".", "Buffer", "{", "}", "\n", "for", "_", ",", "b", ":=", "range", "string", "(", "spec", ")", "{", "if", "b", "==", "'`'", "{", "buf",...
// generateReadableSpec makes swagger json spec as a string instead of bytes // the only character that needs to be escaped is '`' symbol, since it cannot be escaped in the GO string // that is quoted as `string data`. The function doesn't care about the beginning or the ending of the // string it escapes since all data that needs to be escaped is always in the middle of the swagger spec.
[ "generateReadableSpec", "makes", "swagger", "json", "spec", "as", "a", "string", "instead", "of", "bytes", "the", "only", "character", "that", "needs", "to", "be", "escaped", "is", "symbol", "since", "it", "cannot", "be", "escaped", "in", "the", "GO", "strin...
ffefbd274717d6fa3bcca1c494487edf1f48104b
https://github.com/go-swagger/go-swagger/blob/ffefbd274717d6fa3bcca1c494487edf1f48104b/generator/support.go#L745-L755
157,971
gizak/termui
buffer.go
NewCell
func NewCell(rune rune, args ...interface{}) Cell { style := StyleClear if len(args) == 1 { style = args[0].(Style) } return Cell{ Rune: rune, Style: style, } }
go
func NewCell(rune rune, args ...interface{}) Cell { style := StyleClear if len(args) == 1 { style = args[0].(Style) } return Cell{ Rune: rune, Style: style, } }
[ "func", "NewCell", "(", "rune", "rune", ",", "args", "...", "interface", "{", "}", ")", "Cell", "{", "style", ":=", "StyleClear", "\n", "if", "len", "(", "args", ")", "==", "1", "{", "style", "=", "args", "[", "0", "]", ".", "(", "Style", ")", ...
// NewCell takes 1 to 2 arguments // 1st argument = rune // 2nd argument = optional style
[ "NewCell", "takes", "1", "to", "2", "arguments", "1st", "argument", "=", "rune", "2nd", "argument", "=", "optional", "style" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/buffer.go#L27-L36
157,972
gizak/termui
widgets/list.go
ScrollAmount
func (self *List) ScrollAmount(amount int) { if len(self.Rows)-int(self.SelectedRow) <= amount { self.SelectedRow = len(self.Rows) - 1 } else if int(self.SelectedRow)+amount < 0 { self.SelectedRow = 0 } else { self.SelectedRow += amount } }
go
func (self *List) ScrollAmount(amount int) { if len(self.Rows)-int(self.SelectedRow) <= amount { self.SelectedRow = len(self.Rows) - 1 } else if int(self.SelectedRow)+amount < 0 { self.SelectedRow = 0 } else { self.SelectedRow += amount } }
[ "func", "(", "self", "*", "List", ")", "ScrollAmount", "(", "amount", "int", ")", "{", "if", "len", "(", "self", ".", "Rows", ")", "-", "int", "(", "self", ".", "SelectedRow", ")", "<=", "amount", "{", "self", ".", "SelectedRow", "=", "len", "(", ...
// ScrollAmount scrolls by amount given. If amount is < 0, then scroll up. // There is no need to set self.topRow, as this will be set automatically when drawn, // since if the selected item is off screen then the topRow variable will change accordingly.
[ "ScrollAmount", "scrolls", "by", "amount", "given", ".", "If", "amount", "is", "<", "0", "then", "scroll", "up", ".", "There", "is", "no", "need", "to", "set", "self", ".", "topRow", "as", "this", "will", "be", "set", "automatically", "when", "drawn", ...
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/widgets/list.go#L91-L99
157,973
gizak/termui
widgets/sparkline.go
NewSparkline
func NewSparkline() *Sparkline { return &Sparkline{ TitleStyle: Theme.Sparkline.Title, LineColor: Theme.Sparkline.Line, } }
go
func NewSparkline() *Sparkline { return &Sparkline{ TitleStyle: Theme.Sparkline.Title, LineColor: Theme.Sparkline.Line, } }
[ "func", "NewSparkline", "(", ")", "*", "Sparkline", "{", "return", "&", "Sparkline", "{", "TitleStyle", ":", "Theme", ".", "Sparkline", ".", "Title", ",", "LineColor", ":", "Theme", ".", "Sparkline", ".", "Line", ",", "}", "\n", "}" ]
// NewSparkline returns a unrenderable single sparkline that needs to be added to a SparklineGroup
[ "NewSparkline", "returns", "a", "unrenderable", "single", "sparkline", "that", "needs", "to", "be", "added", "to", "a", "SparklineGroup" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/widgets/sparkline.go#L30-L35
157,974
gizak/termui
grid.go
NewCol
func NewCol(ratio float64, i ...interface{}) GridItem { _, ok := i[0].(Drawable) entry := i[0] if !ok { entry = i } return GridItem{ Type: col, Entry: entry, IsLeaf: ok, ratio: ratio, } }
go
func NewCol(ratio float64, i ...interface{}) GridItem { _, ok := i[0].(Drawable) entry := i[0] if !ok { entry = i } return GridItem{ Type: col, Entry: entry, IsLeaf: ok, ratio: ratio, } }
[ "func", "NewCol", "(", "ratio", "float64", ",", "i", "...", "interface", "{", "}", ")", "GridItem", "{", "_", ",", "ok", ":=", "i", "[", "0", "]", ".", "(", "Drawable", ")", "\n", "entry", ":=", "i", "[", "0", "]", "\n", "if", "!", "ok", "{",...
// NewCol takes a height percentage and either a widget or a Row or Column
[ "NewCol", "takes", "a", "height", "percentage", "and", "either", "a", "widget", "or", "a", "Row", "or", "Column" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/grid.go#L41-L53
157,975
gizak/termui
grid.go
NewRow
func NewRow(ratio float64, i ...interface{}) GridItem { _, ok := i[0].(Drawable) entry := i[0] if !ok { entry = i } return GridItem{ Type: row, Entry: entry, IsLeaf: ok, ratio: ratio, } }
go
func NewRow(ratio float64, i ...interface{}) GridItem { _, ok := i[0].(Drawable) entry := i[0] if !ok { entry = i } return GridItem{ Type: row, Entry: entry, IsLeaf: ok, ratio: ratio, } }
[ "func", "NewRow", "(", "ratio", "float64", ",", "i", "...", "interface", "{", "}", ")", "GridItem", "{", "_", ",", "ok", ":=", "i", "[", "0", "]", ".", "(", "Drawable", ")", "\n", "entry", ":=", "i", "[", "0", "]", "\n", "if", "!", "ok", "{",...
// NewRow takes a width percentage and either a widget or a Row or Column
[ "NewRow", "takes", "a", "width", "percentage", "and", "either", "a", "widget", "or", "a", "Row", "or", "Column" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/grid.go#L56-L68
157,976
gizak/termui
grid.go
Set
func (self *Grid) Set(entries ...interface{}) { entry := GridItem{ Type: row, Entry: entries, IsLeaf: false, ratio: 1.0, } self.setHelper(entry, 1.0, 1.0) }
go
func (self *Grid) Set(entries ...interface{}) { entry := GridItem{ Type: row, Entry: entries, IsLeaf: false, ratio: 1.0, } self.setHelper(entry, 1.0, 1.0) }
[ "func", "(", "self", "*", "Grid", ")", "Set", "(", "entries", "...", "interface", "{", "}", ")", "{", "entry", ":=", "GridItem", "{", "Type", ":", "row", ",", "Entry", ":", "entries", ",", "IsLeaf", ":", "false", ",", "ratio", ":", "1.0", ",", "}...
// Set is used to add Columns and Rows to the grid. // It recursively searches the GridItems, adding leaves to the grid and calculating the dimensions of the leaves.
[ "Set", "is", "used", "to", "add", "Columns", "and", "Rows", "to", "the", "grid", ".", "It", "recursively", "searches", "the", "GridItems", "adding", "leaves", "to", "the", "grid", "and", "calculating", "the", "dimensions", "of", "the", "leaves", "." ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/grid.go#L72-L80
157,977
gizak/termui
block.go
Draw
func (self *Block) Draw(buf *Buffer) { if self.Border { self.drawBorder(buf) } buf.SetString( self.Title, self.TitleStyle, image.Pt(self.Min.X+2, self.Min.Y), ) }
go
func (self *Block) Draw(buf *Buffer) { if self.Border { self.drawBorder(buf) } buf.SetString( self.Title, self.TitleStyle, image.Pt(self.Min.X+2, self.Min.Y), ) }
[ "func", "(", "self", "*", "Block", ")", "Draw", "(", "buf", "*", "Buffer", ")", "{", "if", "self", ".", "Border", "{", "self", ".", "drawBorder", "(", "buf", ")", "\n", "}", "\n", "buf", ".", "SetString", "(", "self", ".", "Title", ",", "self", ...
// Draw implements the Drawable interface.
[ "Draw", "implements", "the", "Drawable", "interface", "." ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/block.go#L80-L89
157,978
gizak/termui
block.go
SetRect
func (self *Block) SetRect(x1, y1, x2, y2 int) { self.Rectangle = image.Rect(x1, y1, x2, y2) self.Inner = image.Rect( self.Min.X+1+self.PaddingLeft, self.Min.Y+1+self.PaddingTop, self.Max.X-1-self.PaddingRight, self.Max.Y-1-self.PaddingBottom, ) }
go
func (self *Block) SetRect(x1, y1, x2, y2 int) { self.Rectangle = image.Rect(x1, y1, x2, y2) self.Inner = image.Rect( self.Min.X+1+self.PaddingLeft, self.Min.Y+1+self.PaddingTop, self.Max.X-1-self.PaddingRight, self.Max.Y-1-self.PaddingBottom, ) }
[ "func", "(", "self", "*", "Block", ")", "SetRect", "(", "x1", ",", "y1", ",", "x2", ",", "y2", "int", ")", "{", "self", ".", "Rectangle", "=", "image", ".", "Rect", "(", "x1", ",", "y1", ",", "x2", ",", "y2", ")", "\n", "self", ".", "Inner", ...
// SetRect implements the Drawable interface.
[ "SetRect", "implements", "the", "Drawable", "interface", "." ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/block.go#L92-L100
157,979
gizak/termui
events.go
PollEvents
func PollEvents() <-chan Event { ch := make(chan Event) go func() { for { ch <- convertTermboxEvent(tb.PollEvent()) } }() return ch }
go
func PollEvents() <-chan Event { ch := make(chan Event) go func() { for { ch <- convertTermboxEvent(tb.PollEvent()) } }() return ch }
[ "func", "PollEvents", "(", ")", "<-", "chan", "Event", "{", "ch", ":=", "make", "(", "chan", "Event", ")", "\n", "go", "func", "(", ")", "{", "for", "{", "ch", "<-", "convertTermboxEvent", "(", "tb", ".", "PollEvent", "(", ")", ")", "\n", "}", "\...
// PollEvents gets events from termbox, converts them, then sends them to each of its channels.
[ "PollEvents", "gets", "events", "from", "termbox", "converts", "them", "then", "sends", "them", "to", "each", "of", "its", "channels", "." ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/events.go#L70-L78
157,980
gizak/termui
events.go
convertTermboxKeyboardEvent
func convertTermboxKeyboardEvent(e tb.Event) Event { ID := "%s" if e.Mod == tb.ModAlt { ID = "<M-%s>" } if e.Ch != 0 { ID = fmt.Sprintf(ID, string(e.Ch)) } else { converted, ok := keyboardMap[e.Key] if !ok { converted = "" } ID = fmt.Sprintf(ID, converted) } return Event{ Type: KeyboardEvent, ID: ID, } }
go
func convertTermboxKeyboardEvent(e tb.Event) Event { ID := "%s" if e.Mod == tb.ModAlt { ID = "<M-%s>" } if e.Ch != 0 { ID = fmt.Sprintf(ID, string(e.Ch)) } else { converted, ok := keyboardMap[e.Key] if !ok { converted = "" } ID = fmt.Sprintf(ID, converted) } return Event{ Type: KeyboardEvent, ID: ID, } }
[ "func", "convertTermboxKeyboardEvent", "(", "e", "tb", ".", "Event", ")", "Event", "{", "ID", ":=", "\"", "\"", "\n", "if", "e", ".", "Mod", "==", "tb", ".", "ModAlt", "{", "ID", "=", "\"", "\"", "\n", "}", "\n\n", "if", "e", ".", "Ch", "!=", "...
// convertTermboxKeyboardEvent converts a termbox keyboard event to a more friendly string format. // Combines modifiers into the string instead of having them as additional fields in an event.
[ "convertTermboxKeyboardEvent", "converts", "a", "termbox", "keyboard", "event", "to", "a", "more", "friendly", "string", "format", ".", "Combines", "modifiers", "into", "the", "string", "instead", "of", "having", "them", "as", "additional", "fields", "in", "an", ...
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/events.go#L142-L162
157,981
gizak/termui
events.go
convertTermboxEvent
func convertTermboxEvent(e tb.Event) Event { if e.Type == tb.EventError { panic(e.Err) } switch e.Type { case tb.EventKey: return convertTermboxKeyboardEvent(e) case tb.EventMouse: return convertTermboxMouseEvent(e) case tb.EventResize: return Event{ Type: ResizeEvent, ID: "<Resize>", Payload: Resize{ Width: e.Width, Height: e.Height, }, } } return Event{} }
go
func convertTermboxEvent(e tb.Event) Event { if e.Type == tb.EventError { panic(e.Err) } switch e.Type { case tb.EventKey: return convertTermboxKeyboardEvent(e) case tb.EventMouse: return convertTermboxMouseEvent(e) case tb.EventResize: return Event{ Type: ResizeEvent, ID: "<Resize>", Payload: Resize{ Width: e.Width, Height: e.Height, }, } } return Event{} }
[ "func", "convertTermboxEvent", "(", "e", "tb", ".", "Event", ")", "Event", "{", "if", "e", ".", "Type", "==", "tb", ".", "EventError", "{", "panic", "(", "e", ".", "Err", ")", "\n", "}", "\n", "switch", "e", ".", "Type", "{", "case", "tb", ".", ...
// convertTermboxEvent turns a termbox event into a termui event.
[ "convertTermboxEvent", "turns", "a", "termbox", "event", "into", "a", "termui", "event", "." ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/events.go#L191-L211
157,982
gizak/termui
style.go
NewStyle
func NewStyle(fg Color, args ...interface{}) Style { bg := ColorClear modifier := ModifierClear if len(args) >= 1 { bg = args[0].(Color) } if len(args) == 2 { modifier = args[1].(Modifier) } return Style{ fg, bg, modifier, } }
go
func NewStyle(fg Color, args ...interface{}) Style { bg := ColorClear modifier := ModifierClear if len(args) >= 1 { bg = args[0].(Color) } if len(args) == 2 { modifier = args[1].(Modifier) } return Style{ fg, bg, modifier, } }
[ "func", "NewStyle", "(", "fg", "Color", ",", "args", "...", "interface", "{", "}", ")", "Style", "{", "bg", ":=", "ColorClear", "\n", "modifier", ":=", "ModifierClear", "\n", "if", "len", "(", "args", ")", ">=", "1", "{", "bg", "=", "args", "[", "0...
// NewStyle takes 1 to 3 arguments // 1st argument = Fg // 2nd argument = optional Bg // 3rd argument = optional Modifier
[ "NewStyle", "takes", "1", "to", "3", "arguments", "1st", "argument", "=", "Fg", "2nd", "argument", "=", "optional", "Bg", "3rd", "argument", "=", "optional", "Modifier" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/style.go#L51-L65
157,983
gizak/termui
widgets/piechart.go
NewPieChart
func NewPieChart() *PieChart { return &PieChart{ Block: *NewBlock(), Colors: Theme.PieChart.Slices, AngleOffset: piechartOffsetUp, } }
go
func NewPieChart() *PieChart { return &PieChart{ Block: *NewBlock(), Colors: Theme.PieChart.Slices, AngleOffset: piechartOffsetUp, } }
[ "func", "NewPieChart", "(", ")", "*", "PieChart", "{", "return", "&", "PieChart", "{", "Block", ":", "*", "NewBlock", "(", ")", ",", "Colors", ":", "Theme", ".", "PieChart", ".", "Slices", ",", "AngleOffset", ":", "piechartOffsetUp", ",", "}", "\n", "}...
// NewPieChart Creates a new pie chart with reasonable defaults and no labels.
[ "NewPieChart", "Creates", "a", "new", "pie", "chart", "with", "reasonable", "defaults", "and", "no", "labels", "." ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/widgets/piechart.go#L29-L35
157,984
gizak/termui
widgets/piechart.go
at
func (self circle) at(phi float64) image.Point { x := self.X + int(RoundFloat64(xStretch*self.radius*math.Cos(phi))) y := self.Y + int(RoundFloat64(self.radius*math.Sin(phi))) return image.Point{X: x, Y: y} }
go
func (self circle) at(phi float64) image.Point { x := self.X + int(RoundFloat64(xStretch*self.radius*math.Cos(phi))) y := self.Y + int(RoundFloat64(self.radius*math.Sin(phi))) return image.Point{X: x, Y: y} }
[ "func", "(", "self", "circle", ")", "at", "(", "phi", "float64", ")", "image", ".", "Point", "{", "x", ":=", "self", ".", "X", "+", "int", "(", "RoundFloat64", "(", "xStretch", "*", "self", ".", "radius", "*", "math", ".", "Cos", "(", "phi", ")",...
// computes the point at a given angle phi
[ "computes", "the", "point", "at", "a", "given", "angle", "phi" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/widgets/piechart.go#L88-L92
157,985
gizak/termui
widgets/piechart.go
draw
func (self line) draw(cell Cell, buf *Buffer) { isLeftOf := func(p1, p2 image.Point) bool { return p1.X <= p2.X } isTopOf := func(p1, p2 image.Point) bool { return p1.Y <= p2.Y } p1, p2 := self.P1, self.P2 buf.SetCell(NewCell('*', cell.Style), self.P2) width, height := self.size() if width > height { // paint left to right if !isLeftOf(p1, p2) { p1, p2 = p2, p1 } flip := 1.0 if !isTopOf(p1, p2) { flip = -1.0 } for x := p1.X; x <= p2.X; x++ { ratio := float64(height) / float64(width) factor := float64(x - p1.X) y := ratio * factor * flip buf.SetCell(cell, image.Pt(x, int(RoundFloat64(y))+p1.Y)) } } else { // paint top to bottom if !isTopOf(p1, p2) { p1, p2 = p2, p1 } flip := 1.0 if !isLeftOf(p1, p2) { flip = -1.0 } for y := p1.Y; y <= p2.Y; y++ { ratio := float64(width) / float64(height) factor := float64(y - p1.Y) x := ratio * factor * flip buf.SetCell(cell, image.Pt(int(RoundFloat64(x))+p1.X, y)) } } }
go
func (self line) draw(cell Cell, buf *Buffer) { isLeftOf := func(p1, p2 image.Point) bool { return p1.X <= p2.X } isTopOf := func(p1, p2 image.Point) bool { return p1.Y <= p2.Y } p1, p2 := self.P1, self.P2 buf.SetCell(NewCell('*', cell.Style), self.P2) width, height := self.size() if width > height { // paint left to right if !isLeftOf(p1, p2) { p1, p2 = p2, p1 } flip := 1.0 if !isTopOf(p1, p2) { flip = -1.0 } for x := p1.X; x <= p2.X; x++ { ratio := float64(height) / float64(width) factor := float64(x - p1.X) y := ratio * factor * flip buf.SetCell(cell, image.Pt(x, int(RoundFloat64(y))+p1.Y)) } } else { // paint top to bottom if !isTopOf(p1, p2) { p1, p2 = p2, p1 } flip := 1.0 if !isLeftOf(p1, p2) { flip = -1.0 } for y := p1.Y; y <= p2.Y; y++ { ratio := float64(width) / float64(height) factor := float64(y - p1.Y) x := ratio * factor * flip buf.SetCell(cell, image.Pt(int(RoundFloat64(x))+p1.X, y)) } } }
[ "func", "(", "self", "line", ")", "draw", "(", "cell", "Cell", ",", "buf", "*", "Buffer", ")", "{", "isLeftOf", ":=", "func", "(", "p1", ",", "p2", "image", ".", "Point", ")", "bool", "{", "return", "p1", ".", "X", "<=", "p2", ".", "X", "\n", ...
// draws the line
[ "draws", "the", "line" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/widgets/piechart.go#L105-L144
157,986
gizak/termui
widgets/piechart.go
size
func (self line) size() (w, h int) { return AbsInt(self.P2.X - self.P1.X), AbsInt(self.P2.Y - self.P1.Y) }
go
func (self line) size() (w, h int) { return AbsInt(self.P2.X - self.P1.X), AbsInt(self.P2.Y - self.P1.Y) }
[ "func", "(", "self", "line", ")", "size", "(", ")", "(", "w", ",", "h", "int", ")", "{", "return", "AbsInt", "(", "self", ".", "P2", ".", "X", "-", "self", ".", "P1", ".", "X", ")", ",", "AbsInt", "(", "self", ".", "P2", ".", "Y", "-", "s...
// width and height of a line
[ "width", "and", "height", "of", "a", "line" ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/widgets/piechart.go#L147-L149
157,987
gizak/termui
backend.go
Init
func Init() error { if err := tb.Init(); err != nil { return err } tb.SetInputMode(tb.InputEsc | tb.InputMouse) tb.SetOutputMode(tb.Output256) return nil }
go
func Init() error { if err := tb.Init(); err != nil { return err } tb.SetInputMode(tb.InputEsc | tb.InputMouse) tb.SetOutputMode(tb.Output256) return nil }
[ "func", "Init", "(", ")", "error", "{", "if", "err", ":=", "tb", ".", "Init", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "tb", ".", "SetInputMode", "(", "tb", ".", "InputEsc", "|", "tb", ".", "InputMouse", ")", "\...
// Init initializes termbox-go and is required to render anything. // After initialization, the library must be finalized with `Close`.
[ "Init", "initializes", "termbox", "-", "go", "and", "is", "required", "to", "render", "anything", ".", "After", "initialization", "the", "library", "must", "be", "finalized", "with", "Close", "." ]
213738dbc71cff7412f8dae6d9f27ce4c379dc38
https://github.com/gizak/termui/blob/213738dbc71cff7412f8dae6d9f27ce4c379dc38/backend.go#L13-L20
157,988
urfave/cli
altsrc/toml_file_loader.go
NewTomlSourceFromFile
func NewTomlSourceFromFile(file string) (InputSourceContext, error) { tsc := &tomlSourceContext{FilePath: file} var results tomlMap = tomlMap{} if err := readCommandToml(tsc.FilePath, &results); err != nil { return nil, fmt.Errorf("Unable to load TOML file '%s': inner error: \n'%v'", tsc.FilePath, err.Error()) } return &MapInputSource{valueMap: results.Map}, nil }
go
func NewTomlSourceFromFile(file string) (InputSourceContext, error) { tsc := &tomlSourceContext{FilePath: file} var results tomlMap = tomlMap{} if err := readCommandToml(tsc.FilePath, &results); err != nil { return nil, fmt.Errorf("Unable to load TOML file '%s': inner error: \n'%v'", tsc.FilePath, err.Error()) } return &MapInputSource{valueMap: results.Map}, nil }
[ "func", "NewTomlSourceFromFile", "(", "file", "string", ")", "(", "InputSourceContext", ",", "error", ")", "{", "tsc", ":=", "&", "tomlSourceContext", "{", "FilePath", ":", "file", "}", "\n", "var", "results", "tomlMap", "=", "tomlMap", "{", "}", "\n", "if...
// NewTomlSourceFromFile creates a new TOML InputSourceContext from a filepath.
[ "NewTomlSourceFromFile", "creates", "a", "new", "TOML", "InputSourceContext", "from", "a", "filepath", "." ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/altsrc/toml_file_loader.go#L83-L90
157,989
urfave/cli
altsrc/toml_file_loader.go
NewTomlSourceFromFlagFunc
func NewTomlSourceFromFlagFunc(flagFileName string) func(context *cli.Context) (InputSourceContext, error) { return func(context *cli.Context) (InputSourceContext, error) { filePath := context.String(flagFileName) return NewTomlSourceFromFile(filePath) } }
go
func NewTomlSourceFromFlagFunc(flagFileName string) func(context *cli.Context) (InputSourceContext, error) { return func(context *cli.Context) (InputSourceContext, error) { filePath := context.String(flagFileName) return NewTomlSourceFromFile(filePath) } }
[ "func", "NewTomlSourceFromFlagFunc", "(", "flagFileName", "string", ")", "func", "(", "context", "*", "cli", ".", "Context", ")", "(", "InputSourceContext", ",", "error", ")", "{", "return", "func", "(", "context", "*", "cli", ".", "Context", ")", "(", "In...
// NewTomlSourceFromFlagFunc creates a new TOML InputSourceContext from a provided flag name and source context.
[ "NewTomlSourceFromFlagFunc", "creates", "a", "new", "TOML", "InputSourceContext", "from", "a", "provided", "flag", "name", "and", "source", "context", "." ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/altsrc/toml_file_loader.go#L93-L98
157,990
urfave/cli
altsrc/json_source_context.go
NewJSONSourceFromFlagFunc
func NewJSONSourceFromFlagFunc(flag string) func(c *cli.Context) (InputSourceContext, error) { return func(context *cli.Context) (InputSourceContext, error) { return NewJSONSourceFromFile(context.String(flag)) } }
go
func NewJSONSourceFromFlagFunc(flag string) func(c *cli.Context) (InputSourceContext, error) { return func(context *cli.Context) (InputSourceContext, error) { return NewJSONSourceFromFile(context.String(flag)) } }
[ "func", "NewJSONSourceFromFlagFunc", "(", "flag", "string", ")", "func", "(", "c", "*", "cli", ".", "Context", ")", "(", "InputSourceContext", ",", "error", ")", "{", "return", "func", "(", "context", "*", "cli", ".", "Context", ")", "(", "InputSourceConte...
// NewJSONSourceFromFlagFunc returns a func that takes a cli.Context // and returns an InputSourceContext suitable for retrieving config // variables from a file containing JSON data with the file name defined // by the given flag.
[ "NewJSONSourceFromFlagFunc", "returns", "a", "func", "that", "takes", "a", "cli", ".", "Context", "and", "returns", "an", "InputSourceContext", "suitable", "for", "retrieving", "config", "variables", "from", "a", "file", "containing", "JSON", "data", "with", "the"...
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/altsrc/json_source_context.go#L18-L22
157,991
urfave/cli
altsrc/json_source_context.go
NewJSONSourceFromReader
func NewJSONSourceFromReader(r io.Reader) (InputSourceContext, error) { data, err := ioutil.ReadAll(r) if err != nil { return nil, err } return NewJSONSource(data) }
go
func NewJSONSourceFromReader(r io.Reader) (InputSourceContext, error) { data, err := ioutil.ReadAll(r) if err != nil { return nil, err } return NewJSONSource(data) }
[ "func", "NewJSONSourceFromReader", "(", "r", "io", ".", "Reader", ")", "(", "InputSourceContext", ",", "error", ")", "{", "data", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "r", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "e...
// NewJSONSourceFromReader returns an InputSourceContext suitable for // retrieving config variables from an io.Reader that returns JSON data.
[ "NewJSONSourceFromReader", "returns", "an", "InputSourceContext", "suitable", "for", "retrieving", "config", "variables", "from", "an", "io", ".", "Reader", "that", "returns", "JSON", "data", "." ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/altsrc/json_source_context.go#L37-L43
157,992
urfave/cli
altsrc/json_source_context.go
NewJSONSource
func NewJSONSource(data []byte) (InputSourceContext, error) { var deserialized map[string]interface{} if err := json.Unmarshal(data, &deserialized); err != nil { return nil, err } return &jsonSource{deserialized: deserialized}, nil }
go
func NewJSONSource(data []byte) (InputSourceContext, error) { var deserialized map[string]interface{} if err := json.Unmarshal(data, &deserialized); err != nil { return nil, err } return &jsonSource{deserialized: deserialized}, nil }
[ "func", "NewJSONSource", "(", "data", "[", "]", "byte", ")", "(", "InputSourceContext", ",", "error", ")", "{", "var", "deserialized", "map", "[", "string", "]", "interface", "{", "}", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "data", ","...
// NewJSONSource returns an InputSourceContext suitable for retrieving // config variables from raw JSON data.
[ "NewJSONSource", "returns", "an", "InputSourceContext", "suitable", "for", "retrieving", "config", "variables", "from", "raw", "JSON", "data", "." ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/altsrc/json_source_context.go#L47-L53
157,993
urfave/cli
altsrc/json_source_context.go
BoolT
func (x *jsonSource) BoolT(name string) (bool, error) { return false, fmt.Errorf("unsupported type BoolT for JSONSource") }
go
func (x *jsonSource) BoolT(name string) (bool, error) { return false, fmt.Errorf("unsupported type BoolT for JSONSource") }
[ "func", "(", "x", "*", "jsonSource", ")", "BoolT", "(", "name", "string", ")", "(", "bool", ",", "error", ")", "{", "return", "false", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}" ]
// since this source appears to require all configuration to be specified, the // concept of a boolean defaulting to true seems inconsistent with no defaults
[ "since", "this", "source", "appears", "to", "require", "all", "configuration", "to", "be", "specified", "the", "concept", "of", "a", "boolean", "defaulting", "to", "true", "seems", "inconsistent", "with", "no", "defaults" ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/altsrc/json_source_context.go#L180-L182
157,994
urfave/cli
help.go
ShowAppHelpAndExit
func ShowAppHelpAndExit(c *Context, exitCode int) { ShowAppHelp(c) os.Exit(exitCode) }
go
func ShowAppHelpAndExit(c *Context, exitCode int) { ShowAppHelp(c) os.Exit(exitCode) }
[ "func", "ShowAppHelpAndExit", "(", "c", "*", "Context", ",", "exitCode", "int", ")", "{", "ShowAppHelp", "(", "c", ")", "\n", "os", ".", "Exit", "(", "exitCode", ")", "\n", "}" ]
// ShowAppHelpAndExit - Prints the list of subcommands for the app and exits with exit code.
[ "ShowAppHelpAndExit", "-", "Prints", "the", "list", "of", "subcommands", "for", "the", "app", "and", "exits", "with", "exit", "code", "." ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/help.go#L132-L135
157,995
urfave/cli
help.go
ShowAppHelp
func ShowAppHelp(c *Context) (err error) { if c.App.CustomAppHelpTemplate == "" { HelpPrinter(c.App.Writer, AppHelpTemplate, c.App) return } customAppData := func() map[string]interface{} { if c.App.ExtraInfo == nil { return nil } return map[string]interface{}{ "ExtraInfo": c.App.ExtraInfo, } } HelpPrinterCustom(c.App.Writer, c.App.CustomAppHelpTemplate, c.App, customAppData()) return nil }
go
func ShowAppHelp(c *Context) (err error) { if c.App.CustomAppHelpTemplate == "" { HelpPrinter(c.App.Writer, AppHelpTemplate, c.App) return } customAppData := func() map[string]interface{} { if c.App.ExtraInfo == nil { return nil } return map[string]interface{}{ "ExtraInfo": c.App.ExtraInfo, } } HelpPrinterCustom(c.App.Writer, c.App.CustomAppHelpTemplate, c.App, customAppData()) return nil }
[ "func", "ShowAppHelp", "(", "c", "*", "Context", ")", "(", "err", "error", ")", "{", "if", "c", ".", "App", ".", "CustomAppHelpTemplate", "==", "\"", "\"", "{", "HelpPrinter", "(", "c", ".", "App", ".", "Writer", ",", "AppHelpTemplate", ",", "c", "."...
// ShowAppHelp is an action that displays the help.
[ "ShowAppHelp", "is", "an", "action", "that", "displays", "the", "help", "." ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/help.go#L138-L153
157,996
urfave/cli
help.go
DefaultAppComplete
func DefaultAppComplete(c *Context) { for _, command := range c.App.Commands { if command.Hidden { continue } if os.Getenv("_CLI_ZSH_AUTOCOMPLETE_HACK") == "1" { for _, name := range command.Names() { fmt.Fprintf(c.App.Writer, "%s:%s\n", name, command.Usage) } } else { for _, name := range command.Names() { fmt.Fprintf(c.App.Writer, "%s\n", name) } } } }
go
func DefaultAppComplete(c *Context) { for _, command := range c.App.Commands { if command.Hidden { continue } if os.Getenv("_CLI_ZSH_AUTOCOMPLETE_HACK") == "1" { for _, name := range command.Names() { fmt.Fprintf(c.App.Writer, "%s:%s\n", name, command.Usage) } } else { for _, name := range command.Names() { fmt.Fprintf(c.App.Writer, "%s\n", name) } } } }
[ "func", "DefaultAppComplete", "(", "c", "*", "Context", ")", "{", "for", "_", ",", "command", ":=", "range", "c", ".", "App", ".", "Commands", "{", "if", "command", ".", "Hidden", "{", "continue", "\n", "}", "\n", "if", "os", ".", "Getenv", "(", "\...
// DefaultAppComplete prints the list of subcommands as the default app completion method
[ "DefaultAppComplete", "prints", "the", "list", "of", "subcommands", "as", "the", "default", "app", "completion", "method" ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/help.go#L156-L171
157,997
urfave/cli
help.go
ShowCommandHelpAndExit
func ShowCommandHelpAndExit(c *Context, command string, code int) { ShowCommandHelp(c, command) os.Exit(code) }
go
func ShowCommandHelpAndExit(c *Context, command string, code int) { ShowCommandHelp(c, command) os.Exit(code) }
[ "func", "ShowCommandHelpAndExit", "(", "c", "*", "Context", ",", "command", "string", ",", "code", "int", ")", "{", "ShowCommandHelp", "(", "c", ",", "command", ")", "\n", "os", ".", "Exit", "(", "code", ")", "\n", "}" ]
// ShowCommandHelpAndExit - exits with code after showing help
[ "ShowCommandHelpAndExit", "-", "exits", "with", "code", "after", "showing", "help" ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/help.go#L174-L177
157,998
urfave/cli
help.go
ShowCommandHelp
func ShowCommandHelp(ctx *Context, command string) error { // show the subcommand help for a command with subcommands if command == "" { HelpPrinter(ctx.App.Writer, SubcommandHelpTemplate, ctx.App) return nil } for _, c := range ctx.App.Commands { if c.HasName(command) { if c.CustomHelpTemplate != "" { HelpPrinterCustom(ctx.App.Writer, c.CustomHelpTemplate, c, nil) } else { HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c) } return nil } } if ctx.App.CommandNotFound == nil { return NewExitError(fmt.Sprintf("No help topic for '%v'", command), 3) } ctx.App.CommandNotFound(ctx, command) return nil }
go
func ShowCommandHelp(ctx *Context, command string) error { // show the subcommand help for a command with subcommands if command == "" { HelpPrinter(ctx.App.Writer, SubcommandHelpTemplate, ctx.App) return nil } for _, c := range ctx.App.Commands { if c.HasName(command) { if c.CustomHelpTemplate != "" { HelpPrinterCustom(ctx.App.Writer, c.CustomHelpTemplate, c, nil) } else { HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c) } return nil } } if ctx.App.CommandNotFound == nil { return NewExitError(fmt.Sprintf("No help topic for '%v'", command), 3) } ctx.App.CommandNotFound(ctx, command) return nil }
[ "func", "ShowCommandHelp", "(", "ctx", "*", "Context", ",", "command", "string", ")", "error", "{", "// show the subcommand help for a command with subcommands", "if", "command", "==", "\"", "\"", "{", "HelpPrinter", "(", "ctx", ".", "App", ".", "Writer", ",", "...
// ShowCommandHelp prints help for the given command
[ "ShowCommandHelp", "prints", "help", "for", "the", "given", "command" ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/help.go#L180-L204
157,999
urfave/cli
help.go
ShowCompletions
func ShowCompletions(c *Context) { a := c.App if a != nil && a.BashComplete != nil { a.BashComplete(c) } }
go
func ShowCompletions(c *Context) { a := c.App if a != nil && a.BashComplete != nil { a.BashComplete(c) } }
[ "func", "ShowCompletions", "(", "c", "*", "Context", ")", "{", "a", ":=", "c", ".", "App", "\n", "if", "a", "!=", "nil", "&&", "a", ".", "BashComplete", "!=", "nil", "{", "a", ".", "BashComplete", "(", "c", ")", "\n", "}", "\n", "}" ]
// ShowCompletions prints the lists of commands within a given context
[ "ShowCompletions", "prints", "the", "lists", "of", "commands", "within", "a", "given", "context" ]
693af58b4d51b8fcc7f9d89576da170765980581
https://github.com/urfave/cli/blob/693af58b4d51b8fcc7f9d89576da170765980581/help.go#L221-L226