config

package
v0.0.0-...-87fd372 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAgentAuthDetails

func DeleteAgentAuthDetails(alias string) error

DeleteAgentAuthDetails deletes auth information.

func GetAgentsAlias

func GetAgentsAlias() ([]string, error)

GetAgentsAlias all available agents aliases.

func Initialize

func Initialize() error

Initialize initializes config store for LPR CLI.

func SetAgentAuthDetails

func SetAgentAuthDetails(in Agent) error

SetAgentAuthDetails persists auth information for related Agent.

func SetDefaultContext

func SetDefaultContext(alias string) error

SetDefaultContext updates context.

Types

type Agent

type Agent struct {
	// Alias specifies Agent's alias. Necessary for storing configuration for the same Agent's server URL multiple times.
	Alias string
	// ServerURL specifies Agent's server URL.
	ServerURL string
	// AgentCAFilePath specifies CA file path. It is used to validate if we can trust Agent's server.
	AgentCAFilePath string
	// ClientAuth holds client configuration for authorization.
	ClientAuth ClientAuth
}

func GetAgentAuthDetails

func GetAgentAuthDetails() (Agent, error)

GetAgentAuthDetails returns information about Agent's auth method.

func (*Agent) IsEmpty

func (a *Agent) IsEmpty() bool

type ClientAuth

type ClientAuth struct {

	// ClientCertAuth holds client certs configuration
	ClientCertAuth
}

type ClientCertAuth

type ClientCertAuth struct {
	CertFilePath string
	KeyFilePath  string
}

type Config

type Config struct {
	// Context represents currently used auth context.
	Context string
	// Agent holds all available Agent's configuration. Stored as map for O(n) access, we don't care that it's not sorted.
	Agent map[string]Agent
}

Jump to

Keyboard shortcuts

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