Documentation ¶
Index ¶
- Variables
- type MongoDBRepository
- func (r *MongoDBRepository) Create(ctx context.Context, user *types.User) (string, error)
- func (r *MongoDBRepository) Delete(ctx context.Context, id string) error
- func (r *MongoDBRepository) FindAll(context.Context, *types.User) ([]*types.User, error)
- func (r *MongoDBRepository) FindByID(ctx context.Context, id string) (*types.User, error)
- func (r *MongoDBRepository) FindBySample(ctx context.Context, user *types.User) ([]*types.User, error)
- func (r *MongoDBRepository) Lock(ctx context.Context, id string) error
- func (r *MongoDBRepository) Update(ctx context.Context, user *types.User) error
- type PolicyService
- type Repository
- type Service
- func (s *Service) Create(ctx context.Context, user *types.User) (string, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) FindAll(ctx context.Context) ([]*types.User, error)
- func (s *Service) FindByID(ctx context.Context, id string) (*types.User, error)
- func (s *Service) FindBySample(ctx context.Context, user *types.User) ([]*types.User, error)
- func (s *Service) IsAllowed(ctx context.Context, action string) error
- func (s *Service) Lock(ctx context.Context, id string) error
- func (s *Service) Update(ctx context.Context, user *types.User) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ActionCreate = "user.create" ActionUpdate = "user.update" ActionDelete = "user.delete" ActionLock = "user.lock" ActionReadList = "user.read.list" PermissionResource = "user" ErrPermissionDenied = errors.New("permission denied") )
Functions ¶
This section is empty.
Types ¶
type MongoDBRepository ¶
type MongoDBRepository struct {
// contains filtered or unexported fields
}
func (*MongoDBRepository) Delete ¶
func (r *MongoDBRepository) Delete(ctx context.Context, id string) error
func (*MongoDBRepository) FindBySample ¶
type PolicyService ¶
type Repository ¶
type Repository interface { Create(context.Context, *types.User) (string, error) Delete(context.Context, string) error Update(context.Context, *types.User) error Lock(context.Context, string) error FindBySample(context.Context, *types.User) ([]*types.User, error) FindAll(context.Context) ([]*types.User, error) FindByID(ctx context.Context, id string) (*types.User, error) }
Click to show internal directories.
Click to hide internal directories.