Open myrho opened 3 years ago
Hello, I can't figure out how to setup a credentials file. I'm a complete go newbie. This is my main.go:
main.go
package main import ( "github.com/danielgtaylor/openapi-cli-generator/cli" "github.com/danielgtaylor/openapi-cli-generator/apikey" ) func main() { cli.Init(&cli.Config{ AppName: "example", EnvPrefix: "EXAMPLE", Version: "1.0.0", }) exampleRegister(false) apikey.Init("Authorization", apikey.LocationHeader) cli.Creds.Set("profiles.default.api_key", "mykey") cli.Root.Execute() }
This works, but the api key is hardcorded. Where and how should I define the key in the credentials file? I've tried:
./.example/config.json:
./.example/config.json
{ "example": { "profiles": { "default": { "api_key": "mykey" } } } }
Any help is appreciated!
Hello, I can't figure out how to setup a credentials file. I'm a complete go newbie. This is my
main.go
:This works, but the api key is hardcorded. Where and how should I define the key in the credentials file? I've tried:
./.example/config.json
:Any help is appreciated!