MCPcopy Create free account
hub / github.com/algolia/cli / GetApplicationID

Method GetApplicationID

pkg/config/profile.go:40–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40func (p *Profile) GetApplicationID() (string, error) {
41 if os.Getenv("ALGOLIA_APPLICATION_ID") != "" {
42 return os.Getenv("ALGOLIA_APPLICATION_ID"), nil
43 }
44
45 if p.ApplicationID != "" {
46 return p.ApplicationID, nil
47 }
48
49 if p.Name == "" {
50 p.LoadDefault()
51 }
52
53 if err := viper.ReadInConfig(); err == nil {
54 appID := viper.GetString(p.GetFieldName("application_id"))
55 if appID != "" {
56 return appID, nil
57 }
58 }
59
60 return "", ErrApplicationIDNotConfigured
61}
62
63func (p *Profile) GetAPIKey() (string, error) {
64 if os.Getenv("ALGOLIA_API_KEY") != "" {

Callers 10

CheckAuthFunction · 0.80
searchClientFunction · 0.80
compositionClientFunction · 0.80
runOpenCmdFunction · 0.80
resolveScopeMethod · 0.80
ExecuteFunction · 0.80
changePlanFunction · 0.80
runUpdateCmdFunction · 0.80
runTailCmdFunction · 0.80

Calls 2

LoadDefaultMethod · 0.95
GetFieldNameMethod · 0.95

Tested by

no test coverage detected