session

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSession

func AddSession(sess Session) error

AddSession appends an additional session to auth.json

func UseSession

func UseSession(email string) error

func WriteConfig added in v0.2.0

func WriteConfig(cfg Config) error

WriteConfig writes session data to auth.json

Types

type Config

type Config []Session

Config stores all logged in sessions

func ReadConfig added in v0.2.0

func ReadConfig() (Config, error)

ReadConfig loads sessions from auth.json

type Session

type Session struct {
	Token      string     `json:"token"`
	Email      string     `json:"email"`
	Default    bool       `json:"default"`
	Alias      string     `json:"alias"`
	LoginAt    *time.Time `json:"login_at,omitempty"`
	LastUsedAt *time.Time `json:"last_used_at,omitempty"`
}

Session stores user credentials

func AllSessions added in v0.2.0

func AllSessions() ([]Session, error)

func CurrentSession

func CurrentSession() (Session, error)

func RemoveSession

func RemoveSession() (Session, error)

Jump to

Keyboard shortcuts

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