config

package
v0.0.0-...-4d495be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Host               = "API_INSIGHTS_HOST"
	BasePath           = "API_INSIGHTS_BASE_PATH"
	AuthType           = "API_INSIGHTS_AUTH_TYPE"
	AuthUsername       = "API_INSIGHTS_USERNAME"
	AuthPassword       = "API_INSIGHTS_PASSWORD"
	AuthBearerToken    = "API_INSIGHTS_BEARER_TOKEN"
	OAuth2GrantType    = "API_INSIGHTS_OAUTH2_GRANT_TYPE"
	OAuth2TokenURL     = "API_INSIGHTS_OAUTH2_TOKEN_URL"
	OAuth2ClientID     = "API_INSIGHTS_OAUTH2_CLIENT_ID"
	OAuth2ClientSecret = "API_INSIGHTS_OAUTH2_CLIENT_SECRET"
)

Environment Variables

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Type               string // basic, bearer-token, oauth2
	Username           string // Type: basic
	Password           string // Type: basic
	BearerToken        string // Type: bearer-token
	OAuth2GrantType    string // Type: oauth2
	OAuth2TokenURL     string // Type: oauth2, OAuth2GrantType: client_credentials
	OAuth2ClientID     string // Type: oauth2, OAuth2GrantType: client_credentials
	OAuth2ClientSecret string // Type: oauth2, OAuth2GrantType: client_credentials
}

func (AuthConfig) AuthSetter

func (cfg AuthConfig) AuthSetter(ctx context.Context, rc *resty.Client) error

type Config

type Config struct {
	APIInsightsHost     string
	APIInsightsBasePath string
	Headers             map[string]string
	AuthConfig          *AuthConfig
}

func LoadConfig

func LoadConfig() *Config

LoadConfig returns config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL