users

package
v0.0.0-...-24d5ccf Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	Id          string
	Email       string
	DisplayName string
}

type UserProvider

type UserProvider interface {
	Authenticate(userEmail string, userPass string) (*User, error)
	SignUp(userEmail, userPass, displayName string) (*User, error)
	GetById(id string) (*User, error)
	GetByDisplayName(name string) (*User, error)
	GetByEmail(email string) (*User, error)
	GetStats() (int, []User, error)
}

type UserRecord

type UserRecord struct {
	Id           string `json:"id"`
	Email        string `json:"email"`
	PasswordHash string `json:"pass"`
	DisplayName  string `json:"display_name"`
}

func (*UserRecord) ToUser

func (r *UserRecord) ToUser() *User

type UsersFileStore

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

func NewUsersFileStore

func NewUsersFileStore(filename string) (*UsersFileStore, error)

func (*UsersFileStore) Authenticate

func (p *UsersFileStore) Authenticate(userEmail string, userPass string) (*User, error)

func (*UsersFileStore) GetByDisplayName

func (p *UsersFileStore) GetByDisplayName(displayName string) (*User, error)

func (*UsersFileStore) GetByEmail

func (p *UsersFileStore) GetByEmail(email string) (*User, error)

func (*UsersFileStore) GetById

func (p *UsersFileStore) GetById(id string) (*User, error)

func (*UsersFileStore) GetStats

func (p *UsersFileStore) GetStats() (int, []User, error)

func (*UsersFileStore) SignUp

func (p *UsersFileStore) SignUp(userEmail, userPass, displayName string) (*User, error)

Jump to

Keyboard shortcuts

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