contextstore

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialKey

func CredentialKey(issuer, subject, org, client string) string

func CredentialsPath

func CredentialsPath() string

func Dir

func Dir() string

func Path

func Path() string

func Save

func Save(c Config) error

func UniqueName

func UniqueName(c Config, desired string) string

Types

type Config

type Config struct {
	Version  int       `json:"version"`
	Active   string    `json:"active,omitempty"`
	Contexts []Context `json:"contexts"`
}

func Load

func Load() (Config, error)

func (Config) Find

func (c Config) Find(name string) (Context, bool)

func (Config) FindIdentity

func (c Config) FindIdentity(issuer, subject, org string) (int, bool)

type Context

type Context struct {
	Name           string `json:"name"`
	Issuer         string `json:"issuer"`
	APIURL         string `json:"api_url"`
	Subject        string `json:"subject,omitempty"`
	Email          string `json:"email,omitempty"`
	OrganizationID string `json:"organization_id"`
	// OrganizationName is the name when the context was saved, for display.
	OrganizationName string `json:"organization_name,omitempty"`
	CredentialKey    string `json:"credential_key"`
	Storage          string `json:"storage"`
}

Jump to

Keyboard shortcuts

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