config

package
v0.15.6-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version              = "dev"
	Env                  = "dev"
	DefaultCloudEndpoint = "http://app.tracetest.io"
	DefaultCloudDomain   = "tracetest.io"
	DefaultCloudPath     = "/"
)

Functions

func GetAPIClient

func GetAPIClient(cliConfig Config) *openapi.APIClient

func GetConfigurationPath

func GetConfigurationPath() (string, error)

func GetTokenClaims

func GetTokenClaims(tokenString string) (jwt.MapClaims, error)

func GetVersion

func GetVersion(ctx context.Context, cfg Config) (string, bool)

func ParseServerURL

func ParseServerURL(serverURL string) (scheme, endpoint, serverPath string, err error)

func Save

func Save(config Config) error

func SetupHttpClient

func SetupHttpClient(cfg Config) *resourcemanager.HTTPClient

func ValidateServerURL

func ValidateServerURL(serverURL string) error

Types

type Config

type Config struct {
	Scheme            string `yaml:"scheme"`
	Endpoint          string `yaml:"endpoint"`
	ServerPath        string `yaml:"serverPath,omitempty"`
	OrganizationID    string `yaml:"organizationID,omitempty"`
	EnvironmentID     string `yaml:"environmentID,omitempty"`
	Token             string `yaml:"token,omitempty"`
	Jwt               string `yaml:"jwt,omitempty"`
	AgentApiKey       string `yaml:"-"`
	EndpointOverriden bool   `yaml:"-"`

	// cloud config
	CloudAPIEndpoint string `yaml:"-"`
	AgentEndpoint    string `yaml:"agentEndpoint,omitempty"`
	UIEndpoint       string `yaml:"uIEndpoint,omitempty"`
}

func LoadConfig

func LoadConfig(configFile string) (Config, error)

func (Config) FullURL added in v0.15.6

func (c Config) FullURL() string

func (Config) IsEmpty

func (c Config) IsEmpty() bool

func (Config) OAuthEndpoint added in v0.15.6

func (c Config) OAuthEndpoint() string

func (Config) Path

func (c Config) Path() string

func (Config) UI

func (c Config) UI() string

func (Config) URL

func (c Config) URL() string

type Configurator

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

func NewConfigurator

func NewConfigurator(resources *resourcemanager.Registry) Configurator

func (Configurator) ShowOrganizationSelector

func (c Configurator) ShowOrganizationSelector(ctx context.Context, cfg Config, flags agentConfig.Flags)

func (Configurator) Start

func (c Configurator) Start(ctx context.Context, prev *Config, flags agentConfig.Flags) error

func (Configurator) WithOnFinish

func (c Configurator) WithOnFinish(onFinish onFinishFn) Configurator

type Entry

type Entry struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type ListArgs

type ListArgs struct {
	Take          int32
	Skip          int32
	SortDirection string
	SortBy        string
	All           bool
}

Jump to

Keyboard shortcuts

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