session

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 6 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 Write added in v0.2.3

func Write(sessions []*Session) error

Write writes session data to auth.json

Types

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 CurrentSession

func CurrentSession() (*Session, error)

func Read added in v0.2.3

func Read() ([]*Session, error)

Read loads sessions from auth.json

func RemoveSession

func RemoveSession() (*Session, error)

Jump to

Keyboard shortcuts

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