authcmd

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scope added in v0.28.1

func Scope(env, ws string) string

Types

type Config

type Config struct {
	Argv          []string
	Dir           string
	Format        Format
	Header        string
	Scheme        string
	TokenPath     string
	TypePath      string
	ExpiryPath    string
	ExpiresInPath string
	CacheKey      string
	TTL           time.Duration
	Timeout       time.Duration
}

func Finalize

func Finalize(cfg Config) (Config, error)

func Parse

func Parse(params map[string]string, dir string) (Config, error)

func (Config) HeaderName added in v0.25.2

func (cfg Config) HeaderName() string

func (Config) WithBaseTimeout

func (cfg Config) WithBaseTimeout(base time.Duration) Config

type Format

type Format string
const (
	FormatText Format = "text"
	FormatJSON Format = "json"
)

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) Cached

func (m *Manager) Cached(env string, cfg Config) (Result, bool, error)

func (*Manager) CachedPrepared added in v0.25.2

func (m *Manager) CachedPrepared(prep Prepared) (Result, bool, error)

func (*Manager) Prepare added in v0.25.2

func (m *Manager) Prepare(env string, cfg Config) (Prepared, error)

func (*Manager) Resolve

func (m *Manager) Resolve(ctx context.Context, env string, cfg Config) (Result, error)

func (*Manager) ResolvePrepared added in v0.25.2

func (m *Manager) ResolvePrepared(ctx context.Context, prep Prepared) (Result, error)

func (*Manager) Restore added in v0.27.1

func (m *Manager) Restore(entries []SnapshotEntry)

func (*Manager) SetExecFunc

func (m *Manager) SetExecFunc(fn func(context.Context, Config) ([]byte, error))

func (*Manager) Snapshot added in v0.27.1

func (m *Manager) Snapshot() []SnapshotEntry

type Prepared added in v0.25.2

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

func (Prepared) HeaderName added in v0.26.1

func (p Prepared) HeaderName() string

type Result

type Result struct {
	Header string
	Value  string
	Token  string
	Type   string
	Expiry time.Time
}

type SnapshotEntry added in v0.27.1

type SnapshotEntry struct {
	Key       string    `json:"key"`
	Config    Config    `json:"config"`
	Token     string    `json:"token"`
	Type      string    `json:"type,omitempty"`
	Expiry    time.Time `json:"expiry,omitempty"`
	FetchedAt time.Time `json:"fetchedAt,omitempty"`
}

Jump to

Keyboard shortcuts

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