account

package
v0.0.0-...-8495beb Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "Account"

Name is the role/resource name.

Variables

This section is empty.

Functions

func WithBio

func WithBio(bio string) option

func WithID

func WithID(id AccountID) option

Types

type Account

type Account struct {
	ID          AccountID
	Email       string
	Name        string
	Bio         optional.Optional[string]
	Admin       bool
	ThreadCount int
	PostCount   int
	Interests   []tag.Tag

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt optional.Optional[time.Time]
}

func FromModel

func FromModel(u model.Account) (o Account)

func (*Account) GetResourceName

func (*Account) GetResourceName() string

func (*Account) GetRole

func (*Account) GetRole() string

type AccountID

type AccountID xid.ID

func (AccountID) String

func (u AccountID) String() string

type Repository

type Repository interface {
	Create(ctx context.Context, email string, username string, opts ...option) (*Account, error)

	GetByID(ctx context.Context, id AccountID) (*Account, error)
	LookupByEmail(ctx context.Context, email string) (*Account, bool, error)
	List(ctx context.Context, sort string, max, skip int) ([]Account, error)
}

func New

func New(db *model.Client) Repository

func NewLocal

func NewLocal() Repository

Jump to

Keyboard shortcuts

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