config

package
v2.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildStamp string
	Branch     string
	GitHash    string
	Version    string

	DefaultAOVersion = AOVersion{
		Version:    Version,
		BuildStamp: BuildStamp,
		Branch:     Branch,
		GitHash:    GitHash,
	}
)

The version variables will be set during build time, see build/build.sh

View Source
var DefaultAOConfig = AOConfig{
	RefName:                 "master",
	Clusters:                make(map[string]*Cluster),
	AvailableClusters:       []string{"utv", "utv-relay", "test", "test-relay", "prod", "prod-relay"},
	PreferredAPIClusters:    []string{"utv", "test"},
	AvailableUpdateClusters: []string{"utv", "test"},
	ClusterUrlPattern:       "https://%s-master.paas.skead.no:8443",
	BooberUrlPattern:        "http://boober-aurora.%s.paas.skead.no",
	UpdateUrlPattern:        "http://ao-aurora-tools.%s.paas.skead.no",
	GoboUrlPattern:          "http://gobo.aurora.%s.paas.skead.no",
}

Functions

func GetNewAOClient

func GetNewAOClient(url string) ([]byte, error)

func GetToken

func GetToken(host string, username string, password string) (string, error)

func Install added in v1.3.5

func Install(installdir string, cli bool) error

func WriteConfig

func WriteConfig(ao AOConfig, configLocation string) error

Types

type AOConfig

type AOConfig struct {
	RefName     string              `json:"refName"`
	APICluster  string              `json:"apiCluster"`
	Affiliation string              `json:"affiliation"`
	Localhost   bool                `json:"localhost"`
	Clusters    map[string]*Cluster `json:"clusters"`

	AvailableClusters       []string `json:"availableClusters"`
	PreferredAPIClusters    []string `json:"preferredApiClusters"`
	AvailableUpdateClusters []string `json:"availableUpdateClusters"`
	ClusterUrlPattern       string   `json:"clusterUrlPattern"`
	BooberUrlPattern        string   `json:"booberUrlPattern"`
	UpdateUrlPattern        string   `json:"updateUrlPattern"`
	GoboUrlPattern          string   `json:"goboUrlPattern"`
}

func LoadConfigFile

func LoadConfigFile(configLocation string) (*AOConfig, error)

func (*AOConfig) InitClusters

func (ao *AOConfig) InitClusters()

func (*AOConfig) SelectApiCluster

func (ao *AOConfig) SelectApiCluster()

func (*AOConfig) Update

func (ao *AOConfig) Update(noPrompt bool) error

type AOVersion

type AOVersion struct {
	Version    string `json:"version"`
	Branch     string `json:"branch"`
	GitHash    string `json:"gitHash"`
	BuildStamp string `json:"buildStamp"`
}

func GetCurrentVersionFromServer

func GetCurrentVersionFromServer(url string) (*AOVersion, error)

func (*AOVersion) IsNewVersion

func (v *AOVersion) IsNewVersion() bool

type Cluster

type Cluster struct {
	Name      string `json:"name"`
	Url       string `json:"url"`
	Token     string `json:"token"`
	Reachable bool   `json:"reachable"`
	BooberUrl string `json:"booberUrl"`
	GoboUrl   string `json:"goboUrl"`
}

func (*Cluster) HasValidToken

func (c *Cluster) HasValidToken() bool

Jump to

Keyboard shortcuts

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