Documentation
¶
Index ¶
- type UserCreateDB
- type UserDB
- type UserDBFilter
- type UserExistsDB
- type UserRepositoryInfra
- func (repository *UserRepositoryInfra) Add(ctx context.Context, db UserCreateDB) (*UserDB, error)
- func (repository *UserRepositoryInfra) Edit(ctx context.Context, db UserUpdateDB) (*persistence.ExecuteStmtWithStorageResultOutput, error)
- func (repository *UserRepositoryInfra) Exists(ctx context.Context, id entities.ApplicationStandardID) ([]UserExistsDB, error)
- func (repository *UserRepositoryInfra) Get(ctx context.Context, id entities.ApplicationStandardID) ([]UserDB, error)
- func (repository *UserRepositoryInfra) List(ctx context.Context, filters UserDBFilter) ([]UserDB, error)
- func (repository *UserRepositoryInfra) Remove(ctx context.Context, id entities.ApplicationStandardID) (*persistence.ExecuteStmtWithStorageResultOutput, error)
- type UserRepositoryInfraOptions
- type UserUpdateDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserCreateDB ¶
type UserCreateDB struct { // UserDB is the data struct of the resource in the database UserDB }
UserCreateDB is the data struct of the creation of a resource in the database
type UserDB ¶
type UserDB struct { // ApplicationStandardID is the ID of the resource entities.ApplicationStandardID // InternalResourceID is the ID used to reference a resource internally in the application InternalResourceID string `storage:"internal_resource_id"` // Roles are the roles in the RBAC system for the User Roles string `storage:"roles"` // Description of the resource Description string `storage:"description"` // CreationDate is the timestamp of the moment of the creation of the resource CreationDate int64 `storage:"creation_date"` // LastUpdate is the timestamp of the moment of the last edition of the resource LastUpdate int64 `storage:"last_update"` // ResourceVersion is the identifier of the current version of the resource ResourceVersion string `storage:"resource_version"` }
UserDB is the data struct of the resource in the database
type UserDBFilter ¶
type UserDBFilter struct { // UserDB is the data struct of the resource in the database UserDB // Order is the order of the list based on an attribute Order *persistence.Order `valid:"optional"` // FilterGroup is a collection of filters FilterGroup *persistence.FilterGroup `valid:"optional"` // Pagination is the page info of the list Pagination *persistence.Pagination `valid:"optional"` }
UserDBFilter to filter lists of resources from the database
func (*UserDBFilter) AppendFilter ¶
func (filter *UserDBFilter) AppendFilter(theFilter persistence.Filter)
AppendFilter Append filter.
func (*UserDBFilter) Paged ¶
func (filter *UserDBFilter) Paged(limit, offset int) *UserDBFilter
Paged creates a pagination filter.
func (*UserDBFilter) Sort ¶
func (filter *UserDBFilter) Sort(orderBy string, orderDirection persistence.OrderDirection) *UserDBFilter
Sort creates a sorting filter.
type UserExistsDB ¶
type UserExistsDB struct { // Exists is true if the resource exists Exists bool `storage:"exists_result" valid:"required"` }
UserExistsDB is the data struct to check if a resource exists in the database
type UserRepositoryInfra ¶
type UserRepositoryInfra struct {
// contains filtered or unexported fields
}
func ProvideUserRepositoryInfra ¶
func ProvideUserRepositoryInfra(options UserRepositoryInfraOptions) (*UserRepositoryInfra, error)
func (*UserRepositoryInfra) Add ¶
func (repository *UserRepositoryInfra) Add(ctx context.Context, db UserCreateDB) (*UserDB, error)
func (*UserRepositoryInfra) Edit ¶
func (repository *UserRepositoryInfra) Edit(ctx context.Context, db UserUpdateDB) (*persistence.ExecuteStmtWithStorageResultOutput, error)
func (*UserRepositoryInfra) Exists ¶
func (repository *UserRepositoryInfra) Exists(ctx context.Context, id entities.ApplicationStandardID) ([]UserExistsDB, error)
func (*UserRepositoryInfra) Get ¶
func (repository *UserRepositoryInfra) Get(ctx context.Context, id entities.ApplicationStandardID) ([]UserDB, error)
func (*UserRepositoryInfra) List ¶
func (repository *UserRepositoryInfra) List(ctx context.Context, filters UserDBFilter) ([]UserDB, error)
func (*UserRepositoryInfra) Remove ¶
func (repository *UserRepositoryInfra) Remove(ctx context.Context, id entities.ApplicationStandardID) (*persistence.ExecuteStmtWithStorageResultOutput, error)
type UserRepositoryInfraOptions ¶
type UserRepositoryInfraOptions struct {
GenericStorage persistence.Storage
}
type UserUpdateDB ¶
type UserUpdateDB struct { // UserDB is the data struct of the resource in the database UserDB // NewResourceVersion is the new resource version after the edition NewResourceVersion string `storage:"new_resource_version"` }
UserUpdateDB is the data struct of the update of a resource in the database
Click to show internal directories.
Click to hide internal directories.