config

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Data{
	TelemetryEnabled: true,
	Namespace:        "testkube",
	APIURI:           "http://localhost:8088",
	OAuth2Data: OAuth2Data{
		Provider: oauth.GithubProviderType,
	},
}

Functions

func Save added in v0.9.12

func Save(data Data) error

Types

type CloudContext added in v1.7.30

type CloudContext struct {
	Environment  string `json:"environment,omitempty"`
	Organization string `json:"organization,omitempty"`
	ApiKey       string `json:"apiKey,omitempty"`
	ApiUri       string `json:"apiUri,omitempty"`
	AgentKey     string `json:"agentKey,omitempty"`
	AgentUri     string `json:"agentUri,omitempty"`
}

type ContextType added in v1.8.6

type ContextType string
const (
	ContextTypeCloud      ContextType = "cloud"
	ContextTypeKubeconfig ContextType = "kubeconfig"
)

type Data

type Data struct {
	TelemetryEnabled bool       `json:"telemetryEnabled,omitempty"`
	Namespace        string     `json:"namespace,omitempty"`
	Initialized      bool       `json:"initialized,omitempty"`
	APIURI           string     `json:"apiURI,omitempty"`
	OAuth2Data       OAuth2Data `json:"oauth2Data"`

	ContextType  ContextType  `json:"contextType,omitempty"`
	CloudContext CloudContext `json:"cloudContext,omitempty"`
}

func Load added in v0.9.12

func Load() (Data, error)

func (*Data) DisableAnalytics

func (c *Data) DisableAnalytics()

func (*Data) DisableOauth added in v1.1.16

func (c *Data) DisableOauth()

DisableOauth is oauth disable method

func (*Data) EnableAnalytics

func (c *Data) EnableAnalytics()

func (*Data) EnableOAuth added in v1.1.16

func (c *Data) EnableOAuth()

EnableOAuth is oauth enable method

func (*Data) SetInitialized added in v1.0.16

func (c *Data) SetInitialized()

func (*Data) SetNamespace added in v0.10.5

func (c *Data) SetNamespace(ns string)

type OAuth2Data added in v1.1.16

type OAuth2Data struct {
	Enabled      bool               `json:"enabled,omitempty"`
	Token        *oauth2.Token      `json:"token,omitempty"`
	ClientID     string             `json:"clientID,omitempty"`
	ClientSecret string             `json:"clientSecret,omitempty"`
	Provider     oauth.ProviderType `json:"providerType,omitempty"`
	Scopes       []string           `json:"scopes"`
}

OAuth2Data contains oauth credentials

type Storage

type Storage struct {
	Dir string
}

func GetStorage added in v1.8.8

func GetStorage(dir string) (Storage, error)

func (*Storage) Init

func (c *Storage) Init() error

func (*Storage) Load

func (c *Storage) Load() (data Data, err error)

func (*Storage) Save

func (c *Storage) Save(data Data) error

Jump to

Keyboard shortcuts

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