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
143,700
beamly/go-gocd
cli/encrypt.go
encryptCommand
func encryptCommand() *cli.Command { return &cli.Command{ Name: EncryptCommandName, Usage: EncryptCommandUsage, Action: ActionWrapper(encryptAction), Category: "Encryption", Flags: []cli.Flag{ cli.StringFlag{Name: "value"}, }, } }
go
func encryptCommand() *cli.Command { return &cli.Command{ Name: EncryptCommandName, Usage: EncryptCommandUsage, Action: ActionWrapper(encryptAction), Category: "Encryption", Flags: []cli.Flag{ cli.StringFlag{Name: "value"}, }, } }
[ "func", "encryptCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "EncryptCommandName", ",", "Usage", ":", "EncryptCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "encryptAction", ")", ",", ...
// EncryptCommand checks a template-name is provided and that the response is a 2xx response.
[ "EncryptCommand", "checks", "a", "template", "-", "name", "is", "provided", "and", "that", "the", "response", "is", "a", "2xx", "response", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/encrypt.go#L26-L36
143,701
beamly/go-gocd
gocd/pipelinegroups.go
List
func (pgs *PipelineGroupsService) List(ctx context.Context, name string) (*PipelineGroups, *APIResponse, error) { pg := []*PipelineGroup{} _, resp, err := pgs.client.getAction(ctx, &APIClientRequest{ Path: "config/pipeline_groups", ResponseType: responseTypeJSON, ResponseBody: &pg, }) filtered := Pi...
go
func (pgs *PipelineGroupsService) List(ctx context.Context, name string) (*PipelineGroups, *APIResponse, error) { pg := []*PipelineGroup{} _, resp, err := pgs.client.getAction(ctx, &APIClientRequest{ Path: "config/pipeline_groups", ResponseType: responseTypeJSON, ResponseBody: &pg, }) filtered := Pi...
[ "func", "(", "pgs", "*", "PipelineGroupsService", ")", "List", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "*", "PipelineGroups", ",", "*", "APIResponse", ",", "error", ")", "{", "pg", ":=", "[", "]", "*", "PipelineGroup", "...
// List Pipeline groups
[ "List", "Pipeline", "groups" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelinegroups.go#L18-L39
143,702
beamly/go-gocd
cli/agent.go
listAgentsAction
func listAgentsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { agents, resp, err := client.Agents.List(context.Background()) if err == nil { for _, agent := range agents { agent.RemoveLinks() } } return agents, resp, err }
go
func listAgentsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { agents, resp, err := client.Agents.List(context.Background()) if err == nil { for _, agent := range agents { agent.RemoveLinks() } } return agents, resp, err }
[ "func", "listAgentsAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "agents", ",", "resp", "...
// ListAgentsAction gets a list of agents and return them.
[ "ListAgentsAction", "gets", "a", "list", "of", "agents", "and", "return", "them", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L29-L37
143,703
beamly/go-gocd
cli/agent.go
getAgentAction
func getAgentAction(client *gocd.Client, c *cli.Context) (v interface{}, resp *gocd.APIResponse, err error) { agent, r, err := client.Agents.Get(context.Background(), c.String("uuid")) if r.HTTP.StatusCode != 404 { agent.RemoveLinks() } return agent, r, err }
go
func getAgentAction(client *gocd.Client, c *cli.Context) (v interface{}, resp *gocd.APIResponse, err error) { agent, r, err := client.Agents.Get(context.Background(), c.String("uuid")) if r.HTTP.StatusCode != 404 { agent.RemoveLinks() } return agent, r, err }
[ "func", "getAgentAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "v", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "agent", ",", "r", ",", ...
// GetAgentAction retrieves a single agent object.
[ "GetAgentAction", "retrieves", "a", "single", "agent", "object", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L40-L46
143,704
beamly/go-gocd
cli/agent.go
updateAgentAction
func updateAgentAction(client *gocd.Client, c *cli.Context) (v interface{}, resp *gocd.APIResponse, err error) { if c.String("uuid") == "" { return nil, nil, NewFlagError("uuid") } if c.String("config") == "" { return nil, nil, NewFlagError("config") } a := &gocd.Agent{} b := []byte(c.String("config")) if...
go
func updateAgentAction(client *gocd.Client, c *cli.Context) (v interface{}, resp *gocd.APIResponse, err error) { if c.String("uuid") == "" { return nil, nil, NewFlagError("uuid") } if c.String("config") == "" { return nil, nil, NewFlagError("config") } a := &gocd.Agent{} b := []byte(c.String("config")) if...
[ "func", "updateAgentAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "v", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "if", "c", ".", "String...
// UpdateAgentAction updates a single agent.
[ "UpdateAgentAction", "updates", "a", "single", "agent", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L49-L66
143,705
beamly/go-gocd
cli/agent.go
updateAgentsAction
func updateAgentsAction(client *gocd.Client, c *cli.Context) (v interface{}, resp *gocd.APIResponse, err error) { u := gocd.AgentBulkUpdate{} if o := c.String("operations"); o != "" { b := []byte(o) op := gocd.AgentBulkOperationsUpdate{} if err := json.Unmarshal(b, &op); err != nil { return nil, nil, err ...
go
func updateAgentsAction(client *gocd.Client, c *cli.Context) (v interface{}, resp *gocd.APIResponse, err error) { u := gocd.AgentBulkUpdate{} if o := c.String("operations"); o != "" { b := []byte(o) op := gocd.AgentBulkOperationsUpdate{} if err := json.Unmarshal(b, &op); err != nil { return nil, nil, err ...
[ "func", "updateAgentsAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "v", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "u", ":=", "gocd", "."...
// UpdateAgentsAction updates a single agent.
[ "UpdateAgentsAction", "updates", "a", "single", "agent", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L82-L109
143,706
beamly/go-gocd
cli/agent.go
deleteAgentsAction
func deleteAgentsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return nil, nil, nil }
go
func deleteAgentsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return nil, nil, nil }
[ "func", "deleteAgentsAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "return", "nil", ",", ...
// DeleteAgentsAction must be implemented.
[ "DeleteAgentsAction", "must", "be", "implemented", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L112-L114
143,707
beamly/go-gocd
cli/agent.go
listAgentsCommand
func listAgentsCommand() *cli.Command { return &cli.Command{ Name: ListAgentsCommandName, Usage: ListAgentsCommandUsage, Action: ActionWrapper(listAgentsAction), Category: agentCategory, } }
go
func listAgentsCommand() *cli.Command { return &cli.Command{ Name: ListAgentsCommandName, Usage: ListAgentsCommandUsage, Action: ActionWrapper(listAgentsAction), Category: agentCategory, } }
[ "func", "listAgentsCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "ListAgentsCommandName", ",", "Usage", ":", "ListAgentsCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "listAgentsAction", ...
// ListAgentsCommand checks a template-name is provided and that the response is a 2xx response.
[ "ListAgentsCommand", "checks", "a", "template", "-", "name", "is", "provided", "and", "that", "the", "response", "is", "a", "2xx", "response", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L117-L124
143,708
beamly/go-gocd
cli/agent.go
getAgentCommand
func getAgentCommand() *cli.Command { return &cli.Command{ Name: GetAgentCommandName, Usage: GetAgentCommandUsage, Action: ActionWrapper(getAgentAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringFlag{Name: "uuid, u", Usage: "GoCD Agent UUID"}, }, } }
go
func getAgentCommand() *cli.Command { return &cli.Command{ Name: GetAgentCommandName, Usage: GetAgentCommandUsage, Action: ActionWrapper(getAgentAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringFlag{Name: "uuid, u", Usage: "GoCD Agent UUID"}, }, } }
[ "func", "getAgentCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "GetAgentCommandName", ",", "Usage", ":", "GetAgentCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "getAgentAction", ")", "...
// GetAgentCommand handles the interaction between the cli flags and the action handler for get-agent
[ "GetAgentCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "get", "-", "agent" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L127-L137
143,709
beamly/go-gocd
cli/agent.go
updateAgentCommand
func updateAgentCommand() *cli.Command { return &cli.Command{ Name: UpdateAgentCommandName, Usage: UpdateAgentCommandUsage, Action: ActionWrapper(updateAgentAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringFlag{Name: "uuid, u", Usage: "GoCD Agent UUID"}, cli.StringFlag{Name: "con...
go
func updateAgentCommand() *cli.Command { return &cli.Command{ Name: UpdateAgentCommandName, Usage: UpdateAgentCommandUsage, Action: ActionWrapper(updateAgentAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringFlag{Name: "uuid, u", Usage: "GoCD Agent UUID"}, cli.StringFlag{Name: "con...
[ "func", "updateAgentCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "UpdateAgentCommandName", ",", "Usage", ":", "UpdateAgentCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "updateAgentAction"...
// UpdateAgentCommand handles the interaction between the cli flags and the action handler for update-agent
[ "UpdateAgentCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "update", "-", "agent" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L140-L151
143,710
beamly/go-gocd
cli/agent.go
deleteAgentCommand
func deleteAgentCommand() *cli.Command { return &cli.Command{ Name: DeleteAgentCommandName, Usage: DeleteAgentCommandUsage, Action: ActionWrapper(deleteAgentAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringFlag{Name: "uuid, u", Usage: "GoCD Agent UUID"}, }, } }
go
func deleteAgentCommand() *cli.Command { return &cli.Command{ Name: DeleteAgentCommandName, Usage: DeleteAgentCommandUsage, Action: ActionWrapper(deleteAgentAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringFlag{Name: "uuid, u", Usage: "GoCD Agent UUID"}, }, } }
[ "func", "deleteAgentCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "DeleteAgentCommandName", ",", "Usage", ":", "DeleteAgentCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "deleteAgentAction"...
// DeleteAgentCommand handles the interaction between the cli flags and the action handler for delete-agent
[ "DeleteAgentCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "delete", "-", "agent" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L154-L164
143,711
beamly/go-gocd
cli/agent.go
updateAgentsCommand
func updateAgentsCommand() *cli.Command { return &cli.Command{ Name: UpdateAgentsCommandName, Usage: UpdateAgentsCommandUsage, Action: ActionWrapper(updateAgentsAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringSliceFlag{Name: "uuid", Usage: "GoCD Agent UUIDs"}, cli.StringFlag{Nam...
go
func updateAgentsCommand() *cli.Command { return &cli.Command{ Name: UpdateAgentsCommandName, Usage: UpdateAgentsCommandUsage, Action: ActionWrapper(updateAgentsAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringSliceFlag{Name: "uuid", Usage: "GoCD Agent UUIDs"}, cli.StringFlag{Nam...
[ "func", "updateAgentsCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "UpdateAgentsCommandName", ",", "Usage", ":", "UpdateAgentsCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "updateAgentsAct...
// UpdateAgentsCommand handles the interaction between the cli flags and the action handler for update-agents
[ "UpdateAgentsCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "update", "-", "agents" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L167-L179
143,712
beamly/go-gocd
cli/agent.go
deleteAgentsCommand
func deleteAgentsCommand() *cli.Command { return &cli.Command{ Name: DeleteAgentsCommandName, Usage: DeleteAgentsCommandUsage, Action: ActionWrapper(deleteAgentsAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringSliceFlag{Name: "uuid", Usage: "GoCD Agent UUIDs"}, }, } }
go
func deleteAgentsCommand() *cli.Command { return &cli.Command{ Name: DeleteAgentsCommandName, Usage: DeleteAgentsCommandUsage, Action: ActionWrapper(deleteAgentsAction), Category: agentCategory, Flags: []cli.Flag{ cli.StringSliceFlag{Name: "uuid", Usage: "GoCD Agent UUIDs"}, }, } }
[ "func", "deleteAgentsCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "DeleteAgentsCommandName", ",", "Usage", ":", "DeleteAgentsCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "deleteAgentsAct...
// DeleteAgentsCommand handles the interaction between the cli flags and the action handler for delete-agents
[ "DeleteAgentsCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "delete", "-", "agents" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/agent.go#L182-L192
143,713
beamly/go-gocd
cli/pipelinegroup.go
listPipelineGroupsAction
func listPipelineGroupsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.PipelineGroups.List(context.Background(), c.String("group-name")) }
go
func listPipelineGroupsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.PipelineGroups.List(context.Background(), c.String("group-name")) }
[ "func", "listPipelineGroupsAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "return", "client", ...
// ListPipelineGroupsAction handles the interaction between the cli flags and the action handler for // list-pipeline-groups
[ "ListPipelineGroupsAction", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "list", "-", "pipeline", "-", "groups" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinegroup.go#L17-L19
143,714
beamly/go-gocd
cli/pipelinegroup.go
listPipelineGroupsCommand
func listPipelineGroupsCommand() *cli.Command { return &cli.Command{ Name: ListPipelineGroupsCommandName, Usage: ListPipelineGroupsCommandUsage, Action: ActionWrapper(listPipelineGroupsAction), Category: "Pipeline Groups", Flags: []cli.Flag{ cli.StringFlag{Name: "group-name"}, }, } }
go
func listPipelineGroupsCommand() *cli.Command { return &cli.Command{ Name: ListPipelineGroupsCommandName, Usage: ListPipelineGroupsCommandUsage, Action: ActionWrapper(listPipelineGroupsAction), Category: "Pipeline Groups", Flags: []cli.Flag{ cli.StringFlag{Name: "group-name"}, }, } }
[ "func", "listPipelineGroupsCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "ListPipelineGroupsCommandName", ",", "Usage", ":", "ListPipelineGroupsCommandUsage", ",", "Action", ":", "ActionWrapper", "(", ...
// ListPipelineGroupsCommand handles the interaction between the cli flags and the action handler for // list-pipeline-groups
[ "ListPipelineGroupsCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "list", "-", "pipeline", "-", "groups" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinegroup.go#L23-L33
143,715
beamly/go-gocd
gocd/resource_pipeline_material_p4.go
unmarshallMaterialAttributesP4
func unmarshallMaterialAttributesP4(mp4 *MaterialAttributesP4, i map[string]interface{}) { for key, value := range i { if value == nil { continue } switch key { case "name": mp4.Name = value.(string) case "port": mp4.Port = value.(string) case "use_tickets": mp4.UseTickets = value.(bool) case...
go
func unmarshallMaterialAttributesP4(mp4 *MaterialAttributesP4, i map[string]interface{}) { for key, value := range i { if value == nil { continue } switch key { case "name": mp4.Name = value.(string) case "port": mp4.Port = value.(string) case "use_tickets": mp4.UseTickets = value.(bool) case...
[ "func", "unmarshallMaterialAttributesP4", "(", "mp4", "*", "MaterialAttributesP4", ",", "i", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "for", "key", ",", "value", ":=", "range", "i", "{", "if", "value", "==", "nil", "{", "continue", "\n...
// UnmarshallInterface from a JSON string to a MaterialAttributesP4 struct
[ "UnmarshallInterface", "from", "a", "JSON", "string", "to", "a", "MaterialAttributesP4", "struct" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material_p4.go#L36-L66
143,716
beamly/go-gocd
gocd/resource_task.go
Validate
func (t *Task) Validate() error { switch t.Type { case "": return errors.New("Missing `gocd.TaskAttribute` type") case "exec": return t.Attributes.ValidateExec() case "ant": return t.Attributes.ValidateAnt() default: return errors.New("Unexpected `gocd.Task.Attribute` types") } }
go
func (t *Task) Validate() error { switch t.Type { case "": return errors.New("Missing `gocd.TaskAttribute` type") case "exec": return t.Attributes.ValidateExec() case "ant": return t.Attributes.ValidateAnt() default: return errors.New("Unexpected `gocd.Task.Attribute` types") } }
[ "func", "(", "t", "*", "Task", ")", "Validate", "(", ")", "error", "{", "switch", "t", ".", "Type", "{", "case", "\"", "\"", ":", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "case", "\"", "\"", ":", "return", "t", ".", "Attribut...
// Validate each of the possible task types.
[ "Validate", "each", "of", "the", "possible", "task", "types", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_task.go#L6-L17
143,717
beamly/go-gocd
gocd/resource_server_version.go
GetAPIVersion
func (sv *ServerVersion) GetAPIVersion(endpoint string) (apiVersion string, err error) { if versions, hasEndpoint := serverVersionLookup.GetEndpointOk(endpoint); hasEndpoint { return versions.GetAPIVersion(sv.VersionParts) } return "", fmt.Errorf("could not find API version tag for '%s'", endpoint) }
go
func (sv *ServerVersion) GetAPIVersion(endpoint string) (apiVersion string, err error) { if versions, hasEndpoint := serverVersionLookup.GetEndpointOk(endpoint); hasEndpoint { return versions.GetAPIVersion(sv.VersionParts) } return "", fmt.Errorf("could not find API version tag for '%s'", endpoint) }
[ "func", "(", "sv", "*", "ServerVersion", ")", "GetAPIVersion", "(", "endpoint", "string", ")", "(", "apiVersion", "string", ",", "err", "error", ")", "{", "if", "versions", ",", "hasEndpoint", ":=", "serverVersionLookup", ".", "GetEndpointOk", "(", "endpoint",...
// GetAPIVersion for a given endpoint and method
[ "GetAPIVersion", "for", "a", "given", "endpoint", "and", "method" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_server_version.go#L53-L60
143,718
beamly/go-gocd
gocd/resource_server_version.go
Equal
func (sv *ServerVersion) Equal(v *ServerVersion) bool { return sv.Version == v.Version }
go
func (sv *ServerVersion) Equal(v *ServerVersion) bool { return sv.Version == v.Version }
[ "func", "(", "sv", "*", "ServerVersion", ")", "Equal", "(", "v", "*", "ServerVersion", ")", "bool", "{", "return", "sv", ".", "Version", "==", "v", ".", "Version", "\n", "}" ]
// Equal if the two versions are identical
[ "Equal", "if", "the", "two", "versions", "are", "identical" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_server_version.go#L68-L70
143,719
beamly/go-gocd
gocd/resource_server_version.go
LessThan
func (sv *ServerVersion) LessThan(v *ServerVersion) bool { return sv.VersionParts.LessThan(v.VersionParts) }
go
func (sv *ServerVersion) LessThan(v *ServerVersion) bool { return sv.VersionParts.LessThan(v.VersionParts) }
[ "func", "(", "sv", "*", "ServerVersion", ")", "LessThan", "(", "v", "*", "ServerVersion", ")", "bool", "{", "return", "sv", ".", "VersionParts", ".", "LessThan", "(", "v", ".", "VersionParts", ")", "\n", "}" ]
// LessThan compares this server version and determines if it is older than the provided server version
[ "LessThan", "compares", "this", "server", "version", "and", "determines", "if", "it", "is", "older", "than", "the", "provided", "server", "version" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_server_version.go#L73-L75
143,720
beamly/go-gocd
gocd/resource_server_version.go
GetAPIVersion
func (c *serverAPIVersionMappingCollection) GetAPIVersion(versionParts *version.Version) (apiVersion string, err error) { c.Sort() lastMapping := c.mappings[0] // If the minimum version specified is too high or absent, no use to go further if lastMapping == nil || lastMapping.Server.GreaterThan(versionParts) { r...
go
func (c *serverAPIVersionMappingCollection) GetAPIVersion(versionParts *version.Version) (apiVersion string, err error) { c.Sort() lastMapping := c.mappings[0] // If the minimum version specified is too high or absent, no use to go further if lastMapping == nil || lastMapping.Server.GreaterThan(versionParts) { r...
[ "func", "(", "c", "*", "serverAPIVersionMappingCollection", ")", "GetAPIVersion", "(", "versionParts", "*", "version", ".", "Version", ")", "(", "apiVersion", "string", ",", "err", "error", ")", "{", "c", ".", "Sort", "(", ")", "\n\n", "lastMapping", ":=", ...
// GetAPIVersion for the highest common version
[ "GetAPIVersion", "for", "the", "highest", "common", "version" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_server_version.go#L126-L141
143,721
beamly/go-gocd
gocd/resource_server_version.go
Less
func (c *serverAPIVersionMappingCollection) Less(i, j int) bool { return c.mappings[i].Server.LessThan(c.mappings[j].Server) }
go
func (c *serverAPIVersionMappingCollection) Less(i, j int) bool { return c.mappings[i].Server.LessThan(c.mappings[j].Server) }
[ "func", "(", "c", "*", "serverAPIVersionMappingCollection", ")", "Less", "(", "i", ",", "j", "int", ")", "bool", "{", "return", "c", ".", "mappings", "[", "i", "]", ".", "Server", ".", "LessThan", "(", "c", ".", "mappings", "[", "j", "]", ".", "Ser...
// Less compares two server versions to see which is lower.
[ "Less", "compares", "two", "server", "versions", "to", "see", "which", "is", "lower", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_server_version.go#L154-L156
143,722
beamly/go-gocd
gocd/resource_server_version.go
Swap
func (c *serverAPIVersionMappingCollection) Swap(i, j int) { c.mappings[i], c.mappings[j] = c.mappings[j], c.mappings[i] }
go
func (c *serverAPIVersionMappingCollection) Swap(i, j int) { c.mappings[i], c.mappings[j] = c.mappings[j], c.mappings[i] }
[ "func", "(", "c", "*", "serverAPIVersionMappingCollection", ")", "Swap", "(", "i", ",", "j", "int", ")", "{", "c", ".", "mappings", "[", "i", "]", ",", "c", ".", "mappings", "[", "j", "]", "=", "c", ".", "mappings", "[", "j", "]", ",", "c", "."...
// Swap the position of two server versions.
[ "Swap", "the", "position", "of", "two", "server", "versions", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_server_version.go#L159-L161
143,723
beamly/go-gocd
gocd/authentication.go
Login
func (c *Client) Login(ctx context.Context) (err error) { var req *APIRequest var resp *APIResponse req, err = c.NewRequest("GET", "api/agents", nil, apiV2) if err != nil { return } req.HTTP.SetBasicAuth(c.params.Username, c.params.Password) resp, err = c.Do(ctx, req, nil, responseTypeJSON) if err == nil { ...
go
func (c *Client) Login(ctx context.Context) (err error) { var req *APIRequest var resp *APIResponse req, err = c.NewRequest("GET", "api/agents", nil, apiV2) if err != nil { return } req.HTTP.SetBasicAuth(c.params.Username, c.params.Password) resp, err = c.Do(ctx, req, nil, responseTypeJSON) if err == nil { ...
[ "func", "(", "c", "*", "Client", ")", "Login", "(", "ctx", "context", ".", "Context", ")", "(", "err", "error", ")", "{", "var", "req", "*", "APIRequest", "\n", "var", "resp", "*", "APIResponse", "\n\n", "req", ",", "err", "=", "c", ".", "NewReques...
// Login sends basic auth to the GoCD Server and sets an auth cookie in the client to enable cookie based auth // for future requests.
[ "Login", "sends", "basic", "auth", "to", "the", "GoCD", "Server", "and", "sets", "an", "auth", "cookie", "in", "the", "client", "to", "enable", "cookie", "based", "auth", "for", "future", "requests", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/authentication.go#L7-L22
143,724
beamly/go-gocd
cli/environment.go
listEnvironmentsAction
func listEnvironmentsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { es, resp, err := client.Environments.List(context.Background()) if err == nil { es.RemoveLinks() } return es, resp, err }
go
func listEnvironmentsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { es, resp, err := client.Environments.List(context.Background()) if err == nil { es.RemoveLinks() } return es, resp, err }
[ "func", "listEnvironmentsAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "es", ",", "resp", ...
// ListEnvironmentsAction handles the listing of environments
[ "ListEnvironmentsAction", "handles", "the", "listing", "of", "environments" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/environment.go#L28-L34
143,725
beamly/go-gocd
cli/environment.go
getEnvironmentAction
func getEnvironmentAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name string if name = c.String("name"); name == "" { return nil, nil, NewFlagError("name") } e, resp, err := client.Environments.Get(context.Background(), name) if err == nil { e.RemoveLinks(...
go
func getEnvironmentAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name string if name = c.String("name"); name == "" { return nil, nil, NewFlagError("name") } e, resp, err := client.Environments.Get(context.Background(), name) if err == nil { e.RemoveLinks(...
[ "func", "getEnvironmentAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "var", "name", "string...
// GetEnvironmentAction handles the retrieval of environments
[ "GetEnvironmentAction", "handles", "the", "retrieval", "of", "environments" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/environment.go#L37-L47
143,726
beamly/go-gocd
cli/environment.go
patchEnvironmentAction
func patchEnvironmentAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name string if name = c.String("name"); name == "" { return nil, nil, NewFlagError("name") } jsonString := c.String("json") jsonFile := c.String("json-file") if jsonString == "" && jsonFil...
go
func patchEnvironmentAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name string if name = c.String("name"); name == "" { return nil, nil, NewFlagError("name") } jsonString := c.String("json") jsonFile := c.String("json-file") if jsonString == "" && jsonFil...
[ "func", "patchEnvironmentAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "var", "name", "stri...
// patchEnvironmentAction handles the patching of an environment
[ "patchEnvironmentAction", "handles", "the", "patching", "of", "an", "environment" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/environment.go#L50-L84
143,727
beamly/go-gocd
cli/environment.go
addPipelinesToEnvironmentAction
func addPipelinesToEnvironmentAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var environment, pipelines string if environment = c.String("environment-name"); environment == "" { return nil, nil, NewFlagError("environment-name") } if pipelines = c.String("pipeline...
go
func addPipelinesToEnvironmentAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var environment, pipelines string if environment = c.String("environment-name"); environment == "" { return nil, nil, NewFlagError("environment-name") } if pipelines = c.String("pipeline...
[ "func", "addPipelinesToEnvironmentAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "var", "envir...
// AddPipelinesToEnvironmentAction handles the adding of a pipeline to an environment
[ "AddPipelinesToEnvironmentAction", "handles", "the", "adding", "of", "a", "pipeline", "to", "an", "environment" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/environment.go#L87-L107
143,728
beamly/go-gocd
cli/environment.go
listEnvironmentsCommand
func listEnvironmentsCommand() *cli.Command { return &cli.Command{ Name: ListEnvironmentsCommandName, Usage: ListEnvironmentsCommandUsage, Action: ActionWrapper(listEnvironmentsAction), Category: "Environments", } }
go
func listEnvironmentsCommand() *cli.Command { return &cli.Command{ Name: ListEnvironmentsCommandName, Usage: ListEnvironmentsCommandUsage, Action: ActionWrapper(listEnvironmentsAction), Category: "Environments", } }
[ "func", "listEnvironmentsCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "ListEnvironmentsCommandName", ",", "Usage", ":", "ListEnvironmentsCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "lis...
// ListEnvironmentsCommand handles definition of cli command
[ "ListEnvironmentsCommand", "handles", "definition", "of", "cli", "command" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/environment.go#L132-L139
143,729
beamly/go-gocd
cli/environment.go
addPipelinesToEnvironmentCommand
func addPipelinesToEnvironmentCommand() *cli.Command { return &cli.Command{ Name: AddPipelinesToEnvironmentCommandName, Usage: AddPipelinesToEnvironmentCommandUsage, Action: ActionWrapper(addPipelinesToEnvironmentAction), Category: "Environments", Flags: []cli.Flag{ cli.StringFlag{Name: "environm...
go
func addPipelinesToEnvironmentCommand() *cli.Command { return &cli.Command{ Name: AddPipelinesToEnvironmentCommandName, Usage: AddPipelinesToEnvironmentCommandUsage, Action: ActionWrapper(addPipelinesToEnvironmentAction), Category: "Environments", Flags: []cli.Flag{ cli.StringFlag{Name: "environm...
[ "func", "addPipelinesToEnvironmentCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "AddPipelinesToEnvironmentCommandName", ",", "Usage", ":", "AddPipelinesToEnvironmentCommandUsage", ",", "Action", ":", "Ac...
// AddPipelinesToEnvironmentCommand handles definition of cli command
[ "AddPipelinesToEnvironmentCommand", "handles", "definition", "of", "cli", "command" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/environment.go#L170-L184
143,730
beamly/go-gocd
cli/environment.go
removePipelinesFromEnvironmentCommand
func removePipelinesFromEnvironmentCommand() *cli.Command { return &cli.Command{ Name: RemovePipelinesFromEnvironmentCommandName, Usage: RemovePipelinesFromEnvironmentCommandUsage, Action: ActionWrapper(removePipelinesFromEnvironmentAction), Category: "Environments", Flags: []cli.Flag{ cli.String...
go
func removePipelinesFromEnvironmentCommand() *cli.Command { return &cli.Command{ Name: RemovePipelinesFromEnvironmentCommandName, Usage: RemovePipelinesFromEnvironmentCommandUsage, Action: ActionWrapper(removePipelinesFromEnvironmentAction), Category: "Environments", Flags: []cli.Flag{ cli.String...
[ "func", "removePipelinesFromEnvironmentCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "RemovePipelinesFromEnvironmentCommandName", ",", "Usage", ":", "RemovePipelinesFromEnvironmentCommandUsage", ",", "Action...
// RemovePipelinesFromEnvironmentCommand handles definition of cli command
[ "RemovePipelinesFromEnvironmentCommand", "handles", "definition", "of", "cli", "command" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/environment.go#L187-L203
143,731
beamly/go-gocd
gocd/jobs_validation.go
ValidateExec
func (t *TaskAttributes) ValidateExec() error { if len(t.RunIf) == 0 { return errors.New("'run_if' must not be empty") } if t.Command == "" { return errors.New("'command' must not be empty") } if len(t.Arguments) == 0 { return errors.New("'arguments' must not be empty") } if t.WorkingDirectory == "" { re...
go
func (t *TaskAttributes) ValidateExec() error { if len(t.RunIf) == 0 { return errors.New("'run_if' must not be empty") } if t.Command == "" { return errors.New("'command' must not be empty") } if len(t.Arguments) == 0 { return errors.New("'arguments' must not be empty") } if t.WorkingDirectory == "" { re...
[ "func", "(", "t", "*", "TaskAttributes", ")", "ValidateExec", "(", ")", "error", "{", "if", "len", "(", "t", ".", "RunIf", ")", "==", "0", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "t", ".", "Command", "=...
// ValidateExec checks that the specified values for the Task struct are correct for a cli exec task
[ "ValidateExec", "checks", "that", "the", "specified", "values", "for", "the", "Task", "struct", "are", "correct", "for", "a", "cli", "exec", "task" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/jobs_validation.go#L6-L21
143,732
beamly/go-gocd
gocd/jobs_validation.go
ValidateAnt
func (t *TaskAttributes) ValidateAnt() error { // Ensure valid attributes are set. if len(t.RunIf) == 0 { return errors.New("'run_if' must not be empty") } if t.BuildFile == "" { return errors.New("'build_file' must not be empty") } if t.Target == "" { return errors.New("'target' must not be empty") } if ...
go
func (t *TaskAttributes) ValidateAnt() error { // Ensure valid attributes are set. if len(t.RunIf) == 0 { return errors.New("'run_if' must not be empty") } if t.BuildFile == "" { return errors.New("'build_file' must not be empty") } if t.Target == "" { return errors.New("'target' must not be empty") } if ...
[ "func", "(", "t", "*", "TaskAttributes", ")", "ValidateAnt", "(", ")", "error", "{", "// Ensure valid attributes are set.", "if", "len", "(", "t", ".", "RunIf", ")", "==", "0", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n",...
// ValidateAnt checks that the specified values for the Task struct are correct for a an Ant task
[ "ValidateAnt", "checks", "that", "the", "specified", "values", "for", "the", "Task", "struct", "are", "correct", "for", "a", "an", "Ant", "task" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/jobs_validation.go#L24-L82
143,733
beamly/go-gocd
gocd/resource_pipeline_material_dependency.go
unmarshallMaterialAttributesDependency
func unmarshallMaterialAttributesDependency(mad *MaterialAttributesDependency, i map[string]interface{}) { for key, value := range i { if value == nil { continue } switch key { case "name": mad.Name = value.(string) case "pipeline": mad.Pipeline = value.(string) case "stage": mad.Stage = value....
go
func unmarshallMaterialAttributesDependency(mad *MaterialAttributesDependency, i map[string]interface{}) { for key, value := range i { if value == nil { continue } switch key { case "name": mad.Name = value.(string) case "pipeline": mad.Pipeline = value.(string) case "stage": mad.Stage = value....
[ "func", "unmarshallMaterialAttributesDependency", "(", "mad", "*", "MaterialAttributesDependency", ",", "i", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "for", "key", ",", "value", ":=", "range", "i", "{", "if", "value", "==", "nil", "{", "...
// UnmarshallInterface for a MaterialAttribute struct to be turned into a json string
[ "UnmarshallInterface", "for", "a", "MaterialAttribute", "struct", "to", "be", "turned", "into", "a", "json", "string" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material_dependency.go#L50-L66
143,734
beamly/go-gocd
gocd/role.go
Create
func (rs *RoleService) Create(ctx context.Context, role *Role) (r *Role, resp *APIResponse, err error) { r = &Role{} _, resp, err = rs.client.postAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: "admin/security/roles", RequestBody: role, ResponseBody: r, }) return }
go
func (rs *RoleService) Create(ctx context.Context, role *Role) (r *Role, resp *APIResponse, err error) { r = &Role{} _, resp, err = rs.client.postAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: "admin/security/roles", RequestBody: role, ResponseBody: r, }) return }
[ "func", "(", "rs", "*", "RoleService", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "role", "*", "Role", ")", "(", "r", "*", "Role", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "r", "=", "&", "Role", "{", "}", ...
// Create a role
[ "Create", "a", "role" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/role.go#L41-L51
143,735
beamly/go-gocd
gocd/role.go
List
func (rs *RoleService) List(ctx context.Context) (r []*Role, resp *APIResponse, err error) { wrapper := RoleListWrapper{} _, resp, err = rs.client.getAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: "admin/security/roles", ResponseBody: &wrapper, }) return wrapper.Embedded.Roles, resp, err...
go
func (rs *RoleService) List(ctx context.Context) (r []*Role, resp *APIResponse, err error) { wrapper := RoleListWrapper{} _, resp, err = rs.client.getAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: "admin/security/roles", ResponseBody: &wrapper, }) return wrapper.Embedded.Roles, resp, err...
[ "func", "(", "rs", "*", "RoleService", ")", "List", "(", "ctx", "context", ".", "Context", ")", "(", "r", "[", "]", "*", "Role", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "wrapper", ":=", "RoleListWrapper", "{", "}", "\n\n", "...
// List all roles
[ "List", "all", "roles" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/role.go#L54-L65
143,736
beamly/go-gocd
gocd/role.go
Get
func (rs *RoleService) Get(ctx context.Context, roleName string) (r *Role, resp *APIResponse, err error) { r = &Role{} _, resp, err = rs.client.getAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: fmt.Sprintf("admin/security/roles/%s", roleName), ResponseBody: r, }) return }
go
func (rs *RoleService) Get(ctx context.Context, roleName string) (r *Role, resp *APIResponse, err error) { r = &Role{} _, resp, err = rs.client.getAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: fmt.Sprintf("admin/security/roles/%s", roleName), ResponseBody: r, }) return }
[ "func", "(", "rs", "*", "RoleService", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "roleName", "string", ")", "(", "r", "*", "Role", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "r", "=", "&", "Role", "{", "}", "\n"...
// Get a single role by name
[ "Get", "a", "single", "role", "by", "name" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/role.go#L68-L77
143,737
beamly/go-gocd
gocd/role.go
Delete
func (rs *RoleService) Delete(ctx context.Context, roleName string) (result string, resp *APIResponse, err error) { return rs.client.deleteAction( ctx, fmt.Sprintf("admin/security/roles/%s", roleName), apiV1, ) }
go
func (rs *RoleService) Delete(ctx context.Context, roleName string) (result string, resp *APIResponse, err error) { return rs.client.deleteAction( ctx, fmt.Sprintf("admin/security/roles/%s", roleName), apiV1, ) }
[ "func", "(", "rs", "*", "RoleService", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "roleName", "string", ")", "(", "result", "string", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "return", "rs", ".", "client", ".", ...
// Delete a role by name
[ "Delete", "a", "role", "by", "name" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/role.go#L80-L87
143,738
beamly/go-gocd
gocd/role.go
Update
func (rs *RoleService) Update(ctx context.Context, roleName string, role *Role) ( r *Role, resp *APIResponse, err error) { r = &Role{} _, resp, err = rs.client.putAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: fmt.Sprintf("admin/security/roles/%s", roleName), ResponseBody: r, RequestBody:...
go
func (rs *RoleService) Update(ctx context.Context, roleName string, role *Role) ( r *Role, resp *APIResponse, err error) { r = &Role{} _, resp, err = rs.client.putAction(ctx, &APIClientRequest{ APIVersion: apiV1, Path: fmt.Sprintf("admin/security/roles/%s", roleName), ResponseBody: r, RequestBody:...
[ "func", "(", "rs", "*", "RoleService", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "roleName", "string", ",", "role", "*", "Role", ")", "(", "r", "*", "Role", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "r", "=", ...
// Update a role by name
[ "Update", "a", "role", "by", "name" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/role.go#L90-L102
143,739
beamly/go-gocd
gocd/resource_pipelinegroups.go
GetGroupByPipelineName
func (pg *PipelineGroups) GetGroupByPipelineName(pipelineName string) *PipelineGroup { for _, pipelineGroup := range *pg { for _, pipeline := range pipelineGroup.Pipelines { if pipeline.Name == pipelineName { return pipelineGroup } } } return nil }
go
func (pg *PipelineGroups) GetGroupByPipelineName(pipelineName string) *PipelineGroup { for _, pipelineGroup := range *pg { for _, pipeline := range pipelineGroup.Pipelines { if pipeline.Name == pipelineName { return pipelineGroup } } } return nil }
[ "func", "(", "pg", "*", "PipelineGroups", ")", "GetGroupByPipelineName", "(", "pipelineName", "string", ")", "*", "PipelineGroup", "{", "for", "_", ",", "pipelineGroup", ":=", "range", "*", "pg", "{", "for", "_", ",", "pipeline", ":=", "range", "pipelineGrou...
// GetGroupByPipelineName finds the pipeline group for the name of the pipeline supplied
[ "GetGroupByPipelineName", "finds", "the", "pipeline", "group", "for", "the", "name", "of", "the", "pipeline", "supplied" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipelinegroups.go#L4-L13
143,740
beamly/go-gocd
gocd/resource_pipelinegroups.go
GetGroupByPipeline
func (pg *PipelineGroups) GetGroupByPipeline(pipeline *Pipeline) *PipelineGroup { return pg.GetGroupByPipelineName(pipeline.Name) }
go
func (pg *PipelineGroups) GetGroupByPipeline(pipeline *Pipeline) *PipelineGroup { return pg.GetGroupByPipelineName(pipeline.Name) }
[ "func", "(", "pg", "*", "PipelineGroups", ")", "GetGroupByPipeline", "(", "pipeline", "*", "Pipeline", ")", "*", "PipelineGroup", "{", "return", "pg", ".", "GetGroupByPipelineName", "(", "pipeline", ".", "Name", ")", "\n", "}" ]
// GetGroupByPipeline finds the pipeline group for the pipeline supplied
[ "GetGroupByPipeline", "finds", "the", "pipeline", "group", "for", "the", "pipeline", "supplied" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipelinegroups.go#L16-L18
143,741
beamly/go-gocd
gocd/agent.go
List
func (s *AgentsService) List(ctx context.Context) (agents []*Agent, resp *APIResponse, err error) { r := AgentsResponse{} _, resp, err = s.client.getAction(ctx, &APIClientRequest{ Path: "agents", ResponseBody: &r, APIVersion: apiV4, }) for _, agent := range r.Embedded.Agents { agent.client = s.cl...
go
func (s *AgentsService) List(ctx context.Context) (agents []*Agent, resp *APIResponse, err error) { r := AgentsResponse{} _, resp, err = s.client.getAction(ctx, &APIClientRequest{ Path: "agents", ResponseBody: &r, APIVersion: apiV4, }) for _, agent := range r.Embedded.Agents { agent.client = s.cl...
[ "func", "(", "s", "*", "AgentsService", ")", "List", "(", "ctx", "context", ".", "Context", ")", "(", "agents", "[", "]", "*", "Agent", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "r", ":=", "AgentsResponse", "{", "}", "\n", "_"...
// List will retrieve all agents, their status, and metadata from the GoCD Server.
[ "List", "will", "retrieve", "all", "agents", "their", "status", "and", "metadata", "from", "the", "GoCD", "Server", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/agent.go#L71-L85
143,742
beamly/go-gocd
gocd/agent.go
Get
func (s *AgentsService) Get(ctx context.Context, uuid string) (*Agent, *APIResponse, error) { return s.handleAgentRequest(ctx, "GET", uuid, nil) }
go
func (s *AgentsService) Get(ctx context.Context, uuid string) (*Agent, *APIResponse, error) { return s.handleAgentRequest(ctx, "GET", uuid, nil) }
[ "func", "(", "s", "*", "AgentsService", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "uuid", "string", ")", "(", "*", "Agent", ",", "*", "APIResponse", ",", "error", ")", "{", "return", "s", ".", "handleAgentRequest", "(", "ctx", ",", "\""...
// Get will retrieve a single agent based on the provided UUID.
[ "Get", "will", "retrieve", "a", "single", "agent", "based", "on", "the", "provided", "UUID", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/agent.go#L88-L90
143,743
beamly/go-gocd
gocd/agent.go
Update
func (s *AgentsService) Update(ctx context.Context, uuid string, agent *Agent) (*Agent, *APIResponse, error) { return s.handleAgentRequest(ctx, "PATCH", uuid, agent) }
go
func (s *AgentsService) Update(ctx context.Context, uuid string, agent *Agent) (*Agent, *APIResponse, error) { return s.handleAgentRequest(ctx, "PATCH", uuid, agent) }
[ "func", "(", "s", "*", "AgentsService", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "uuid", "string", ",", "agent", "*", "Agent", ")", "(", "*", "Agent", ",", "*", "APIResponse", ",", "error", ")", "{", "return", "s", ".", "handleAgent...
// Update will modify the configuration for an existing agents.
[ "Update", "will", "modify", "the", "configuration", "for", "an", "existing", "agents", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/agent.go#L93-L95
143,744
beamly/go-gocd
gocd/agent.go
BulkUpdate
func (s *AgentsService) BulkUpdate(ctx context.Context, agents AgentBulkUpdate) (message string, resp *APIResponse, err error) { a := StringResponse{} _, resp, err = s.client.patchAction(ctx, &APIClientRequest{ Path: "agents", APIVersion: apiV4, ResponseBody: &a, RequestBody: agents, }) message =...
go
func (s *AgentsService) BulkUpdate(ctx context.Context, agents AgentBulkUpdate) (message string, resp *APIResponse, err error) { a := StringResponse{} _, resp, err = s.client.patchAction(ctx, &APIClientRequest{ Path: "agents", APIVersion: apiV4, ResponseBody: &a, RequestBody: agents, }) message =...
[ "func", "(", "s", "*", "AgentsService", ")", "BulkUpdate", "(", "ctx", "context", ".", "Context", ",", "agents", "AgentBulkUpdate", ")", "(", "message", "string", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "a", ":=", "StringResponse", ...
// BulkUpdate will change the configuration for multiple agents in a single request.
[ "BulkUpdate", "will", "change", "the", "configuration", "for", "multiple", "agents", "in", "a", "single", "request", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/agent.go#L103-L113
143,745
beamly/go-gocd
gocd/agent.go
JobRunHistory
func (s *AgentsService) JobRunHistory(ctx context.Context, uuid string) (jobs []*Job, resp *APIResponse, err error) { a := JobRunHistoryResponse{} _, resp, err = s.client.getAction(ctx, &APIClientRequest{ Path: fmt.Sprintf("agents/%s/job_run_history", uuid), APIVersion: apiV4, ResponseBody: &a, }) j...
go
func (s *AgentsService) JobRunHistory(ctx context.Context, uuid string) (jobs []*Job, resp *APIResponse, err error) { a := JobRunHistoryResponse{} _, resp, err = s.client.getAction(ctx, &APIClientRequest{ Path: fmt.Sprintf("agents/%s/job_run_history", uuid), APIVersion: apiV4, ResponseBody: &a, }) j...
[ "func", "(", "s", "*", "AgentsService", ")", "JobRunHistory", "(", "ctx", "context", ".", "Context", ",", "uuid", "string", ")", "(", "jobs", "[", "]", "*", "Job", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "a", ":=", "JobRunHist...
// JobRunHistory will return a list of Jobs run on the agent identified by `uuid`.
[ "JobRunHistory", "will", "return", "a", "list", "of", "Jobs", "run", "on", "the", "agent", "identified", "by", "uuid", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/agent.go#L116-L125
143,746
beamly/go-gocd
gocd/logging.go
getLogType
func getLogType() (logType string) { logType = os.Getenv(LogTypeEnvVarName) if len(logType) == 0 { // If no env is set, return the default logType = LogTypeDefault } return }
go
func getLogType() (logType string) { logType = os.Getenv(LogTypeEnvVarName) if len(logType) == 0 { // If no env is set, return the default logType = LogTypeDefault } return }
[ "func", "getLogType", "(", ")", "(", "logType", "string", ")", "{", "logType", "=", "os", ".", "Getenv", "(", "LogTypeEnvVarName", ")", "\n", "if", "len", "(", "logType", ")", "==", "0", "{", "// If no env is set, return the default", "logType", "=", "LogTyp...
// Get the log type from env variables
[ "Get", "the", "log", "type", "from", "env", "variables" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/logging.go#L53-L60
143,747
beamly/go-gocd
gocd/logging.go
getLogLevel
func getLogLevel() (loglevel string) { loglevel = os.Getenv(LogLevelEnvVarName) if len(loglevel) == 0 { // If no env is set, return the default loglevel = LogLevelDefault } return }
go
func getLogLevel() (loglevel string) { loglevel = os.Getenv(LogLevelEnvVarName) if len(loglevel) == 0 { // If no env is set, return the default loglevel = LogLevelDefault } return }
[ "func", "getLogLevel", "(", ")", "(", "loglevel", "string", ")", "{", "loglevel", "=", "os", ".", "Getenv", "(", "LogLevelEnvVarName", ")", "\n", "if", "len", "(", "loglevel", ")", "==", "0", "{", "// If no env is set, return the default", "loglevel", "=", "...
// Get the log level from env variables
[ "Get", "the", "log", "level", "from", "env", "variables" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/logging.go#L63-L70
143,748
beamly/go-gocd
gocd/encryption.go
Encrypt
func (es *EncryptionService) Encrypt(ctx context.Context, plaintext string) (c *CipherText, resp *APIResponse, err error) { c = &CipherText{} _, resp, err = es.client.postAction(ctx, &APIClientRequest{ Path: "admin/encrypt", ResponseBody: c, RequestBody: &map[string]string{ "value": plaintext, }, ...
go
func (es *EncryptionService) Encrypt(ctx context.Context, plaintext string) (c *CipherText, resp *APIResponse, err error) { c = &CipherText{} _, resp, err = es.client.postAction(ctx, &APIClientRequest{ Path: "admin/encrypt", ResponseBody: c, RequestBody: &map[string]string{ "value": plaintext, }, ...
[ "func", "(", "es", "*", "EncryptionService", ")", "Encrypt", "(", "ctx", "context", ".", "Context", ",", "plaintext", "string", ")", "(", "c", "*", "CipherText", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "c", "=", "&", "CipherText...
// Encrypt takes a plaintext value and returns a cipher text.
[ "Encrypt", "takes", "a", "plaintext", "value", "and", "returns", "a", "cipher", "text", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/encryption.go#L17-L30
143,749
beamly/go-gocd
gocd/resource_stage_instance.go
Validate
func (s *StageInstance) Validate() error { if s.Name == "" { return errors.New("`gocd.StageInstance.Name` is empty") } if len(s.Jobs) == 0 { return errors.New("At least one `Job` must be specified") } for _, job := range s.Jobs { if err := job.Validate(); err != nil { return err } } return nil }
go
func (s *StageInstance) Validate() error { if s.Name == "" { return errors.New("`gocd.StageInstance.Name` is empty") } if len(s.Jobs) == 0 { return errors.New("At least one `Job` must be specified") } for _, job := range s.Jobs { if err := job.Validate(); err != nil { return err } } return nil }
[ "func", "(", "s", "*", "StageInstance", ")", "Validate", "(", ")", "error", "{", "if", "s", ".", "Name", "==", "\"", "\"", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "len", "(", "s", ".", "Jobs", ")", ...
// Validate ensures the attributes attached to this structure are ready for submission to the GoCD API.
[ "Validate", "ensures", "the", "attributes", "attached", "to", "this", "structure", "are", "ready", "for", "submission", "to", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_stage_instance.go#L19-L35
143,750
beamly/go-gocd
cli/plugin.go
getPluginAction
func getPluginAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { name := c.String("name") if name == "" { return nil, nil, NewFlagError("name") } return client.Plugins.Get(context.Background(), c.String("name")) }
go
func getPluginAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { name := c.String("name") if name == "" { return nil, nil, NewFlagError("name") } return client.Plugins.Get(context.Background(), c.String("name")) }
[ "func", "getPluginAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "name", ":=", "c", ".", ...
// GetPluginAction retrieves a single plugin by name
[ "GetPluginAction", "retrieves", "a", "single", "plugin", "by", "name" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/plugin.go#L18-L25
143,751
beamly/go-gocd
cli/plugin.go
listPluginsAction
func listPluginsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Plugins.List(context.Background()) }
go
func listPluginsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Plugins.List(context.Background()) }
[ "func", "listPluginsAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "return", "client", ".", ...
// ListPluginsAction retrieves all plugin configurations
[ "ListPluginsAction", "retrieves", "all", "plugin", "configurations" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/plugin.go#L28-L30
143,752
beamly/go-gocd
cli/plugin.go
getPluginCommand
func getPluginCommand() *cli.Command { return &cli.Command{ Name: GetPluginCommandName, Usage: GetPluginCommandUsage, Category: "Plugins", Action: ActionWrapper(getPluginAction), Flags: []cli.Flag{ cli.StringFlag{Name: "name"}, }, } }
go
func getPluginCommand() *cli.Command { return &cli.Command{ Name: GetPluginCommandName, Usage: GetPluginCommandUsage, Category: "Plugins", Action: ActionWrapper(getPluginAction), Flags: []cli.Flag{ cli.StringFlag{Name: "name"}, }, } }
[ "func", "getPluginCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "GetPluginCommandName", ",", "Usage", ":", "GetPluginCommandUsage", ",", "Category", ":", "\"", "\"", ",", "Action", ":", "Action...
// GetPluginCommand Describes the cli interface for the GetPluginAction
[ "GetPluginCommand", "Describes", "the", "cli", "interface", "for", "the", "GetPluginAction" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/plugin.go#L33-L43
143,753
beamly/go-gocd
cli/plugin.go
listPluginsCommand
func listPluginsCommand() *cli.Command { return &cli.Command{ Name: ListPluginsCommandName, Usage: ListPluginsCommandUsage, Category: "Plugins", Action: ActionWrapper(listPluginsAction), } }
go
func listPluginsCommand() *cli.Command { return &cli.Command{ Name: ListPluginsCommandName, Usage: ListPluginsCommandUsage, Category: "Plugins", Action: ActionWrapper(listPluginsAction), } }
[ "func", "listPluginsCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "ListPluginsCommandName", ",", "Usage", ":", "ListPluginsCommandUsage", ",", "Category", ":", "\"", "\"", ",", "Action", ":", "...
// ListPluginsCommand Describes the cli interface for the ListPluginsCommand
[ "ListPluginsCommand", "Describes", "the", "cli", "interface", "for", "the", "ListPluginsCommand" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/plugin.go#L46-L53
143,754
beamly/go-gocd
gocd/resource_environment.go
RemoveLinks
func (er *EnvironmentsResponse) RemoveLinks() { er.Links = nil for _, env := range er.Embedded.Environments { env.RemoveLinks() } }
go
func (er *EnvironmentsResponse) RemoveLinks() { er.Links = nil for _, env := range er.Embedded.Environments { env.RemoveLinks() } }
[ "func", "(", "er", "*", "EnvironmentsResponse", ")", "RemoveLinks", "(", ")", "{", "er", ".", "Links", "=", "nil", "\n", "for", "_", ",", "env", ":=", "range", "er", ".", "Embedded", ".", "Environments", "{", "env", ".", "RemoveLinks", "(", ")", "\n"...
// RemoveLinks gets the EnvironmentsResponse ready to be submitted to the GoCD API.
[ "RemoveLinks", "gets", "the", "EnvironmentsResponse", "ready", "to", "be", "submitted", "to", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_environment.go#L4-L9
143,755
beamly/go-gocd
gocd/resource_environment.go
RemoveLinks
func (env *Environment) RemoveLinks() { env.Links = nil for _, p := range env.Pipelines { p.RemoveLinks() } for _, a := range env.Agents { a.RemoveLinks() } }
go
func (env *Environment) RemoveLinks() { env.Links = nil for _, p := range env.Pipelines { p.RemoveLinks() } for _, a := range env.Agents { a.RemoveLinks() } }
[ "func", "(", "env", "*", "Environment", ")", "RemoveLinks", "(", ")", "{", "env", ".", "Links", "=", "nil", "\n", "for", "_", ",", "p", ":=", "range", "env", ".", "Pipelines", "{", "p", ".", "RemoveLinks", "(", ")", "\n", "}", "\n", "for", "_", ...
// RemoveLinks gets the Environment ready to be submitted to the GoCD API.
[ "RemoveLinks", "gets", "the", "Environment", "ready", "to", "be", "submitted", "to", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_environment.go#L17-L25
143,756
beamly/go-gocd
cli/job.go
listScheduledJobsAction
func listScheduledJobsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Jobs.ListScheduled(context.Background()) }
go
func listScheduledJobsAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Jobs.ListScheduled(context.Background()) }
[ "func", "listScheduledJobsAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "return", "client", ...
// ListScheduledJobsAction gets a list of agents and return them.
[ "ListScheduledJobsAction", "gets", "a", "list", "of", "agents", "and", "return", "them", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/job.go#L16-L18
143,757
beamly/go-gocd
cli/job.go
listScheduledJobsCommand
func listScheduledJobsCommand() *cli.Command { return &cli.Command{ Name: ListScheduledJobsCommandName, Usage: ListScheduledJobsCommandUsage, Action: ActionWrapper(listScheduledJobsAction), Category: "Jobs", } }
go
func listScheduledJobsCommand() *cli.Command { return &cli.Command{ Name: ListScheduledJobsCommandName, Usage: ListScheduledJobsCommandUsage, Action: ActionWrapper(listScheduledJobsAction), Category: "Jobs", } }
[ "func", "listScheduledJobsCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "ListScheduledJobsCommandName", ",", "Usage", ":", "ListScheduledJobsCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "...
// ListScheduledJobsCommand provides interface between handler and action
[ "ListScheduledJobsCommand", "provides", "interface", "between", "handler", "and", "action" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/job.go#L21-L28
143,758
beamly/go-gocd
cli/role.go
listRoleAction
func listRoleAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Roles.List(context.Background()) }
go
func listRoleAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Roles.List(context.Background()) }
[ "func", "listRoleAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "return", "client", ".", "...
// ListRoleAction retrieves all role configurations
[ "ListRoleAction", "retrieves", "all", "role", "configurations" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/role.go#L77-L79
143,759
beamly/go-gocd
cli/role.go
updateRoleAction
func updateRoleAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name, version string if name = c.String("name"); name == "" { return nil, nil, NewFlagError("name") } if version = c.String("role-version"); version == "" { return nil, nil, NewFlagError("role-v...
go
func updateRoleAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name, version string if name = c.String("name"); name == "" { return nil, nil, NewFlagError("name") } if version = c.String("role-version"); version == "" { return nil, nil, NewFlagError("role-v...
[ "func", "updateRoleAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "var", "name", ",", "ver...
// UpdateRoleAction handles the interaction between the cli flags and the action handler for // update-role-action
[ "UpdateRoleAction", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "update", "-", "role", "-", "action" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/role.go#L83-L122
143,760
beamly/go-gocd
cli/configuration.go
getConfigurationAction
func getConfigurationAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Configuration.Get(context.Background()) }
go
func getConfigurationAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Configuration.Get(context.Background()) }
[ "func", "getConfigurationAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "return", "client", ...
// GetConfigurationAction gets a list of agents and return them.
[ "GetConfigurationAction", "gets", "a", "list", "of", "agents", "and", "return", "them", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/configuration.go#L18-L20
143,761
beamly/go-gocd
cli/configuration.go
getVersionAction
func getVersionAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Configuration.GetVersion(context.Background()) }
go
func getVersionAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { return client.Configuration.GetVersion(context.Background()) }
[ "func", "getVersionAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "return", "client", ".", ...
// GetVersionAction returns version information about GoCD
[ "GetVersionAction", "returns", "version", "information", "about", "GoCD" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/configuration.go#L23-L25
143,762
beamly/go-gocd
cli/configuration.go
getConfigurationCommand
func getConfigurationCommand() *cli.Command { return &cli.Command{ Name: GetConfigurationCommandName, Usage: GetConfigurationCommandUsage, Action: ActionWrapper(getConfigurationAction), Category: "Configuration", } }
go
func getConfigurationCommand() *cli.Command { return &cli.Command{ Name: GetConfigurationCommandName, Usage: GetConfigurationCommandUsage, Action: ActionWrapper(getConfigurationAction), Category: "Configuration", } }
[ "func", "getConfigurationCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "GetConfigurationCommandName", ",", "Usage", ":", "GetConfigurationCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "get...
// GetConfigurationCommand handles the interaction between the cli flags and the action handler for delete-agents
[ "GetConfigurationCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "delete", "-", "agents" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/configuration.go#L28-L35
143,763
beamly/go-gocd
cli/configuration.go
getVersionCommand
func getVersionCommand() *cli.Command { return &cli.Command{ Name: GetVersionCommandName, Usage: GetVersionCommandUsage, Action: ActionWrapper(getVersionAction), Category: "Configuration", } }
go
func getVersionCommand() *cli.Command { return &cli.Command{ Name: GetVersionCommandName, Usage: GetVersionCommandUsage, Action: ActionWrapper(getVersionAction), Category: "Configuration", } }
[ "func", "getVersionCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "GetVersionCommandName", ",", "Usage", ":", "GetVersionCommandUsage", ",", "Action", ":", "ActionWrapper", "(", "getVersionAction", ...
// GetVersionCommand handles the interaction between the cli flags and the action handler for delete-agents
[ "GetVersionCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "delete", "-", "agents" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/configuration.go#L38-L45
143,764
beamly/go-gocd
gocd/environment.go
List
func (es *EnvironmentsService) List(ctx context.Context) (e *EnvironmentsResponse, resp *APIResponse, err error) { e = &EnvironmentsResponse{} _, resp, err = es.client.getAction(ctx, &APIClientRequest{ Path: "admin/environments", ResponseBody: e, APIVersion: apiV2, }) return }
go
func (es *EnvironmentsService) List(ctx context.Context) (e *EnvironmentsResponse, resp *APIResponse, err error) { e = &EnvironmentsResponse{} _, resp, err = es.client.getAction(ctx, &APIClientRequest{ Path: "admin/environments", ResponseBody: e, APIVersion: apiV2, }) return }
[ "func", "(", "es", "*", "EnvironmentsService", ")", "List", "(", "ctx", "context", ".", "Context", ")", "(", "e", "*", "EnvironmentsResponse", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "e", "=", "&", "EnvironmentsResponse", "{", "}"...
// List all environments
[ "List", "all", "environments" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/environment.go#L51-L60
143,765
beamly/go-gocd
gocd/environment.go
Delete
func (es *EnvironmentsService) Delete(ctx context.Context, name string) (string, *APIResponse, error) { return es.client.deleteAction(ctx, "admin/environments/"+name, apiV2) }
go
func (es *EnvironmentsService) Delete(ctx context.Context, name string) (string, *APIResponse, error) { return es.client.deleteAction(ctx, "admin/environments/"+name, apiV2) }
[ "func", "(", "es", "*", "EnvironmentsService", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "string", ",", "*", "APIResponse", ",", "error", ")", "{", "return", "es", ".", "client", ".", "deleteAction", "(", "c...
// Delete an environment
[ "Delete", "an", "environment" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/environment.go#L63-L65
143,766
beamly/go-gocd
gocd/environment.go
Create
func (es *EnvironmentsService) Create(ctx context.Context, name string) (e *Environment, resp *APIResponse, err error) { _, resp, err = es.client.postAction(ctx, &APIClientRequest{ Path: "admin/environments/", RequestBody: Environment{ Name: name, }, ResponseBody: &e, APIVersion: apiV2, }) return }
go
func (es *EnvironmentsService) Create(ctx context.Context, name string) (e *Environment, resp *APIResponse, err error) { _, resp, err = es.client.postAction(ctx, &APIClientRequest{ Path: "admin/environments/", RequestBody: Environment{ Name: name, }, ResponseBody: &e, APIVersion: apiV2, }) return }
[ "func", "(", "es", "*", "EnvironmentsService", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "e", "*", "Environment", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "_", ",", "resp", ",", "err...
// Create an environment
[ "Create", "an", "environment" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/environment.go#L68-L79
143,767
beamly/go-gocd
gocd/environment.go
Get
func (es *EnvironmentsService) Get(ctx context.Context, name string) (e *Environment, resp *APIResponse, err error) { e = &Environment{} _, resp, err = es.client.getAction(ctx, &APIClientRequest{ Path: "admin/environments/" + name, ResponseBody: e, APIVersion: apiV2, }) return }
go
func (es *EnvironmentsService) Get(ctx context.Context, name string) (e *Environment, resp *APIResponse, err error) { e = &Environment{} _, resp, err = es.client.getAction(ctx, &APIClientRequest{ Path: "admin/environments/" + name, ResponseBody: e, APIVersion: apiV2, }) return }
[ "func", "(", "es", "*", "EnvironmentsService", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "e", "*", "Environment", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "e", "=", "&", "Environment", ...
// Get a single environment by name
[ "Get", "a", "single", "environment", "by", "name" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/environment.go#L82-L91
143,768
beamly/go-gocd
gocd/environment.go
Patch
func (es *EnvironmentsService) Patch(ctx context.Context, name string, patch *EnvironmentPatchRequest) (e *Environment, resp *APIResponse, err error) { e = &Environment{} _, resp, err = es.client.patchAction(ctx, &APIClientRequest{ Path: "admin/environments/" + name, RequestBody: patch, ResponseBody: e...
go
func (es *EnvironmentsService) Patch(ctx context.Context, name string, patch *EnvironmentPatchRequest) (e *Environment, resp *APIResponse, err error) { e = &Environment{} _, resp, err = es.client.patchAction(ctx, &APIClientRequest{ Path: "admin/environments/" + name, RequestBody: patch, ResponseBody: e...
[ "func", "(", "es", "*", "EnvironmentsService", ")", "Patch", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "patch", "*", "EnvironmentPatchRequest", ")", "(", "e", "*", "Environment", ",", "resp", "*", "APIResponse", ",", "err", "error"...
// Patch an environments configuration by adding or removing pipelines, agents, environment variables
[ "Patch", "an", "environments", "configuration", "by", "adding", "or", "removing", "pipelines", "agents", "environment", "variables" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/environment.go#L94-L104
143,769
beamly/go-gocd
gocd/pipelinetemplate.go
Get
func (pts *PipelineTemplatesService) Get(ctx context.Context, name string) (pt *PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates/:template_name") if err != nil { return nil, nil, err } pt = &PipelineTemplate{} _, resp, err = pts.client.getAction...
go
func (pts *PipelineTemplatesService) Get(ctx context.Context, name string) (pt *PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates/:template_name") if err != nil { return nil, nil, err } pt = &PipelineTemplate{} _, resp, err = pts.client.getAction...
[ "func", "(", "pts", "*", "PipelineTemplatesService", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "pt", "*", "PipelineTemplate", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "apiVersion", ",", "er...
// Get a single PipelineTemplate object in the GoCD API.
[ "Get", "a", "single", "PipelineTemplate", "object", "in", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelinetemplate.go#L50-L64
143,770
beamly/go-gocd
gocd/pipelinetemplate.go
List
func (pts *PipelineTemplatesService) List(ctx context.Context) (pt []*PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates") if err != nil { return nil, nil, err } ptr := PipelineTemplatesResponse{} _, resp, err = pts.client.getAction(ctx, &APIClien...
go
func (pts *PipelineTemplatesService) List(ctx context.Context) (pt []*PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates") if err != nil { return nil, nil, err } ptr := PipelineTemplatesResponse{} _, resp, err = pts.client.getAction(ctx, &APIClien...
[ "func", "(", "pts", "*", "PipelineTemplatesService", ")", "List", "(", "ctx", "context", ".", "Context", ")", "(", "pt", "[", "]", "*", "PipelineTemplate", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "apiVersion", ",", "err", ":=", ...
// List all PipelineTemplate objects in the GoCD API.
[ "List", "all", "PipelineTemplate", "objects", "in", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelinetemplate.go#L67-L82
143,771
beamly/go-gocd
gocd/pipelinetemplate.go
Create
func (pts *PipelineTemplatesService) Create(ctx context.Context, name string, st []*Stage) (ptr *PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates") if err != nil { return nil, nil, err } pt := PipelineTemplateRequest{ Name: name, Stages: st...
go
func (pts *PipelineTemplatesService) Create(ctx context.Context, name string, st []*Stage) (ptr *PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates") if err != nil { return nil, nil, err } pt := PipelineTemplateRequest{ Name: name, Stages: st...
[ "func", "(", "pts", "*", "PipelineTemplatesService", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "st", "[", "]", "*", "Stage", ")", "(", "ptr", "*", "PipelineTemplate", ",", "resp", "*", "APIResponse", ",", "err", ...
// Create a new PipelineTemplate object in the GoCD API.
[ "Create", "a", "new", "PipelineTemplate", "object", "in", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelinetemplate.go#L85-L106
143,772
beamly/go-gocd
gocd/pipelinetemplate.go
Update
func (pts *PipelineTemplatesService) Update(ctx context.Context, name string, template *PipelineTemplate) (ptr *PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates/:template_name") if err != nil { return nil, nil, err } ptr = &PipelineTemplate{} _,...
go
func (pts *PipelineTemplatesService) Update(ctx context.Context, name string, template *PipelineTemplate) (ptr *PipelineTemplate, resp *APIResponse, err error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates/:template_name") if err != nil { return nil, nil, err } ptr = &PipelineTemplate{} _,...
[ "func", "(", "pts", "*", "PipelineTemplatesService", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "template", "*", "PipelineTemplate", ")", "(", "ptr", "*", "PipelineTemplate", ",", "resp", "*", "APIResponse", ",", "err",...
// Update an PipelineTemplate object in the GoCD API.
[ "Update", "an", "PipelineTemplate", "object", "in", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelinetemplate.go#L109-L129
143,773
beamly/go-gocd
gocd/pipelinetemplate.go
Delete
func (pts *PipelineTemplatesService) Delete(ctx context.Context, name string) (string, *APIResponse, error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates/:template_name") if err != nil { return "", nil, err } return pts.client.deleteAction(ctx, fmt.Sprintf("admin/templates/%s", name), apiVe...
go
func (pts *PipelineTemplatesService) Delete(ctx context.Context, name string) (string, *APIResponse, error) { apiVersion, err := pts.client.getAPIVersion(ctx, "admin/templates/:template_name") if err != nil { return "", nil, err } return pts.client.deleteAction(ctx, fmt.Sprintf("admin/templates/%s", name), apiVe...
[ "func", "(", "pts", "*", "PipelineTemplatesService", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "string", ",", "*", "APIResponse", ",", "error", ")", "{", "apiVersion", ",", "err", ":=", "pts", ".", "client", ...
// Delete a PipelineTemplate from the GoCD API.
[ "Delete", "a", "PipelineTemplate", "from", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelinetemplate.go#L132-L139
143,774
beamly/go-gocd
gocd/resource_pipeline_material.go
Equal
func (m Material) Equal(a *Material) (isEqual bool, err error) { if m.Type != a.Type { return } return m.Attributes.equal(a.Attributes) }
go
func (m Material) Equal(a *Material) (isEqual bool, err error) { if m.Type != a.Type { return } return m.Attributes.equal(a.Attributes) }
[ "func", "(", "m", "Material", ")", "Equal", "(", "a", "*", "Material", ")", "(", "isEqual", "bool", ",", "err", "error", ")", "{", "if", "m", ".", "Type", "!=", "a", ".", "Type", "{", "return", "\n", "}", "\n\n", "return", "m", ".", "Attributes",...
// Equal is true if the two materials are logically equivalent. Not neccesarily literally equal.
[ "Equal", "is", "true", "if", "the", "two", "materials", "are", "logically", "equivalent", ".", "Not", "neccesarily", "literally", "equal", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material.go#L10-L16
143,775
beamly/go-gocd
gocd/resource_pipeline_material.go
UnmarshalJSON
func (m *Material) UnmarshalJSON(b []byte) (err error) { raw := map[string]interface{}{} if err = json.Unmarshal(b, &raw); err == nil { err = m.Ingest(raw) } return }
go
func (m *Material) UnmarshalJSON(b []byte) (err error) { raw := map[string]interface{}{} if err = json.Unmarshal(b, &raw); err == nil { err = m.Ingest(raw) } return }
[ "func", "(", "m", "*", "Material", ")", "UnmarshalJSON", "(", "b", "[", "]", "byte", ")", "(", "err", "error", ")", "{", "raw", ":=", "map", "[", "string", "]", "interface", "{", "}", "{", "}", "\n", "if", "err", "=", "json", ".", "Unmarshal", ...
// UnmarshalJSON string into a Material struct
[ "UnmarshalJSON", "string", "into", "a", "Material", "struct" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material.go#L19-L26
143,776
beamly/go-gocd
gocd/resource_pipeline_material.go
Ingest
func (m *Material) Ingest(payload map[string]interface{}) (err error) { m.IngestType(payload) for key, value := range payload { if value == nil { continue } switch key { case "attributes": err = m.IngestAttributeGenerics(value) case "fingerprint": m.Fingerprint = value.(string) case "descriptio...
go
func (m *Material) Ingest(payload map[string]interface{}) (err error) { m.IngestType(payload) for key, value := range payload { if value == nil { continue } switch key { case "attributes": err = m.IngestAttributeGenerics(value) case "fingerprint": m.Fingerprint = value.(string) case "descriptio...
[ "func", "(", "m", "*", "Material", ")", "Ingest", "(", "payload", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "err", "error", ")", "{", "m", ".", "IngestType", "(", "payload", ")", "\n\n", "for", "key", ",", "value", ":=", "range", ...
// Ingest an abstract structure
[ "Ingest", "an", "abstract", "structure" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material.go#L29-L54
143,777
beamly/go-gocd
gocd/resource_pipeline_material.go
IngestType
func (m *Material) IngestType(payload map[string]interface{}) { if mType, hasMType := payload["type"]; hasMType { m.Type = mType.(string) m.IngestAttributes(map[string]interface{}{}) } }
go
func (m *Material) IngestType(payload map[string]interface{}) { if mType, hasMType := payload["type"]; hasMType { m.Type = mType.(string) m.IngestAttributes(map[string]interface{}{}) } }
[ "func", "(", "m", "*", "Material", ")", "IngestType", "(", "payload", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "if", "mType", ",", "hasMType", ":=", "payload", "[", "\"", "\"", "]", ";", "hasMType", "{", "m", ".", "Type", "=", ...
// IngestType of Material if it is provided
[ "IngestType", "of", "Material", "if", "it", "is", "provided" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material.go#L57-L62
143,778
beamly/go-gocd
gocd/resource_pipeline_material.go
IngestAttributeGenerics
func (m *Material) IngestAttributeGenerics(i interface{}) (err error) { if v1, ok1 := i.(map[string]interface{}); ok1 { err = m.IngestAttributes(v1) } return }
go
func (m *Material) IngestAttributeGenerics(i interface{}) (err error) { if v1, ok1 := i.(map[string]interface{}); ok1 { err = m.IngestAttributes(v1) } return }
[ "func", "(", "m", "*", "Material", ")", "IngestAttributeGenerics", "(", "i", "interface", "{", "}", ")", "(", "err", "error", ")", "{", "if", "v1", ",", "ok1", ":=", "i", ".", "(", "map", "[", "string", "]", "interface", "{", "}", ")", ";", "ok1"...
// IngestAttributeGenerics to Material and perform some error checking
[ "IngestAttributeGenerics", "to", "Material", "and", "perform", "some", "error", "checking" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material.go#L65-L70
143,779
beamly/go-gocd
gocd/resource_pipeline_material.go
IngestAttributes
func (m *Material) IngestAttributes(rawAttributes map[string]interface{}) (err error) { switch strings.ToLower(m.Type) { case "git": mag := &MaterialAttributesGit{} unmarshallMaterialAttributesGit(mag, rawAttributes) m.Attributes = mag case "svn": mas := &MaterialAttributesSvn{} unmarshallMaterialAttribute...
go
func (m *Material) IngestAttributes(rawAttributes map[string]interface{}) (err error) { switch strings.ToLower(m.Type) { case "git": mag := &MaterialAttributesGit{} unmarshallMaterialAttributesGit(mag, rawAttributes) m.Attributes = mag case "svn": mas := &MaterialAttributesSvn{} unmarshallMaterialAttribute...
[ "func", "(", "m", "*", "Material", ")", "IngestAttributes", "(", "rawAttributes", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "err", "error", ")", "{", "switch", "strings", ".", "ToLower", "(", "m", ".", "Type", ")", "{", "case", "\""...
// IngestAttributes to Material from an abstract structure
[ "IngestAttributes", "to", "Material", "from", "an", "abstract", "structure" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material.go#L73-L112
143,780
beamly/go-gocd
cli/pipelinetemplate.go
listPipelineTemplatesAction
func listPipelineTemplatesAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { ts, resp, err := client.PipelineTemplates.List(context.Background()) if err != nil { return ts, resp, err } type p struct { Name string `json:"name"` } type ptr struct { Name str...
go
func listPipelineTemplatesAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { ts, resp, err := client.PipelineTemplates.List(context.Background()) if err != nil { return ts, resp, err } type p struct { Name string `json:"name"` } type ptr struct { Name str...
[ "func", "listPipelineTemplatesAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "ts", ",", "res...
// ListPipelineTemplatesAction lists all pipeline templates.
[ "ListPipelineTemplatesAction", "lists", "all", "pipeline", "templates", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L26-L54
143,781
beamly/go-gocd
cli/pipelinetemplate.go
getPipelineTemplateAction
func getPipelineTemplateAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name string if name = c.String("template-name"); name == "" { return nil, nil, NewFlagError("template-name") } pt, resp, err := client.PipelineTemplates.Get(context.Background(), name) if...
go
func getPipelineTemplateAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { var name string if name = c.String("template-name"); name == "" { return nil, nil, NewFlagError("template-name") } pt, resp, err := client.PipelineTemplates.Get(context.Background(), name) if...
[ "func", "getPipelineTemplateAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "var", "name", "s...
// GetPipelineTemplateAction checks template-name is provided, and that the response is 2xx.
[ "GetPipelineTemplateAction", "checks", "template", "-", "name", "is", "provided", "and", "that", "the", "response", "is", "2xx", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L57-L68
143,782
beamly/go-gocd
cli/pipelinetemplate.go
createPipelineTemplateAction
func createPipelineTemplateAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { if c.String("template-name") == "" { return nil, nil, NewFlagError("template-name") } if len(c.StringSlice("stage")) < 1 { return nil, nil, errors.New("At least 1 '--stage' must be set") }...
go
func createPipelineTemplateAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { if c.String("template-name") == "" { return nil, nil, NewFlagError("template-name") } if len(c.StringSlice("stage")) < 1 { return nil, nil, errors.New("At least 1 '--stage' must be set") }...
[ "func", "createPipelineTemplateAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "if", "c", "."...
// CreatePipelineTemplateAction checks stages and template-name is provided, and that the response is 2xx.
[ "CreatePipelineTemplateAction", "checks", "stages", "and", "template", "-", "name", "is", "provided", "and", "that", "the", "response", "is", "2xx", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L71-L91
143,783
beamly/go-gocd
cli/pipelinetemplate.go
updatePipelineTemplateAction
func updatePipelineTemplateAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { if c.String("template-name") == "" { return nil, nil, NewFlagError("template-name") } if c.String("template-version") == "" { return nil, nil, NewFlagError("version") } if len(c.StringSli...
go
func updatePipelineTemplateAction(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) { if c.String("template-name") == "" { return nil, nil, NewFlagError("template-name") } if c.String("template-version") == "" { return nil, nil, NewFlagError("version") } if len(c.StringSli...
[ "func", "updatePipelineTemplateAction", "(", "client", "*", "gocd", ".", "Client", ",", "c", "*", "cli", ".", "Context", ")", "(", "r", "interface", "{", "}", ",", "resp", "*", "gocd", ".", "APIResponse", ",", "err", "error", ")", "{", "if", "c", "."...
// UpdatePipelineTemplateAction checks stages, template-name and template-version is provided, and that the response is // 2xx.
[ "UpdatePipelineTemplateAction", "checks", "stages", "template", "-", "name", "and", "template", "-", "version", "is", "provided", "and", "that", "the", "response", "is", "2xx", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L95-L123
143,784
beamly/go-gocd
cli/pipelinetemplate.go
deletePipelineTemplateCommand
func deletePipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: DeletePipelineTemplateCommandName, Usage: DeletePipelineTemplateCommandUsage, Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-name", Usage: "Pipeline Template name."}}, Action: func(clie...
go
func deletePipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: DeletePipelineTemplateCommandName, Usage: DeletePipelineTemplateCommandUsage, Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-name", Usage: "Pipeline Template name."}}, Action: func(clie...
[ "func", "deletePipelineTemplateCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "DeletePipelineTemplateCommandName", ",", "Usage", ":", "DeletePipelineTemplateCommandUsage", ",", "Category", ":", "\"", "\...
// DeletePipelineTemplateCommand handles the interaction between the cli flags and the action handler for // delete-pipeline-template and checks a template-name is provided and that the response is a 2xx response.
[ "DeletePipelineTemplateCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "delete", "-", "pipeline", "-", "template", "and", "checks", "a", "template", "-", "name", "is", "provided", "and", "tha...
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L127-L146
143,785
beamly/go-gocd
cli/pipelinetemplate.go
listPipelineTemplatesCommand
func listPipelineTemplatesCommand() *cli.Command { return &cli.Command{ Name: ListPipelineTemplatesCommandName, Usage: ListPipelineTemplatesCommandUsage, Action: ActionWrapper(listPipelineTemplatesAction), Category: "Pipeline Templates", } }
go
func listPipelineTemplatesCommand() *cli.Command { return &cli.Command{ Name: ListPipelineTemplatesCommandName, Usage: ListPipelineTemplatesCommandUsage, Action: ActionWrapper(listPipelineTemplatesAction), Category: "Pipeline Templates", } }
[ "func", "listPipelineTemplatesCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "ListPipelineTemplatesCommandName", ",", "Usage", ":", "ListPipelineTemplatesCommandUsage", ",", "Action", ":", "ActionWrapper"...
// ListPipelineTemplatesCommand handles the interaction between the cli flags and the action handler for // list-pipeline-templates
[ "ListPipelineTemplatesCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "list", "-", "pipeline", "-", "templates" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L150-L157
143,786
beamly/go-gocd
cli/pipelinetemplate.go
getPipelineTemplateCommand
func getPipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: GetPipelineTemplateCommandName, Usage: GetPipelineTemplateCommandUsage, Action: ActionWrapper(getPipelineTemplateAction), Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-name", Usage: "Na...
go
func getPipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: GetPipelineTemplateCommandName, Usage: GetPipelineTemplateCommandUsage, Action: ActionWrapper(getPipelineTemplateAction), Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-name", Usage: "Na...
[ "func", "getPipelineTemplateCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "GetPipelineTemplateCommandName", ",", "Usage", ":", "GetPipelineTemplateCommandUsage", ",", "Action", ":", "ActionWrapper", "(...
// GetPipelineTemplateCommand handles the interaction between the cli flags and the action handler for // get-pipeline-template
[ "GetPipelineTemplateCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "get", "-", "pipeline", "-", "template" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L161-L171
143,787
beamly/go-gocd
cli/pipelinetemplate.go
createPipelineTemplateCommand
func createPipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: CreatePipelineTemplateCommandName, Usage: CreatePipelineTemplateCommandUsage, Action: ActionWrapper(createPipelineTemplateAction), Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-name"...
go
func createPipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: CreatePipelineTemplateCommandName, Usage: CreatePipelineTemplateCommandUsage, Action: ActionWrapper(createPipelineTemplateAction), Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-name"...
[ "func", "createPipelineTemplateCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "CreatePipelineTemplateCommandName", ",", "Usage", ":", "CreatePipelineTemplateCommandUsage", ",", "Action", ":", "ActionWrapp...
// CreatePipelineTemplateCommand handles the interaction between the cli flags and the action handler for // create-pipeline-template
[ "CreatePipelineTemplateCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "create", "-", "pipeline", "-", "template" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L175-L186
143,788
beamly/go-gocd
cli/pipelinetemplate.go
updatePipelineTemplateCommand
func updatePipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: UpdatePipelineTemplateCommandName, Usage: UpdatePipelineTemplateCommandUsage, Action: ActionWrapper(updatePipelineTemplateAction), Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-versi...
go
func updatePipelineTemplateCommand() *cli.Command { return &cli.Command{ Name: UpdatePipelineTemplateCommandName, Usage: UpdatePipelineTemplateCommandUsage, Action: ActionWrapper(updatePipelineTemplateAction), Category: "Pipeline Templates", Flags: []cli.Flag{ cli.StringFlag{Name: "template-versi...
[ "func", "updatePipelineTemplateCommand", "(", ")", "*", "cli", ".", "Command", "{", "return", "&", "cli", ".", "Command", "{", "Name", ":", "UpdatePipelineTemplateCommandName", ",", "Usage", ":", "UpdatePipelineTemplateCommandUsage", ",", "Action", ":", "ActionWrapp...
// UpdatePipelineTemplateCommand handles the interaction between the cli flags and the action handler for // update-pipeline-template
[ "UpdatePipelineTemplateCommand", "handles", "the", "interaction", "between", "the", "cli", "flags", "and", "the", "action", "handler", "for", "update", "-", "pipeline", "-", "template" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/pipelinetemplate.go#L190-L202
143,789
beamly/go-gocd
gocd/resource_pipeline_material_svn.go
unmarshallMaterialAttributesSvn
func unmarshallMaterialAttributesSvn(mas *MaterialAttributesSvn, i map[string]interface{}) { for key, value := range i { if value == nil { continue } switch key { case "name": mas.Name = value.(string) case "url": mas.URL = value.(string) case "username": mas.Username = value.(string) case "p...
go
func unmarshallMaterialAttributesSvn(mas *MaterialAttributesSvn, i map[string]interface{}) { for key, value := range i { if value == nil { continue } switch key { case "name": mas.Name = value.(string) case "url": mas.URL = value.(string) case "username": mas.Username = value.(string) case "p...
[ "func", "unmarshallMaterialAttributesSvn", "(", "mas", "*", "MaterialAttributesSvn", ",", "i", "map", "[", "string", "]", "interface", "{", "}", ")", "{", "for", "key", ",", "value", ":=", "range", "i", "{", "if", "value", "==", "nil", "{", "continue", "...
// UnmarshallInterface from a JSON string to a MaterialAttributesSvn struct
[ "UnmarshallInterface", "from", "a", "JSON", "string", "to", "a", "MaterialAttributesSvn", "struct" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/resource_pipeline_material_svn.go#L49-L77
143,790
beamly/go-gocd
gocd/gocd.go
NewClient
func NewClient(cfg *Configuration, httpClient *http.Client) *Client { httpClient = generateHttpClient(cfg, httpClient) baseURL, _ := url.Parse(cfg.Server) c := &Client{ client: httpClient, params: &ClientParameters{ BaseURL: baseURL, UserAgent: userAgent, Username: cfg.Username, Password: cfg....
go
func NewClient(cfg *Configuration, httpClient *http.Client) *Client { httpClient = generateHttpClient(cfg, httpClient) baseURL, _ := url.Parse(cfg.Server) c := &Client{ client: httpClient, params: &ClientParameters{ BaseURL: baseURL, UserAgent: userAgent, Username: cfg.Username, Password: cfg....
[ "func", "NewClient", "(", "cfg", "*", "Configuration", ",", "httpClient", "*", "http", ".", "Client", ")", "*", "Client", "{", "httpClient", "=", "generateHttpClient", "(", "cfg", ",", "httpClient", ")", "\n\n", "baseURL", ",", "_", ":=", "url", ".", "Pa...
// NewClient creates a new client based on the provided configuration payload, and optionally a custom httpClient to // allow overriding of http client structures.
[ "NewClient", "creates", "a", "new", "client", "based", "on", "the", "provided", "configuration", "payload", "and", "optionally", "a", "custom", "httpClient", "to", "allow", "overriding", "of", "http", "client", "structures", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/gocd.go#L152-L177
143,791
beamly/go-gocd
gocd/gocd.go
generateHttpClient
func generateHttpClient(cfg *Configuration, httpClient *http.Client) *http.Client { if httpClient == nil { httpClient = http.DefaultClient if strings.HasPrefix(cfg.Server, "https") && cfg.SkipSslCheck { httpClient.Transport = &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: cfg.SkipSslCheck...
go
func generateHttpClient(cfg *Configuration, httpClient *http.Client) *http.Client { if httpClient == nil { httpClient = http.DefaultClient if strings.HasPrefix(cfg.Server, "https") && cfg.SkipSslCheck { httpClient.Transport = &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: cfg.SkipSslCheck...
[ "func", "generateHttpClient", "(", "cfg", "*", "Configuration", ",", "httpClient", "*", "http", ".", "Client", ")", "*", "http", ".", "Client", "{", "if", "httpClient", "==", "nil", "{", "httpClient", "=", "http", ".", "DefaultClient", "\n", "if", "strings...
// generateHttpClient taking into account ssl, and existing httpClient
[ "generateHttpClient", "taking", "into", "account", "ssl", "and", "existing", "httpClient" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/gocd.go#L180-L190
143,792
beamly/go-gocd
gocd/gocd.go
NewRequest
func (c *Client) NewRequest(method, urlStr string, body interface{}, apiVersion string) (req *APIRequest, err error) { var rel *url.URL var buf io.ReadWriter req = &APIRequest{} // I'm not sure how to get this method to return an error intentionally for testing. For testing purposes, I've // added a switch so tha...
go
func (c *Client) NewRequest(method, urlStr string, body interface{}, apiVersion string) (req *APIRequest, err error) { var rel *url.URL var buf io.ReadWriter req = &APIRequest{} // I'm not sure how to get this method to return an error intentionally for testing. For testing purposes, I've // added a switch so tha...
[ "func", "(", "c", "*", "Client", ")", "NewRequest", "(", "method", ",", "urlStr", "string", ",", "body", "interface", "{", "}", ",", "apiVersion", "string", ")", "(", "req", "*", "APIRequest", ",", "err", "error", ")", "{", "var", "rel", "*", "url", ...
// NewRequest creates an HTTP requests to the GoCD API endpoints.
[ "NewRequest", "creates", "an", "HTTP", "requests", "to", "the", "GoCD", "API", "endpoints", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/gocd.go#L229-L292
143,793
beamly/go-gocd
gocd/gocd.go
Do
func (c *Client) Do(ctx context.Context, req *APIRequest, v interface{}, responseType string) (*APIResponse, error) { var err error var resp *http.Response req.HTTP = req.HTTP.WithContext(ctx) if resp, err = c.client.Do(req.HTTP); err != nil { return nil, err } r := &APIResponse{ Request: req, HTTP: r...
go
func (c *Client) Do(ctx context.Context, req *APIRequest, v interface{}, responseType string) (*APIResponse, error) { var err error var resp *http.Response req.HTTP = req.HTTP.WithContext(ctx) if resp, err = c.client.Do(req.HTTP); err != nil { return nil, err } r := &APIResponse{ Request: req, HTTP: r...
[ "func", "(", "c", "*", "Client", ")", "Do", "(", "ctx", "context", ".", "Context", ",", "req", "*", "APIRequest", ",", "v", "interface", "{", "}", ",", "responseType", "string", ")", "(", "*", "APIResponse", ",", "error", ")", "{", "var", "err", "e...
// Do takes an HTTP request and resposne the response from the GoCD API endpoint.
[ "Do", "takes", "an", "HTTP", "request", "and", "resposne", "the", "response", "from", "the", "GoCD", "API", "endpoint", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/gocd.go#L295-L321
143,794
beamly/go-gocd
gocd/gocd.go
CheckResponse
func CheckResponse(response *APIResponse) (err error) { if response.HTTP.StatusCode < 200 || response.HTTP.StatusCode >= 400 { errorParts := []string{ fmt.Sprintf("Received HTTP Status '%s'", response.HTTP.Status), } if message := createErrorResponseMessage(response.Body); message != "" { errorParts = app...
go
func CheckResponse(response *APIResponse) (err error) { if response.HTTP.StatusCode < 200 || response.HTTP.StatusCode >= 400 { errorParts := []string{ fmt.Sprintf("Received HTTP Status '%s'", response.HTTP.Status), } if message := createErrorResponseMessage(response.Body); message != "" { errorParts = app...
[ "func", "CheckResponse", "(", "response", "*", "APIResponse", ")", "(", "err", "error", ")", "{", "if", "response", ".", "HTTP", ".", "StatusCode", "<", "200", "||", "response", ".", "HTTP", ".", "StatusCode", ">=", "400", "{", "errorParts", ":=", "[", ...
// CheckResponse asserts that the http response status code was 2xx.
[ "CheckResponse", "asserts", "that", "the", "http", "response", "status", "code", "was", "2xx", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/gocd.go#L361-L374
143,795
beamly/go-gocd
cli/cli.go
ActionWrapper
func ActionWrapper(callback ActionWrapperFunc) interface{} { return func(c *cli.Context) error { cl := c.App.Metadata["c"].(func(c *cli.Context) (*gocd.Client, error)) client, err := cl(c.Parent()) if err != nil { return NewCliError(c.Command.Name, nil, err) } v, resp, err := callback(client, c) if err ...
go
func ActionWrapper(callback ActionWrapperFunc) interface{} { return func(c *cli.Context) error { cl := c.App.Metadata["c"].(func(c *cli.Context) (*gocd.Client, error)) client, err := cl(c.Parent()) if err != nil { return NewCliError(c.Command.Name, nil, err) } v, resp, err := callback(client, c) if err ...
[ "func", "ActionWrapper", "(", "callback", "ActionWrapperFunc", ")", "interface", "{", "}", "{", "return", "func", "(", "c", "*", "cli", ".", "Context", ")", "error", "{", "cl", ":=", "c", ".", "App", ".", "Metadata", "[", "\"", "\"", "]", ".", "(", ...
// ActionWrapper handles the deferencing, and casting of the client object, and error handling.
[ "ActionWrapper", "handles", "the", "deferencing", "and", "casting", "of", "the", "client", "object", "and", "error", "handling", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/cli/cli.go#L116-L129
143,796
beamly/go-gocd
gocd/pipelineconfig.go
Get
func (pcs *PipelineConfigsService) Get(ctx context.Context, name string) (p *Pipeline, resp *APIResponse, err error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return nil, nil, err } p = &Pipeline{} _, resp, err = pcs.client.getAction(ctx, &APIClientReq...
go
func (pcs *PipelineConfigsService) Get(ctx context.Context, name string) (p *Pipeline, resp *APIResponse, err error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return nil, nil, err } p = &Pipeline{} _, resp, err = pcs.client.getAction(ctx, &APIClientReq...
[ "func", "(", "pcs", "*", "PipelineConfigsService", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "p", "*", "Pipeline", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", "apiVersion", ",", "err", ":=",...
// Get a single Pipeline object in the GoCD API.
[ "Get", "a", "single", "Pipeline", "object", "in", "the", "GoCD", "API", "." ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelineconfig.go#L18-L33
143,797
beamly/go-gocd
gocd/pipelineconfig.go
Update
func (pcs *PipelineConfigsService) Update(ctx context.Context, name string, p *Pipeline) (pr *Pipeline, resp *APIResponse, err error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return nil, nil, err } pr = &Pipeline{} _, resp, err = pcs.client.putAction(...
go
func (pcs *PipelineConfigsService) Update(ctx context.Context, name string, p *Pipeline) (pr *Pipeline, resp *APIResponse, err error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return nil, nil, err } pr = &Pipeline{} _, resp, err = pcs.client.putAction(...
[ "func", "(", "pcs", "*", "PipelineConfigsService", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "name", "string", ",", "p", "*", "Pipeline", ")", "(", "pr", "*", "Pipeline", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{", ...
// Update a pipeline configuration
[ "Update", "a", "pipeline", "configuration" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelineconfig.go#L36-L54
143,798
beamly/go-gocd
gocd/pipelineconfig.go
Create
func (pcs *PipelineConfigsService) Create(ctx context.Context, group string, p *Pipeline) (pr *Pipeline, resp *APIResponse, err error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return nil, nil, err } pr = &Pipeline{} _, resp, err = pcs.client.postActio...
go
func (pcs *PipelineConfigsService) Create(ctx context.Context, group string, p *Pipeline) (pr *Pipeline, resp *APIResponse, err error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return nil, nil, err } pr = &Pipeline{} _, resp, err = pcs.client.postActio...
[ "func", "(", "pcs", "*", "PipelineConfigsService", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "group", "string", ",", "p", "*", "Pipeline", ")", "(", "pr", "*", "Pipeline", ",", "resp", "*", "APIResponse", ",", "err", "error", ")", "{",...
// Create a pipeline configuration
[ "Create", "a", "pipeline", "configuration" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelineconfig.go#L57-L78
143,799
beamly/go-gocd
gocd/pipelineconfig.go
Delete
func (pcs *PipelineConfigsService) Delete(ctx context.Context, name string) (string, *APIResponse, error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return "", nil, err } return pcs.client.deleteAction(ctx, "admin/pipelines/"+name, apiVersion) }
go
func (pcs *PipelineConfigsService) Delete(ctx context.Context, name string) (string, *APIResponse, error) { apiVersion, err := pcs.client.getAPIVersion(ctx, "admin/pipelines/:pipeline_name") if err != nil { return "", nil, err } return pcs.client.deleteAction(ctx, "admin/pipelines/"+name, apiVersion) }
[ "func", "(", "pcs", "*", "PipelineConfigsService", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "string", ",", "*", "APIResponse", ",", "error", ")", "{", "apiVersion", ",", "err", ":=", "pcs", ".", "client", "...
// Delete a pipeline configuration
[ "Delete", "a", "pipeline", "configuration" ]
683f1a09c81e7911e899ef194fc4dc3392505636
https://github.com/beamly/go-gocd/blob/683f1a09c81e7911e899ef194fc4dc3392505636/gocd/pipelineconfig.go#L81-L88