shared

package module
v0.0.0-...-4b2b8ef Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRunner

type CommandRunner interface {
	Run(ctx context.Context, command string, args ...string) (string, error)
}

type ConstructError

type ConstructError struct {
	Source  ErrorSource
	Message string
	Err     error
}

func Errorf

func Errorf(source ErrorSource, format string, a ...any) *ConstructError

func Wrap

func Wrap(source ErrorSource, err error, format string, a ...any) *ConstructError

func (*ConstructError) As

func (e *ConstructError) As(target interface{}) bool

func (*ConstructError) Error

func (e *ConstructError) Error() string

func (*ConstructError) Is

func (e *ConstructError) Is(target error) bool

func (*ConstructError) Unwrap

func (e *ConstructError) Unwrap() error

type ContextManager

type ContextManager struct {
	// contains filtered or unexported fields
}

func NewContextManager

func NewContextManager(fs *afero.Afero, userInfo UserInfo) *ContextManager

func NewContextManagerWithKeyring

func NewContextManagerWithKeyring(fs *afero.Afero, userInfo UserInfo, keyringProvider keyring.Provider) *ContextManager

func (*ContextManager) DeleteContext

func (m *ContextManager) DeleteContext(contextName string) error

func (*ContextManager) DeleteToken

func (m *ContextManager) DeleteToken(contextName string) error

func (*ContextManager) GetContext

func (m *ContextManager) GetContext(contextName string) (*api.EndpointContext, error)

func (*ContextManager) ListContexts

func (m *ContextManager) ListContexts() ([]string, error)

func (*ContextManager) LoadContext

func (m *ContextManager) LoadContext() (*api.EndpointContexts, error)

func (*ContextManager) RetrieveToken

func (m *ContextManager) RetrieveToken(contextName string) (string, error)

func (*ContextManager) SetCurrentContext

func (m *ContextManager) SetCurrentContext(contextName string) error

func (*ContextManager) StoreToken

func (m *ContextManager) StoreToken(contextName string, token string) error

func (*ContextManager) UpsertContext

func (m *ContextManager) UpsertContext(contextName string, kind string, address string, setCurrent bool, auth *api.AuthConfig) (bool, error)

type DefaultCommandRunner

type DefaultCommandRunner struct{}

func (*DefaultCommandRunner) Run

func (r *DefaultCommandRunner) Run(ctx context.Context, command string, args ...string) (string, error)

type DefaultRuntimeInfo

type DefaultRuntimeInfo struct{}

func (*DefaultRuntimeInfo) GOOS

func (r *DefaultRuntimeInfo) GOOS() string

type DefaultUserInfo

type DefaultUserInfo struct {
	// contains filtered or unexported fields
}

func NewDefaultUserInfo

func NewDefaultUserInfo(fs afero.Fs) *DefaultUserInfo

func (*DefaultUserInfo) ConstructConfigDir

func (u *DefaultUserInfo) ConstructConfigDir() (string, error)

func (*DefaultUserInfo) ConstructDataDir

func (u *DefaultUserInfo) ConstructDataDir() (string, error)

func (*DefaultUserInfo) ConstructLogDir

func (u *DefaultUserInfo) ConstructLogDir() (string, error)

func (*DefaultUserInfo) ConstructRuntimeDir

func (u *DefaultUserInfo) ConstructRuntimeDir() (string, error)

func (*DefaultUserInfo) Cwd

func (u *DefaultUserInfo) Cwd() (string, error)

func (*DefaultUserInfo) HomeDir

func (u *DefaultUserInfo) HomeDir() (string, error)

func (*DefaultUserInfo) IsRoot

func (u *DefaultUserInfo) IsRoot() (bool, error)

func (*DefaultUserInfo) UserID

func (u *DefaultUserInfo) UserID() (string, error)

type ErrorSource

type ErrorSource int
const (
	ErrorSourceTool ErrorSource = iota
	ErrorSourceAgent
	ErrorSourceSystem
	ErrorSourceUser
	ErrorSourceUnknown
)

type RuntimeInfo

type RuntimeInfo interface {
	GOOS() string
}

type UserInfo

type UserInfo interface {
	UserID() (string, error)
	HomeDir() (string, error)
	ConstructConfigDir() (string, error)
	ConstructDataDir() (string, error)
	ConstructLogDir() (string, error)
	ConstructRuntimeDir() (string, error)
	Cwd() (string, error)
	IsRoot() (bool, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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