Documentation ¶
Index ¶
Constants ¶
View Source
const ( // AuthTypeNone use for disable auth AuthTypeNone = "none" // AuthTypeBasic use for basic auth AuthTypeBasic = "basic" // AuthTypeBearer use for bearer token auth AuthTypeBearer = "bearer" // AuthTypeCustom use for custom auth AuthTypeCustom = "custom" )
consts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthBasicConfig ¶
type AuthBasicConfig struct { // Login for basic auth Login string `json:"login" yaml:"login" hcl:"login"` // Password for basic auth Password string `json:"password" yaml:"password" hcl:"password"` }
AuthBasicConfig is basic auth config
type AuthBearerConfig ¶
type AuthBearerConfig struct { // Token for bearer auth Token string `json:"token" yaml:"token" hcl:"token"` }
AuthBearerConfig is bearer auth config
type AuthConfig ¶
type AuthConfig struct { AuthBasicConfig AuthBearerConfig AuthCustomConfig // Type of the auth Type string `json:"type" yaml:"type" hcl:"type"` }
AuthConfig for requests with auth
func (AuthConfig) Validate ¶
func (cfg AuthConfig) Validate() error
Validate checks the authorization configuration.
type AuthCustomConfig ¶
type AuthCustomConfig struct { // TODO (negasus): remove Headers in favor of cfg.Headers option // Headers is request headers Headers map[string]string `json:"headers" yaml:"headers" hcl:"headers,optional"` // QueryParams is query params QueryParams map[string]string `json:"queryParams" yaml:"queryParams" hcl:"queryParams,optional"` }
AuthCustomConfig is custom auth config
type PayloadConfig ¶
type PayloadConfig struct { QueryParams map[string]string `json:"queryParams" yaml:"queryParams" hcl:"queryParams,optional"` Body string `json:"body" yaml:"body" hcl:"body,optional"` }
PayloadConfig for POST requests
type Settings ¶
type Settings struct { URL string `json:"url" yaml:"url" hcl:"url"` Method string `json:"method" yaml:"method" hcl:"method"` Auth *AuthConfig `json:"auth" yaml:"auth" hcl:"auth,block"` Payload PayloadConfig `json:"payload" yaml:"payload" hcl:"payload,block"` Timeout int `json:"timeout" yaml:"timeout" hcl:"timeout,optional"` Headers map[string]string `json:"headers" yaml:"headers" hcl:"headers,optional"` }
Settings for webhook config
Click to show internal directories.
Click to hide internal directories.