MCPcopy Create free account
hub / github.com/facebook/time / FetchUsedChannels

Method FetchUsedChannels

calnex/api/api.go:687–705  ·  view source on GitHub ↗

FetchUsedChannels returns list of channels in use

()

Source from the content-addressed store, hash-verified

685}
686
687// FetchUsedChannels returns list of channels in use
688func (a *API) FetchUsedChannels() ([]Channel, error) {
689 channels := []Channel{}
690 f, err := a.FetchSettings()
691 if err != nil {
692 return channels, err
693 }
694 for ch := range MeasureChannelDatatypeMap {
695 chInstalled := f.Section("measure").Key(fmt.Sprintf("%s\\installed", ch.CalnexAPI())).String()
696 if chInstalled != "1" {
697 continue
698 }
699
700 chStatus := f.Section("measure").Key(fmt.Sprintf("%s\\used", ch.CalnexAPI())).String()
701 if chStatus == "Yes" {
702 channels = append(channels, ch)
703 }
704 }
705 return channels, err
706}
707
708// FetchSettings returns the calnex settings

Callers 2

TestFetchUsedChannelsFunction · 0.95
ExportFunction · 0.95

Calls 3

FetchSettingsMethod · 0.95
StringMethod · 0.45
CalnexAPIMethod · 0.45

Tested by 1

TestFetchUsedChannelsFunction · 0.76