session

package
v1.0.4-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenExpired = errors.New("token is expired, please login")
)

Functions

This section is empty.

Types

type Session

type Session struct {
	URI         string `json:"uri"`
	ExpiresAt   int64  `json:"expires_at"`
	AccessToken string `json:"access_token"`
	// contains filtered or unexported fields
}

func LoadFromPath

func LoadFromPath(path string) (Session, error)

LoadFromPath loads an existing session from a file.

func New

func New(path string) Session

New creates a new session to be stores to the provided path.

func (Session) Path

func (s Session) Path() string

func (Session) SetAccessToken

func (s Session) SetAccessToken(token string) Session

func (Session) SetExpiresAt

func (s Session) SetExpiresAt(expiresAt int64) Session

func (Session) SetURI

func (s Session) SetURI(uri string) Session

func (Session) Store

func (s Session) Store() error

Store stores an existing session to the default file.

Jump to

Keyboard shortcuts

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