subnet

package
v0.0.0-...-e7aa26d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// LoggerWebhookName - subnet logger webhook target
	LoggerWebhookName = "subnet"
)

Variables

View Source
var DefaultKVS = config.KVS{
	config.KV{
		Key:   config.License,
		Value: "",
	},
	config.KV{
		Key:   config.APIKey,
		Value: "",
	},
	config.KV{
		Key:   config.Proxy,
		Value: "",
	},
}

DefaultKVS - default KV config for subnet settings

View Source
var (

	// HelpSubnet - provides help for subnet api key config
	HelpSubnet = config.HelpKVS{
		config.HelpKV{
			Key:         config.License,
			Type:        "string",
			Description: "[DEPRECATED use api_key] Subnet license token for the cluster" + defaultHelpPostfix(config.License),
			Optional:    true,
			Sensitive:   true,
		},
		config.HelpKV{
			Key:         config.APIKey,
			Type:        "string",
			Description: "Subnet api key for the cluster" + defaultHelpPostfix(config.APIKey),
			Optional:    true,
			Sensitive:   true,
		},
		config.HelpKV{
			Key:         config.Proxy,
			Type:        "string",
			Description: "HTTP(S) proxy URL to use for connecting to SUBNET" + defaultHelpPostfix(config.Proxy),
			Optional:    true,
			Sensitive:   true,
		},
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// The subnet license token - Deprecated Dec 2021
	License string `json:"license"`

	// The subnet api key
	APIKey string `json:"apiKey"`

	// The HTTP(S) proxy URL to use for connecting to SUBNET
	Proxy string `json:"proxy"`

	// The subnet base URL
	BaseURL string
	// contains filtered or unexported fields
}

Config represents the subnet related configuration

func LookupConfig

func LookupConfig(kvs config.KVS, transport http.RoundTripper) (cfg Config, err error)

LookupConfig - lookup config and override with valid environment settings if any.

func (*Config) ApplyEnv

func (c *Config) ApplyEnv()

ApplyEnv - applies the current subnet config to Console UI specific environment variables.

func (Config) Post

func (c Config) Post(reqURL string, payload interface{}) (string, error)

Post submit 'payload' to specified URL

func (*Config) Registered

func (c *Config) Registered() bool

Registered indicates if cluster is registered or not

func (*Config) Update

func (c *Config) Update(ncfg Config, isDevEnv bool)

Update - in-place update with new license and registration information.

func (Config) Upload

func (c Config) Upload(reqURL string, filename string, payload []byte) (string, error)

Upload given file content (payload) to specified URL

Jump to

Keyboard shortcuts

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