Documentation
¶
Index ¶
- type PermissionService
- type PermissionServiceImpl
- func (p *PermissionServiceImpl) AsPermissionService() PermissionService
- func (p *PermissionServiceImpl) GetPermissionId(name string) (int64, error)
- func (p *PermissionServiceImpl) GetPermissions(ctx context.Context) (map[string]int64, error)
- func (p *PermissionServiceImpl) GetPermissionsForRole(ctx context.Context, roleId int64) (map[string]bool, error)
- func (p *PermissionServiceImpl) HasPermission(ctx context.Context, userID int64, permission string) (bool, error)
- func (p *PermissionServiceImpl) UserHasPermission(ctx context.Context, userId int64, permission string) (bool, error)
- func (p *PermissionServiceImpl) Warmup(ctx context.Context, allPermissions []string) error
- type Response
- type RoleAggregate
- func (a *RoleAggregate) ApplyEventState(eventState evercore.EventState, eventTime time.Time, reference string) error
- func (a *RoleAggregate) ApplySnapshot(snapshot *evercore.Snapshot) error
- func (a *RoleAggregate) AsAggregate() evercore.Aggregate
- func (a *RoleAggregate) GetAggregateType() string
- func (a *RoleAggregate) GetId() int64
- func (a *RoleAggregate) GetSequence() int64
- func (a *RoleAggregate) GetSnapshotFrequency() int64
- func (a *RoleAggregate) GetSnapshotState() (*string, error)
- func (a *RoleAggregate) SetId(id int64)
- func (a *RoleAggregate) SetSequence(seq int64)
- type RolePermissions
- type RoleService
- type RoleServiceImpl
- func (s RoleServiceImpl) AddPermissionToRole(ctx context.Context, role string, permissionId int64, agent string) error
- func (s RoleServiceImpl) AddRole(ctx context.Context, name string, agent string) (int64, error)
- func (s RoleServiceImpl) GetRoleList(ctx context.Context) (map[string]int64, error)
- func (s RoleServiceImpl) RemovePermissionFromRole(ctx context.Context, role string, permissionId int64, agent string) error
- type RoleState
- type UserAggregate
- type UserCreateCommand
- type UserCreateResponse
- type UserLoginCommand
- type UserLoginResponse
- type UserRoles
- type UserService
- type UserServiceImpl
- func (s UserServiceImpl) CreateUser(ctx context.Context, command UserCreateCommand, agent string) (UserCreateResponse, error)
- func (s UserServiceImpl) GetUserByEmail(ctx context.Context, email string) (*UserAggregate, error)
- func (s UserServiceImpl) GetUserRolesIds(ctx context.Context, userId int64) ([]int64, error)
- func (s UserServiceImpl) Login(ctx context.Context, command UserLoginCommand) (*UserLoginResponse, error)
- func (s UserServiceImpl) ProjectRoles(ctx context.Context, userAggregate *UserAggregate) error
- func (s UserServiceImpl) ProjectUser(ctx context.Context, userAggregate *UserAggregate) error
- func (s UserServiceImpl) SetRoles(ctx context.Context, command UserSetRolesComand, agent string) (UserSetRolesResponse, error)
- func (s UserServiceImpl) UpdateUser(ctx context.Context, command UserUpdateCommand, agent string) (UserUpdatedResponse, error)
- type UserSetRolesComand
- type UserSetRolesResponse
- type UserUpdateCommand
- type UserUpdatedResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PermissionService ¶
type PermissionService interface { UserHasPermission(ctx context.Context, userId int64, permission string) (bool, error) GetPermissionId(name string) (int64, error) GetPermissions(ctx context.Context) (map[string]int64, error) GetPermissionsForRole(ctx context.Context, roleId int64) (map[string]bool, error) HasPermission(ctx context.Context, userID int64, permission string) (bool, error) Warmup(ctx context.Context, allPermissions []string) error }
func NewPermissionService ¶
func NewPermissionService(dbadapter ubdata.DataAdapter, roleService RoleService) PermissionService
type PermissionServiceImpl ¶
type PermissionServiceImpl struct {
// contains filtered or unexported fields
}
func (*PermissionServiceImpl) AsPermissionService ¶
func (p *PermissionServiceImpl) AsPermissionService() PermissionService
func (*PermissionServiceImpl) GetPermissionId ¶
func (p *PermissionServiceImpl) GetPermissionId(name string) (int64, error)
func (*PermissionServiceImpl) GetPermissions ¶
func (*PermissionServiceImpl) GetPermissionsForRole ¶
func (*PermissionServiceImpl) HasPermission ¶
func (*PermissionServiceImpl) UserHasPermission ¶
type Response ¶
type Response struct { Status string `json:"status"` Message string `json:"message"` ValidationIssues *ubvalidation.ValidationIssues `json:"validationIssues,omitempty"` }
type RoleAggregate ¶
evercore:aggregate
func NewRoleAggregate ¶
func NewRoleAggregate() RoleAggregate
func (*RoleAggregate) ApplyEventState ¶
func (a *RoleAggregate) ApplyEventState(eventState evercore.EventState, eventTime time.Time, reference string) error
func (*RoleAggregate) ApplySnapshot ¶
func (a *RoleAggregate) ApplySnapshot(snapshot *evercore.Snapshot) error
func (*RoleAggregate) AsAggregate ¶
func (a *RoleAggregate) AsAggregate() evercore.Aggregate
func (*RoleAggregate) GetAggregateType ¶
func (a *RoleAggregate) GetAggregateType() string
func (*RoleAggregate) GetId ¶
func (a *RoleAggregate) GetId() int64
func (*RoleAggregate) GetSequence ¶
func (a *RoleAggregate) GetSequence() int64
func (*RoleAggregate) GetSnapshotFrequency ¶
func (a *RoleAggregate) GetSnapshotFrequency() int64
func (*RoleAggregate) GetSnapshotState ¶
func (a *RoleAggregate) GetSnapshotState() (*string, error)
func (*RoleAggregate) SetId ¶
func (a *RoleAggregate) SetId(id int64)
func (*RoleAggregate) SetSequence ¶
func (a *RoleAggregate) SetSequence(seq int64)
type RolePermissions ¶
type RoleService ¶
type RoleService interface { AddRole(ctx context.Context, name string, agent string) (int64, error) AddPermissionToRole(ctx context.Context, role string, permissionId int64, agent string) error RemovePermissionFromRole(ctx context.Context, role string, permissionId int64, agent string) error GetRoleList(ctx context.Context) (map[string]int64, error) }
func CreateRoleService ¶
func CreateRoleService( store *evercore.EventStore, dbadapter ubdata.DataAdapter) RoleService
type RoleServiceImpl ¶
type RoleServiceImpl struct {
// contains filtered or unexported fields
}
func (RoleServiceImpl) AddPermissionToRole ¶
func (RoleServiceImpl) GetRoleList ¶
func (RoleServiceImpl) RemovePermissionFromRole ¶
type UserAggregate ¶
evercore:aggregate
type UserCreateCommand ¶
type UserCreateCommand struct { Email string `json:"email"` Password string `json:"password"` FirstName string `json:"firstName"` LastName string `json:"lastName"` DisplayName string `json:"displayName"` }
func (UserCreateCommand) Validate ¶
func (r UserCreateCommand) Validate() *ubvalidation.ValidationIssues
type UserCreateResponse ¶
type UserLoginCommand ¶
type UserLoginResponse ¶
type UserService ¶
type UserService interface { CreateUser(ctx context.Context, command UserCreateCommand, agent string) (UserCreateResponse, error) UpdateUser(ctx context.Context, command UserUpdateCommand, agent string) (UserUpdatedResponse, error) GetUserByEmail(ctx context.Context, email string) (*UserAggregate, error) Login(ctx context.Context, command UserLoginCommand) (*UserLoginResponse, error) SetRoles(ctx context.Context, command UserSetRolesComand, agent string) (UserSetRolesResponse, error) GetUserRolesIds(ctx context.Context, userId int64) ([]int64, error) }
func CreateUserService ¶
func CreateUserService(store *evercore.EventStore, hashingService ubsecurity.HashGenerator, dbadapter ubdata.DataAdapter) UserService
type UserServiceImpl ¶
type UserServiceImpl struct {
// contains filtered or unexported fields
}
func (UserServiceImpl) CreateUser ¶
func (s UserServiceImpl) CreateUser(ctx context.Context, command UserCreateCommand, agent string) (UserCreateResponse, error)
func (UserServiceImpl) GetUserByEmail ¶
func (s UserServiceImpl) GetUserByEmail(ctx context.Context, email string) (*UserAggregate, error)
func (UserServiceImpl) GetUserRolesIds ¶
func (UserServiceImpl) Login ¶
func (s UserServiceImpl) Login(ctx context.Context, command UserLoginCommand) (*UserLoginResponse, error)
func (UserServiceImpl) ProjectRoles ¶
func (s UserServiceImpl) ProjectRoles(ctx context.Context, userAggregate *UserAggregate) error
func (UserServiceImpl) ProjectUser ¶
func (s UserServiceImpl) ProjectUser(ctx context.Context, userAggregate *UserAggregate) error
ProjectUser projects the user to the relational database.
func (UserServiceImpl) SetRoles ¶
func (s UserServiceImpl) SetRoles(ctx context.Context, command UserSetRolesComand, agent string) (UserSetRolesResponse, error)
func (UserServiceImpl) UpdateUser ¶
func (s UserServiceImpl) UpdateUser(ctx context.Context, command UserUpdateCommand, agent string) (UserUpdatedResponse, error)
type UserSetRolesComand ¶
type UserSetRolesResponse ¶
type UserSetRolesResponse struct {
Response `json:"response"`
}
type UserUpdateCommand ¶
type UserUpdateCommand struct { Id int64 `json:"id"` Password *string `json:"password,omitempty"` FirstName *string `json:"firstName,omitempty"` LastName *string `json:"lastName,omitempty"` DisplayName *string `json:"displayName,omitempty"` }
func (UserUpdateCommand) Validate ¶
func (r UserUpdateCommand) Validate() *ubvalidation.ValidationIssues
type UserUpdatedResponse ¶
type UserUpdatedResponse struct {
Response
}
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
The algorithms package contains useful data structures for re-use
|
The algorithms package contains useful data structures for re-use |
Security related tools.
|
Security related tools. |
Click to show internal directories.
Click to hide internal directories.