user

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotLoggedIn = errors.New("you are not logged in")
)

Errors related to user configuration.

Functions

This section is empty.

Types

type User

type User struct {
	APIKey   string `yaml:"api_key,omitempty"`
	Username string `yaml:"username,omitempty"`

	PublicAPIKey  string `yaml:"public_api_key,omitempty"`
	PrivateAPIKey string `yaml:"private_api_key,omitempty"`

	RefreshToken string `yaml:"refresh_token"`
	AccessToken  string `yaml:"access_token"`
}

User stores the user's login credentials and some metadata.

func (*User) LoggedIn

func (u *User) LoggedIn() bool

LoggedIn returns a boolean representing whether the user is logged in or not

func (*User) RedactedAPIKey

func (u *User) RedactedAPIKey() string

RedactedAPIKey returns a string representing the user's API key with everything but the last portion of the key displayed as "*"

func (*User) TokenIsExpired

func (u *User) TokenIsExpired() (bool, error)

TokenIsExpired returns a boolean representing whether or not the token is expired or an error if the token is invalid

Jump to

Keyboard shortcuts

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