user

package
v0.0.0-...-7e8a2ca Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package user implements a mutex-protected user store (containing metadata, credentials, and job queue) that is persisted to disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Queue *jobqueue.Queue
	Sub   string

	Token *oauth2.Token

	Drive   *drive.Service
	Default bool

	Name    string // full name, e.g. “Michael Stapelberg”
	Picture string // profile picture URL
	// contains filtered or unexported fields
}

func LoadFromDir

func LoadFromDir(dir string) (*Account, error)

func (*Account) Folder

func (a *Account) Folder() scan2drive.DriveFolder

func (*Account) LoggedIn

func (a *Account) LoggedIn() bool

type Locked

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

func NewLocked

func NewLocked() *Locked

func (*Locked) UpdateFromDir

func (l *Locked) UpdateFromDir(stateDir, scansDir string, oauthConfig *oauth2.Config) error

func (*Locked) User

func (l *Locked) User(sub string) *Account

func (*Locked) UserByName

func (l *Locked) UserByName(name string) *Account

func (*Locked) Users

func (l *Locked) Users() map[string]*Account

Jump to

Keyboard shortcuts

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