user

package
v0.0.0-...-a8b6b34 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountEmpty = errors.New("account can not be empty")

Functions

This section is empty.

Types

type Driver

type Driver interface {
	List() (accounts []string)
	Exist(account string) bool
	Save(account string, user interface{}) error
	Update(account string, user interface{}) error
	Find(account string, user *User)
}

type File

type File struct {
}

func (File) Exist

func (File) Exist(account string) bool

func (File) Find

func (File) Find(account string, user *User)

func (File) List

func (File) List() (accounts []string)

func (File) Save

func (File) Save(account string, user interface{}) error

func (File) Update

func (File) Update(account string, user interface{}) error

type Mock

type Mock struct{}

func (Mock) Exist

func (Mock) Exist(account string) bool

func (Mock) Find

func (Mock) Find(account string, user *User)

func (Mock) List

func (Mock) List() (accounts []string)

func (Mock) Save

func (Mock) Save(account string, user interface{}) error

func (Mock) Update

func (Mock) Update(account string, user interface{}) error

type Profile

type Profile struct {
	Account         string `json:"account"`
	Type            string `json:"type,omitempty"`
	Email           string `json:"email"`
	Line            string `json:"line"`
	LineAccessToken string `json:"lineAccessToken"`
	Messenger       string `json:"messenger"`
	Telegram        string `json:"telegram"`
	TelegramChat    int64  `json:"telegramChat"`
}

type Redis

type Redis struct{}

func (Redis) Exist

func (Redis) Exist(account string) bool

func (Redis) Find

func (Redis) Find(account string, user *User)

func (Redis) List

func (Redis) List() (accounts []string)

func (Redis) Save

func (Redis) Save(account string, data interface{}) error

func (Redis) Update

func (Redis) Update(account string, user interface{}) error

type User

type User struct {
	Enable     bool      `json:"enable"`
	CreateTime time.Time `json:"createTime"`
	UpdateTime time.Time `json:"updateTime"`
	Profile    `json:"Profile"`
	Subscribes subscription.Subscriptions
	// contains filtered or unexported fields
}

func NewUser

func NewUser(drive Driver) *User

func (User) All

func (u User) All() (us []*User)

func (User) Find

func (u User) Find(account string) User

func (User) Save

func (u User) Save() error

func (User) Update

func (u User) Update() error

Jump to

Keyboard shortcuts

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