internal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Opts options

Opts are the options set through the command line

Functions

func GetClientAndInfo

func GetClientAndInfo(acc string) (*vault.Vault, *vault.AccountInfo, *api.API, error)

GetClientAndInfo is a simple wrapper that will fetch the vault, account info from the given vault and an authenticated api client. Since this is used a lot, we created a separate function for this. This will take care of a lot of code duplication.

func GetReadTime

func GetReadTime() time.Time

GetReadTime will return the last saved reading time or 0 when no time-file is found

func JwtErrorFunc

func JwtErrorFunc(_ *http.Request, resp *http.Response)

JwtErrorFunc is a generic error handling function that can be attached to an API client. This will automatically trigger whenever an error (https response >= 400) is found. In this case, it will only check for the token-time error, which is returned when the time of the client is off.

func SaveReadTime

func SaveReadTime(t time.Time)

SaveReadTime will save the read time to disk

Types

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

Spinner is a structure that will display a nice spinning char to inform that the system is busy with something

func NewSpinner

func NewSpinner(d time.Duration) Spinner

NewSpinner will create a new spinner that spins on duration

func (*Spinner) Start

func (s *Spinner) Start()

Start will start the spinner

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop will stop the spinner

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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