config

package
v0.3.38 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFile      string
	AlsoLogToStderr bool
	Verbose         bool
	LocalMode       bool
	DefaultConfig   = &Config{
		APIKey:       "",
		Verbose:      false,
		APIBaseURL:   "https://api.apoxy.dev",
		DashboardURL: "https://dashboard.apoxy.dev",
	}
)

Functions

func ApoxyDir added in v0.2.0

func ApoxyDir() string

ApoxyDir returns the path to the Apoxy configuration directory.

func DefaultAPIClient added in v0.2.0

func DefaultAPIClient() (*rest.APIClient, error)

DefaultAPIClient returns a new Apoxy API client.

func Store

func Store(cfg *Config) error

Types

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

func NewAuthenticator

func NewAuthenticator(cfg *Config) *Authenticator

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate()

func (*Authenticator) Check

func (a *Authenticator) Check() (bool, error)

type Config

type Config struct {
	// The API key to use for authentication.
	APIKey string `yaml:"api_key,omitempty"`
	// The project ID to use for authentication.
	ProjectID uuid.UUID `yaml:"project_id,omitempty"`
	// Whether to enable verbose logging.
	Verbose bool `yaml:"verbose,omitempty"`
	// The base URL for API requests.
	APIBaseURL string `yaml:"api_base_url,omitempty"`
	// The host header to set for API requests.
	APIBaseHost string `yaml:"api_base_host,omitempty"`
	// The URL for the dashboard UI.
	DashboardURL string `yaml:"dashboard_url,omitempty"`
}

func Load

func Load() (*Config, error)

Jump to

Keyboard shortcuts

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