authcmd

package
v0.25.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) 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)

func (*Manager) Resolve

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

func (*Manager) SetExecFunc

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

func (*Manager) SetRunFunc

func (m *Manager) SetRunFunc(fn func(context.Context, Config) (runOutput, error))

type Result

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

Jump to

Keyboard shortcuts

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