config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PersonalPath

func PersonalPath() (string, error)

func SavePersonal

func SavePersonal(path string, c Personal) error

SavePersonal replaces only complete, validated files. Never writes secret values to stdout.

func ValidName

func ValidName(name string) bool

Types

type CertificateStatus added in v0.2.0

type CertificateStatus struct {
	Profile       string     `json:"profile"`
	Level         string     `json:"level"`
	ExpiresAt     *time.Time `json:"expires_at,omitempty"`
	DaysRemaining int        `json:"days_remaining"`
}

CertificateStatus deliberately omits certificate subjects, serials and paths.

type Config

type Config struct {
	Profiles     []Profile
	Addr         string
	BaseURL      string
	APIKey       string
	Database     string
	SyncInterval time.Duration
	Provider     string
	EFI          efi.Config
	Inter        inter.Config
	Sicoob       sicoob.Config
	Santander    santander.Config
	C6           c6.Config
}

func Load

func Load() (Config, error)

func (Config) Certificates added in v0.2.0

func (c Config) Certificates(now time.Time) []CertificateStatus

type Personal

type Personal struct {
	Version      int       `json:"version"`
	Database     string    `json:"database"`
	APIKey       string    `json:"api_key"`
	Addr         string    `json:"addr"`
	BaseURL      string    `json:"base_url"`
	SyncInterval string    `json:"sync_interval"`
	Profiles     []Profile `json:"profiles"`
}

func NewPersonal

func NewPersonal() Personal

func ReadPersonal

func ReadPersonal(path string) (Personal, error)

func (Personal) Runtime

func (c Personal) Runtime(path string) Config

func (Personal) Validate

func (c Personal) Validate() error

type Profile

type Profile struct {
	Name             string `json:"name"`
	Provider         string `json:"provider"`
	Environment      string `json:"environment,omitempty"`
	ClientID         string `json:"client_id,omitempty"`
	ClientSecretFile string `json:"client_secret_file,omitempty"`
	CertificateFile  string `json:"certificate_file,omitempty"`
	PrivateKeyFile   string `json:"private_key_file,omitempty"`
	AccessTokenFile  string `json:"access_token_file,omitempty"`
	Account          string `json:"account,omitempty"`
	LookbackDays     int    `json:"lookback_days,omitempty"`
}

Jump to

Keyboard shortcuts

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