config

package
v0.14.6-rc.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 19 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 string, 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:"-"`

	// 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) IsEmpty

func (c Config) IsEmpty() bool

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 ConfigFlags

type ConfigFlags struct {
	Endpoint       string
	OrganizationID string
	EnvironmentID  string
	CI             bool
	AgentApiKey    string
	Token          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 ConfigFlags)

func (Configurator) Start

func (c Configurator) Start(ctx context.Context, prev Config, flags ConfigFlags) 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