store

package
v1.40.6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

could do conditional linux build, but no actual hard linux dependencies

Index

Constants

View Source
const (
	Unset     = ""
	None      = "none"
	PassLinux = "pass_linux"
	WinCred   = "wincred"
	File      = "file"
)

Supported store types.

Variables

This section is empty.

Functions

func GetDefaultPath

func GetDefaultPath() (string, error)

GetDefaultPath retrieves an OS-independent default path for secrets, tokens, encrypted key files. By default, it is /home/{username}/.thy/.

func GetSecureSetting

func GetSecureSetting(key string) (string, error)

func ReadFileInDefaultPath

func ReadFileInDefaultPath(fileName string) (string, error)

ReadFileInDefaultPath attempts to read a file in a store path. If the store path is not found, then the default thy directory is searched for a given file.

func StoreSecureSetting

func StoreSecureSetting(key string, val string, sType string) error

func ValidateStoreType

func ValidateStoreType(storeType string) error

Types

type NoneStore

type NoneStore struct{}

func (*NoneStore) Delete

func (s *NoneStore) Delete(string) error

func (*NoneStore) Get

func (s *NoneStore) Get(string, any) error

func (*NoneStore) List

func (s *NoneStore) List(string) ([]string, error)

func (*NoneStore) Store

func (s *NoneStore) Store(string, any) error

func (*NoneStore) StoreString

func (s *NoneStore) StoreString(string, string) error

func (*NoneStore) Wipe

func (s *NoneStore) Wipe(string) error

type Store

type Store interface {
	Store(key string, data any) error
	StoreString(key string, data string) error
	Get(key string, out any) error
	Delete(key string) error
	Wipe(prefix string) error
	List(prefix string) ([]string, error)
}

Store interface provides common methods for storing data.

func GetStore

func GetStore(st string) (Store, error)

func NewFileStore

func NewFileStore(basePath string) Store

func NewPassStore

func NewPassStore() Store

func NewSecureStore

func NewSecureStore(helper storeHelper) Store

func NewWinStore

func NewWinStore() Store

Directories

Path Synopsis
A `pass` based credential helper.
A `pass` based credential helper.

Jump to

Keyboard shortcuts

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