user

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrNotFound

type ErrNotFound struct {
	Name string
}

func (*ErrNotFound) Error

func (u *ErrNotFound) Error() string

type ListFilter

type ListFilter struct {
	Names       []string
	TransportID string
}

type Payment

type Payment struct {
}

type PaymentMethod

type PaymentMethod int
const (
	PaymentMethodInvalid PaymentMethod = iota
	PaymentMethodBit
	PaymentMethodPaybox
	PaymentMethodPepper
)

func (PaymentMethod) String

func (p PaymentMethod) String() string

type Store

type Store interface {
	AddUser(ctx context.Context, user *User) error
	GetUser(ctx context.Context, id string) (*User, error)
	ListUsers(ctx context.Context, filter ListFilter) ([]*User, error)
}

type User

type User struct {
	ID                 string `db:"id"`
	FullName           string `db:"full_name"`
	Email              string `db:"email"`
	Phone              string `db:"phone"`
	PaymentPreferences []PaymentMethod
	Timezone           string `db:"timezone"`
	TransportID        string `db:"transport_id"` // For example slack user ID
}

Jump to

Keyboard shortcuts

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