config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAuthCacheFilePath string

Functions

This section is empty.

Types

type AuthCache

type AuthCache interface {
	State() AuthState
	StateE() (AuthState, error)

	SetAuthData([]byte) error
	Clear()
	ClearE() error

	FullName() string
	Token() string
	MustToken() string
	RefreshToken() string
}

func DefaultAuthCache

func DefaultAuthCache() AuthCache

type AuthState

type AuthState int
const (
	Undefined AuthState = iota
	NotLoggedIn
	Expired
	LoggedIn
)

type AuthTokenData

type AuthTokenData struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	CreatedAt    int64  `json:"created_at"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int64  `json:"expires_in"`
	Data         struct {
		Id         string `json:"id"`
		Attributes struct {
			FullName string `json:"full-name"`
		}
	}
}

type FileAuthCache

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

func NewFileAuthCache

func NewFileAuthCache(path string) (c *FileAuthCache, err error)

func (*FileAuthCache) Clear

func (c *FileAuthCache) Clear()

func (*FileAuthCache) ClearE

func (c *FileAuthCache) ClearE() error

func (*FileAuthCache) FullName

func (c *FileAuthCache) FullName() string

func (*FileAuthCache) MustLoggedIn

func (c *FileAuthCache) MustLoggedIn()

func (*FileAuthCache) MustToken

func (c *FileAuthCache) MustToken() string

func (*FileAuthCache) RefreshToken added in v1.0.1

func (c *FileAuthCache) RefreshToken() string

func (*FileAuthCache) SetAuthData

func (c *FileAuthCache) SetAuthData(dataBytes []byte) (err error)

func (*FileAuthCache) State

func (c *FileAuthCache) State() AuthState

func (*FileAuthCache) StateE

func (c *FileAuthCache) StateE() (AuthState, error)

func (*FileAuthCache) Token

func (c *FileAuthCache) Token() string

Jump to

Keyboard shortcuts

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