MCPcopy Index your code
hub / github.com/perkeep/perkeep / appConfig

Function appConfig

app/scanningcabinet/handler.go:71–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69}
70
71func appConfig() (*extraConfig, error) {
72 configURL := os.Getenv("CAMLI_APP_CONFIG_URL")
73 if configURL == "" {
74 logf("CAMLI_APP_CONFIG_URL not defined, the app will run without any auth")
75 return nil, nil
76 }
77 cl, err := app.Client()
78 if err != nil {
79 return nil, fmt.Errorf("could not get a client to fetch extra config: %v", err)
80 }
81 conf := &extraConfig{}
82 if err := cl.GetJSON(context.Background(), configURL, conf); err != nil {
83 return nil, fmt.Errorf("could not get app extra config at %v: %v", configURL, err)
84 }
85 return conf, nil
86}
87
88type handler struct {
89 httpsCert string

Callers 1

newHandlerFunction · 0.70

Calls 2

ClientFunction · 0.92
GetJSONMethod · 0.65

Tested by

no test coverage detected