Documentation ¶
Overview ¶
Package config provides the base configuration for Axiom related functionality like URLs and credentials for API access.
Index ¶
- Variables
- func APIURL() *url.URL
- func IsAPIToken(token string) bool
- func IsPersonalToken(token string) bool
- func IsValidToken(token string) bool
- type Config
- func (c Config) BaseURL() *url.URL
- func (c *Config) IncorporateEnvironment() error
- func (c *Config) Options(options ...Option) error
- func (c Config) OrganizationID() string
- func (c *Config) SetBaseURL(baseURL *url.URL)
- func (c *Config) SetOrganizationID(organizationID string)
- func (c *Config) SetToken(token string)
- func (c Config) Token() string
- func (c Config) Validate() error
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidToken = errors.New("invalid token")
ErrInvalidToken is returned when the token is invalid.
var ErrMissingOrganizationID = errors.New("missing organization id")
ErrMissingOrganizationID is raised when an organization ID is not provided. Set it manually using the SetOrganizationID Option or export "AXIOM_ORG_ID".
var ErrMissingToken = errors.New("missing token")
ErrMissingToken is raised when a token is not provided. Set it manually using the SetToken Option or export "AXIOM_TOKEN".
Functions ¶
func IsAPIToken ¶
IsAPIToken returns true if the given token is an api token.
func IsPersonalToken ¶
IsPersonalToken returns true if the given token is a personal token.
func IsValidToken ¶
IsValidToken returns true if the given token is a valid Axiom token.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the configuration for Axiom related functionality. It should never be created manually but always via the Default function.
func (*Config) IncorporateEnvironment ¶
IncorporateEnvironment loads configuration from environment variables. It will reject invalid values.
func (Config) OrganizationID ¶
OrganizationID returns the organization ID.
func (*Config) SetBaseURL ¶
SetBaseURL sets the base URL.
func (*Config) SetOrganizationID ¶
SetOrganizationID sets the organization ID.