authcmd

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 16 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) 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) SetExecFunc

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

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
}

Jump to

Keyboard shortcuts

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