config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvAPIKey  = "FACTUAREA_API_KEY"
	EnvProfile = "FACTUAREA_PROFILE"
)

Variables

View Source
var ErrNotFound = errors.New("credencial no encontrada")

Functions

func ConfigDir

func ConfigDir() (string, error)

func ConfigFile

func ConfigFile() (string, error)

func Environment

func Environment(apiKey string) string

func RedactKey

func RedactKey(apiKey string) string

func ValidKeyFormat

func ValidKeyFormat(apiKey string) bool

Types

type PathProvider added in v0.1.3

type PathProvider interface {
	Path() string
}

type Resolution

type Resolution struct {
	APIKey      string
	Source      string
	Profile     string
	Environment string
}

func ResolveAPIKey

func ResolveAPIKey(stdinKey, profile string, getenv func(string) string, store Store) (Resolution, error)

type Store

type Store interface {
	GetKey(profile string) (string, error)
	SetKey(profile, key string) error
	DeleteKey(profile string) error
}

func NewFileStore

func NewFileStore(path string) Store

func NewStore

func NewStore() (Store, bool)

Jump to

Keyboard shortcuts

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