Documentation ¶
Index ¶
- Variables
- type CreateAccountParams
- type Dbc
- func (dbc *Dbc) CreateAccount(params CreateAccountParams) (*mongo.InsertOneResult, error)
- func (dbc *Dbc) DeleteAccount(id string) error
- func (dbc *Dbc) DeleteAccounts() error
- func (dbc *Dbc) GetAccountByEmail(email string) (models.Account, error)
- func (dbc *Dbc) GetAccountCollection() *mongo.Collection
- func (dbc *Dbc) ListAccount(id string) (models.Account, error)
- func (dbc *Dbc) ListAccounts() ([]*models.Account, error)
- func (dbc *Dbc) UpdateAccount(account *models.Account, id string) error
- type MongoDBStore
- type Querier
- type Role
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Unknown = Role{""} Guest = Role{"guest"} Member = Role{"member"} Moderator = Role{"moderator"} Admin = Role{"admin"} )
View Source
var (
ErrAccountNotFound = errors.New("account not found")
)
Functions ¶
This section is empty.
Types ¶
type CreateAccountParams ¶
type Dbc ¶
type Dbc struct {
// contains filtered or unexported fields
}
func (*Dbc) CreateAccount ¶
func (dbc *Dbc) CreateAccount(params CreateAccountParams) (*mongo.InsertOneResult, error)
func (*Dbc) DeleteAccount ¶
func (*Dbc) DeleteAccounts ¶
func (*Dbc) GetAccountByEmail ¶
func (*Dbc) GetAccountCollection ¶
func (dbc *Dbc) GetAccountCollection() *mongo.Collection
type MongoDBStore ¶
type MongoDBStore struct { *Dbc // contains filtered or unexported fields }
type Querier ¶
type Querier interface { CreateAccount(params CreateAccountParams) (*mongo.InsertOneResult, error) DeleteAccount(id string) error DeleteAccounts() error GetAccountByEmail(email string) (models.Account, error) GetAccountCollection() *mongo.Collection ListAccount(id string) (models.Account, error) ListAccounts() ([]*models.Account, error) UpdateAccount(account *models.Account, id string) error }
Click to show internal directories.
Click to hide internal directories.