config

package
v0.0.0-...-194279b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Product = "prod_GgJOE3a7Adfopv"

Variables

View Source
var (
	APIBase          = "/api/v1"
	TestExecutionAPI = APIBase + "/testexecution"
	RegistrarAPI     = APIBase + "/registrar"
	FilesAPI         = APIBase + "/files"
	ContainerAPI     = APIBase + "/container"
	BillingAPI       = APIBase + "/plans"
	AdminAPI         = APIBase + "/admin"
	UsageAPI         = APIBase + "/usage"
)
View Source
var DefaultURI = URI{
	StopTestURI:             TestExecutionAPI + "/stop/test/%s",
	StopDefURI:              TestExecutionAPI + "/stop/definition/%s",
	RunTestURI:              TestExecutionAPI + "/run/%s/%s",
	StatusURI:               TestExecutionAPI + "/status/%s",
	TestsURI:                TestExecutionAPI + "/organizations/%s/tests",
	CreateTestURI:           TestExecutionAPI + "/run/%s",
	TestInfoURI:             TestExecutionAPI + "/info/tests/%s",
	PhasePassedURI:          TestExecutionAPI + "/status/%s/phase/%s/passed",
	ListTestsByDefURI:       TestExecutionAPI + "/definitions/%s/tests",
	ListDefinitionsByOrgURI: TestExecutionAPI + "/organizations/%s/definitions",

	GetOrgURI:            RegistrarAPI + "/organization/%s",
	GetSelfURI:           RegistrarAPI + "/user",
	GetOrgRoleURI:        RegistrarAPI + "/organization/%s/user",
	CheckAdminURI:        RegistrarAPI + "/check/iam/%s",
	CheckMemberURI:       RegistrarAPI + "/check/member/%s",
	CreateUserURI:        RegistrarAPI + "/user",
	FeaturedOrgsURI:      RegistrarAPI + "/featured",
	GetOrgProfileURI:     RegistrarAPI + "/organization/%s/profile",
	UpdateOrgProfileURI:  RegistrarAPI + "/organization/%s/profile",
	CreateOrgProfileURI:  RegistrarAPI + "/organization/%s/profile",
	GetOrgSettingsURI:    RegistrarAPI + "/organization/%s/settings",
	UpdateOrgSettingsURI: RegistrarAPI + "/organization/%s/settings",
	CreateOrgSettingsURI: RegistrarAPI + "/organization/%s/settings",

	UpdateOrgFeaturedURI:    AdminAPI + "/organization/%s/featured",
	UpdateUserSuperAdminURI: AdminAPI + "/user/%s/admin",

	MultipathUploadURI: FilesAPI + "/organizations/%s/definitions",

	PrepareExecURI:    ContainerAPI + "/%s/exec",
	AttachExecURI:     ContainerAPI + "/%s/exec/attach",
	RunDetachURI:      ContainerAPI + "/%s/exec/run",
	ListContainersURI: ContainerAPI + "/%s/list",
	ContainerLogsURI:  ContainerAPI + "/%s/logs/%s/%s",
	AllLogsURI:        ContainerAPI + "/%s/all/logs",
	ContainerStatsURI: ContainerAPI + "/%s/stats",

	LimitsURI:        BillingAPI + "/limits/%s/%s",
	BillingHealthURI: BillingAPI + "/health",

	GetUsageURI:  UsageAPI + "/%s",
	GetLimitsURI: UsageAPI + "/limit/%s",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	AuthEndpoint string        `mapstructure:"authEndpoint"`
	AuthPath     string        `mapstructure:"authPath"`
	AuthTimeout  time.Duration `mapstructure:"authTimeout"`
	TokenPath    string        `mapstructure:"tokenPath"`
	RedirectURL  string        `mapstructure:"redirectURL"`

	Verbosity string `mapstructure:"verbosity"`

	SchemaURL       string        `mapstructure:"schemaURL"`
	WBHost          string        `mapstructure:"wbHost"`
	APITimeout      time.Duration `mapstructure:"apiTimeout"`
	BiomeDNSZone    string        `mapstructure:"biomeDNSZone"`
	VersionLocation string        `mapstructure:"versionLocation"`
	CLIURL          string        `mapstructure:"cliURL"`

	OrgID string `mapstructure:"orgID"`

	TokenFile          string `mapstructure:"tokenFile"`
	OrgFile            string `mapstructure:"orgFile"`
	SchemaFile         string `mapstructure:"schemaFile"`
	SettingsFile       string `mapstructure:"settingsFile"`
	GenesisCredentials string `mapstructure:"genesisCredentials"`
	GenesisBanner      string `mapstructure:"genesisBanner"`

	Dir     configdir.ConfigDir `mapstructure:"-"`
	UserDir *configdir.Config   `mapstructure:"-"`
	URI
}

Config groups all of the global configuration parameters into a single struct

func NewConfig

func NewConfig() Config

NewConfig creates a new config object from the global config

func (Config) APIEndpoint

func (c Config) APIEndpoint() string

func (Config) APIHost

func (c Config) APIHost() string

func (Config) HTTPClient

func (c Config) HTTPClient() *http.Client

func (Config) WSEndpoint

func (c Config) WSEndpoint() string

type Settings

type Settings struct {
	Cloud settings.Cloud `yaml:"cloud,omitempty"`
}

func LoadSettings

func LoadSettings() (out Settings, err error)

func (Settings) Store

func (s Settings) Store() error

type URI

type URI struct {
	StopTestURI             string `mapstructure:"-"`
	StopDefURI              string `mapstructure:"-"`
	RunTestURI              string `mapstructure:"-"`
	CreateTestURI           string `mapstructure:"-"`
	TestInfoURI             string `mapstructure:"-"`
	ExecURI                 string `mapstructure:"-"`
	MultipathUploadURI      string `mapstructure:"-"`
	GetOrgURI               string `mapstructure:"-"`
	AllLogsURI              string `mapstructure:"-"`
	StatusURI               string `mapstructure:"-"`
	TestsURI                string `mapstructure:"-"`
	PrepareExecURI          string `mapstructure:"-"`
	AttachExecURI           string `mapstructure:"-"`
	RunDetachURI            string `mapstructure:"-"`
	ListContainersURI       string `mapstructure:"-"`
	GetSelfURI              string `mapstructure:"-"`
	GetOrgRoleURI           string `mapstructure:"-"`
	CheckAdminURI           string `mapstructure:"-"`
	CheckMemberURI          string `mapstructure:"-"`
	LimitsURI               string `mapstructure:"-"`
	CreateUserURI           string `mapstructure:"-"`
	BillingHealthURI        string `mapstructure:"-"`
	FeaturedOrgsURI         string `mapstructure:"-"`
	GetOrgProfileURI        string `mapstructure:"-"`
	UpdateOrgProfileURI     string `mapstructure:"-"`
	CreateOrgProfileURI     string `mapstructure:"-"`
	UpdateOrgFeaturedURI    string `mapstructure:"-"`
	UpdateUserSuperAdminURI string `mapstructure:"-"`
	ContainerLogsURI        string `mapstructure:"-"`
	ContainerStatsURI       string `mapstructure:"-"`
	GetOrgSettingsURI       string `mapstructure:"-"`
	UpdateOrgSettingsURI    string `mapstructure:"-"`
	CreateOrgSettingsURI    string `mapstructure:"-"`
	GetUsageURI             string `mapstructure:"-"`
	GetLimitsURI            string `mapstructure:"-"`
	PhasePassedURI          string `mapstructure:"-"`
	ListTestsByDefURI       string `mapstructure:"-"`
	ListDefinitionsByOrgURI string `mapstructure:"-"`
}

func (URI) AllLogsURL

func (uri URI) AllLogsURL(testID string) string

func (URI) AttachExecURL

func (uri URI) AttachExecURL(tid string) string

func (URI) BillingHealthURL

func (uri URI) BillingHealthURL() string

func (URI) ContainerLogsURL

func (uri URI) ContainerLogsURL(tid, cntr, lines string) string

func (URI) ContainerStatsURL

func (uri URI) ContainerStatsURL(testID string) string

func (URI) CreateOrgProfileURL

func (uri URI) CreateOrgProfileURL(id string) string

func (URI) CreateOrgSettingsURL

func (uri URI) CreateOrgSettingsURL(id string) string

func (URI) CreateUserURL

func (uri URI) CreateUserURL() string

func (URI) FeaturedOrgsURL

func (uri URI) FeaturedOrgsURL() string

func (URI) GetLimitsURL

func (uri URI) GetLimitsURL(orgID string) string

func (URI) GetOrgProfileURL

func (uri URI) GetOrgProfileURL(id string) string

func (URI) GetOrgSettingsURL

func (uri URI) GetOrgSettingsURL(id string) string

func (URI) GetSelfURL

func (uri URI) GetSelfURL() string

func (URI) GetUsageURL

func (uri URI) GetUsageURL(orgID string) string

func (URI) ListContainersURL

func (uri URI) ListContainersURL(tid string) string

func (URI) ListDefinitionsByOrgURL

func (uri URI) ListDefinitionsByOrgURL(orgID string) string

func (URI) ListTestsByDefURL

func (uri URI) ListTestsByDefURL(defID string) string

func (URI) PhasePassedURL

func (uri URI) PhasePassedURL(testID, phase string) string

func (URI) PrepareExecURL

func (uri URI) PrepareExecURL(tid string) string

func (URI) RunDetachURL

func (uri URI) RunDetachURL(tid string) string

func (URI) UpdateOrgFeaturedURL

func (uri URI) UpdateOrgFeaturedURL(oid string) string

func (URI) UpdateOrgProfileURL

func (uri URI) UpdateOrgProfileURL(id string) string

func (URI) UpdateOrgSettingsURL

func (uri URI) UpdateOrgSettingsURL(id string) string

func (URI) UpdateUserSuperAdminURL

func (uri URI) UpdateUserSuperAdminURL(uid string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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