MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / Channel

Function Channel

pkg/question/selectors/channels.go:14–27  ·  view source on GitHub ↗
(octopus *octopusApiClient.Client, ask question.Asker, io io.Writer, questionText string, project *projects.Project)

Source from the content-addressed store, hash-verified

12)
13
14func Channel(octopus *octopusApiClient.Client, ask question.Asker, io io.Writer, questionText string, project *projects.Project) (*channels.Channel, error) {
15 existingChannels, err := octopus.Projects.GetChannels(project)
16 if len(existingChannels) == 1 {
17 fmt.Fprintf(io, "Selecting only available channel '%s'.\n", output.Cyan(existingChannels[0].Name))
18 return existingChannels[0], nil
19 }
20 if err != nil {
21 return nil, err
22 }
23
24 return question.SelectMap(ask, questionText, existingChannels, func(p *channels.Channel) string {
25 return p.Name
26 })
27}
28
29func FindChannel(octopus *octopusApiClient.Client, project *projects.Project, channelName string) (*channels.Channel, error) {
30 foundChannels, err := octopus.Projects.GetChannels(project) // TODO change this to channel partial name search on server; will require go client update

Callers 2

AskQuestionsFunction · 0.92
AskQuestionsFunction · 0.92

Calls 2

CyanFunction · 0.92
SelectMapFunction · 0.92

Tested by

no test coverage detected