credm

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CRED_TBL = "credentials"
)

Functions

func GetCredDb

func GetCredDb(logger *zerolog.Logger) (*db.Storage, error)

func PassSearch

func PassSearch() error

Types

type ByTimestamp

type ByTimestamp []CredInfo

func (ByTimestamp) Len

func (a ByTimestamp) Len() int

func (ByTimestamp) Less

func (a ByTimestamp) Less(i, j int) bool

func (ByTimestamp) Swap

func (a ByTimestamp) Swap(i, j int)

type CredInfo

type CredInfo struct {
	Application string `yaml:"application"`
	Username    string `yaml:"username"`
	Password    string `yaml:"-"`
	Timestamp   int64  `yaml:"timestamp"`
	Hash        string `yaml:"-"`
	// Not supported for now
	Tag []string `yaml:"tag"`
}

func NewCred

func NewCred() *CredInfo

type Credentials

type Credentials struct {
	Db          *db.Storage
	Logger      *zerolog.Logger
	Credentials []CredInfo `yaml:"credentials"`
}

func (*Credentials) Load

func (credentials *Credentials) Load() (map[interface{}]interface{}, error)

func (*Credentials) Order

func (credentials *Credentials) Order()

Order credentials regarding SortBy option defined in config yaml Prefix "-" reverses the order, default is "recency", "+<expressions>" is the same as "<expression>"

func (*Credentials) Reverse

func (credentials *Credentials) Reverse()

func (*Credentials) SortByTimestamp

func (credentials *Credentials) SortByTimestamp()

func (*Credentials) ToString

func (credentials *Credentials) ToString() (string, error)

ToString returns the contents of yaml file.

Jump to

Keyboard shortcuts

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