mongo

package
v0.0.0-...-9135915 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminsRepo

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

func NewAdminsRepo

func NewAdminsRepo(db *mongo.Database, roles admins.RolesRepo) (*AdminsRepo, error)

func (*AdminsRepo) AssignRoleByID

func (r *AdminsRepo) AssignRoleByID(ctx context.Context, roleName string, adminID int64) (*admins.Admin, error)

func (*AdminsRepo) AssignRoleByIDs

func (r *AdminsRepo) AssignRoleByIDs(ctx context.Context, roleName string, adminIDs ...int64) ([]*admins.Admin, error)

func (*AdminsRepo) Create

func (r *AdminsRepo) Create(ctx context.Context, adms ...*admins.Admin) ([]*admins.Admin, error)

func (*AdminsRepo) CreateIfNotExists

func (r *AdminsRepo) CreateIfNotExists(ctx context.Context, adms ...*admins.Admin) ([]*admins.Admin, error)

func (*AdminsRepo) DeleteByIDs

func (r *AdminsRepo) DeleteByIDs(ctx context.Context, adminIDs ...int64) error

func (*AdminsRepo) GetAll

func (r *AdminsRepo) GetAll(ctx context.Context) ([]*admins.Admin, error)

func (*AdminsRepo) GetAllShouldBeNotifiedAbout

func (r *AdminsRepo) GetAllShouldBeNotifiedAbout(ctx context.Context,
	notificationType admins.NotificationType) ([]*admins.Admin, error)

func (*AdminsRepo) GetByID

func (r *AdminsRepo) GetByID(ctx context.Context, adminID int64) (*admins.Admin, error)

func (*AdminsRepo) GetByIDs

func (r *AdminsRepo) GetByIDs(ctx context.Context, adminIDs ...int64) ([]*admins.Admin, error)

func (*AdminsRepo) GetRoleByID

func (r *AdminsRepo) GetRoleByID(ctx context.Context, adminID int64) (*admins.Role, error)

func (*AdminsRepo) HasScopesByID

func (r *AdminsRepo) HasScopesByID(ctx context.Context, adminID int64, scopes ...admins.Scope) (bool, error)

type RolesRepo

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

func NewRolesRepo

func NewRolesRepo(db *mongo.Database) (*RolesRepo, error)

func (*RolesRepo) AddScopes

func (r *RolesRepo) AddScopes(ctx context.Context, scopes []admins.Scope, names ...string) ([]*admins.Role, error)

func (*RolesRepo) Create

func (r *RolesRepo) Create(ctx context.Context, roles ...*admins.Role) ([]*admins.Role, error)

func (*RolesRepo) CreateIfNotExists

func (r *RolesRepo) CreateIfNotExists(ctx context.Context, roles ...*admins.Role) ([]*admins.Role, error)

func (*RolesRepo) DeleteByNames

func (r *RolesRepo) DeleteByNames(ctx context.Context, names ...string) error

func (*RolesRepo) GetAll

func (r *RolesRepo) GetAll(ctx context.Context) ([]*admins.Role, error)

func (*RolesRepo) GetByName

func (r *RolesRepo) GetByName(ctx context.Context, name string) (*admins.Role, error)

func (*RolesRepo) GetByNames

func (r *RolesRepo) GetByNames(ctx context.Context, names ...string) ([]*admins.Role, error)

func (*RolesRepo) SetScopes

func (r *RolesRepo) SetScopes(ctx context.Context, scopes []admins.Scope, names ...string) ([]*admins.Role, error)

Jump to

Keyboard shortcuts

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