config

package
v0.15.17-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 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 ContextGetEnvironmentID added in v0.15.7

func ContextGetEnvironmentID(ctx context.Context) string

func ContextGetOrganizationID added in v0.15.7

func ContextGetOrganizationID(ctx context.Context) string

func ContextGetServerURL added in v0.15.7

func ContextGetServerURL(ctx context.Context) string

func ContextWithEnvironmentID added in v0.15.7

func ContextWithEnvironmentID(ctx context.Context, envID string) context.Context

func ContextWithOrganizationID added in v0.15.7

func ContextWithOrganizationID(ctx context.Context, orgID string) context.Context

func ContextWithServerURL added in v0.15.7

func ContextWithServerURL(ctx context.Context, serverURL string) context.Context

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(ctx context.Context, config Config) (context.Context, error)

func SetupHttpClient

func SetupHttpClient(cfg Config) *resourcemanager.HTTPClient

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) ExecuteUserLogin added in v0.15.7

func (c Configurator) ExecuteUserLogin(ctx context.Context, cfg Config, prev *Config) (Config, error)

func (Configurator) Start

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

func (Configurator) WithErrorHandler added in v0.15.7

func (c Configurator) WithErrorHandler(fn errorHandlerFn) Configurator

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