package state

import "github.com/oslokommune/okctl/pkg/config/state"

Package state holds the config state

Index

Constants

const (
	// OsDarwin is a constant for macos
	OsDarwin = "darwin"
	// OsLinux is a constant for a linux based os
	OsLinux = "linux"

	// ArchAmd64 represents all 64-bit systems
	ArchAmd64 = "amd64"
)

Types

type Archive

type Archive struct {
	Type   string
	Target string
}

Archive represents the compression type

type Binary

type Binary struct {
	Name       string
	Version    string
	BufferSize string
	URLPattern string
	Archive    Archive
	Checksums  []Checksum
}

Binary stores information on how a dependent CLI can be staged

func AWSIamAuthenticatorKnownBinaries

func AWSIamAuthenticatorKnownBinaries() []Binary

AWSIamAuthenticatorKnownBinaries returns the known binaries

func EksctlKnownBinaries

func EksctlKnownBinaries() []Binary

EksctlKnownBinaries returns the known binaries

func KnownBinaries

func KnownBinaries() (binaries []Binary)

KnownBinaries returns a list of known binaries

func KubectlKnownBinaries

func KubectlKnownBinaries() []Binary

KubectlKnownBinaries returns the known binaries

For versions, see - https://kubernetes.io/releases/ - https://kubernetes.io/releases/patch-releases/

func KubensKnownBinaries

func KubensKnownBinaries() []Binary

KubensKnownBinaries returns the known binaries

type Checksum

type Checksum struct {
	Os     string
	Arch   string
	Type   string
	Digest string
}

Checksum represents the hashing algorithm and result

type Host

type Host struct {
	Os   string
	Arch string
}

Host represents the user system

func (Host) Validate

func (h Host) Validate() error

Validate determines if the host operating system is valid

type Metrics

type Metrics struct {
	UserAgent string `json:"userAgent"`
	APIURL    string `json:"apiURL"`
}

Metrics exposes configuration of metrics

type User

type User struct {
	User     UserInfo
	Host     Host
	Binaries []Binary
	Metrics  Metrics
}

User stores the state for the configuration of okctl itself

func NewUser

func NewUser() *User

NewUser returns the default configuration for the user state

type UserInfo

type UserInfo struct {
	ID       string
	Username string
}

UserInfo stores state related to the user themselves

func (UserInfo) Validate

func (u UserInfo) Validate() error

Validate returns no error if it passes all tests

Source Files

binary.go doc.go user.go

Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
8 packages
Last checked
5 hours ago

Tools for package owners.