common

package
v0.0.0-...-aa4767a Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileName

func GetFileName(t string, enc bool) string

GetFileName generates and returns zauth filename for type t. Format: zauth-{t}-{Current UnixTime}.json?{.enc}

func ReadZAuthJson

func ReadZAuthJson() ([]zauth.ZAuth, error)

ReadZAuthJson reads zauth.json file and returns it's equivalent ZAuth array object

func WriteFile

func WriteFile(d []byte, f string) (string, error)

WriteFile writes d bytes to file f. If file's directory does it exist, it is created. If file exists, it is overwritten. Returns write location and any errors occured

func WriteZAuthJson

func WriteZAuthJson(z []zauth.ZAuth, ow bool) error

WriteZAuthJson writes ZAuth array objects as json to zauth.json file. File is overwritten with new content if ow is true. Else entries in z are appended to existing file.

Types

type PasswordReader

type PasswordReader interface {
	ReadPassword() (string, error)
}

type UserInputReader

type UserInputReader interface {
	UserInput() (string, error)
}

type ZAuthCommon

type ZAuthCommon struct{}

func (*ZAuthCommon) ReadPassword

func (zc *ZAuthCommon) ReadPassword() (string, error)

func (*ZAuthCommon) UserInput

func (zc *ZAuthCommon) UserInput() (string, error)

type ZAuthCommonComp

type ZAuthCommonComp interface {
	PasswordReader
	UserInputReader
}

Jump to

Keyboard shortcuts

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