Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type AggregationResult ¶
type AggregationResult struct { Data []User `bson:"data" json:"data"` TotalCount int64 `bson:"total_count" json:"total_count"` }
func (*AggregationResult) GetData ¶
func (r *AggregationResult) GetData() interface{}
func (*AggregationResult) GetTotal ¶
func (r *AggregationResult) GetTotal() int64
type BulkDeleteRequestItem ¶
type BulkDeleteRequestItem struct {
ID string `json:"_id" binding:"required"`
}
type BulkPatchRequestItem ¶
type BulkPatchRequestItem struct { ID string `json:"_id" binding:"required"` PatchEditRequest }
type BulkUpdateRequestItem ¶
type BulkUpdateRequestItem struct { ID string `json:"_id" binding:"required"` EditRequest }
type CreateRequest ¶
type CreateRequest struct { EditRequest Source string `json:"source" binding:"oneoforempty=ldap cas saml"` ExternalID string `json:"external_id"` }
type EditRequest ¶
type EditRequest struct { Password string `json:"password"` Name string `json:"name" binding:"required,max=255"` Firstname string `json:"firstname" binding:"max=255"` Lastname string `json:"lastname" binding:"max=255"` Email string `json:"email" binding:"required,email"` Roles []string `json:"roles" binding:"required,notblank"` UILanguage string `json:"ui_language" binding:"max=255"` UITheme string `json:"ui_theme" binding:"max=255"` IsEnabled *bool `json:"enable" binding:"required"` DefaultView string `json:"defaultview"` Author string `json:"author" swaggerignore:"true"` }
type ListRequest ¶
type ListRequest struct { pagination.FilteredQuery SortBy string `form:"sort_by" binding:"oneoforempty=_id name display_name enable source"` Permission string `form:"permission"` }
type PatchEditRequest ¶
type PatchEditRequest struct { Password *string `json:"password"` Name *string `json:"name" binding:"omitempty,max=255"` Firstname *string `json:"firstname" binding:"omitempty,max=255"` Lastname *string `json:"lastname" binding:"omitempty,max=255"` Email *string `json:"email" binding:"omitempty,email"` Roles []string `json:"roles" binding:"omitempty,notblank"` UILanguage *string `json:"ui_language" binding:"omitempty,max=255"` UITheme *string `json:"ui_theme" binding:"omitempty,max=255"` IsEnabled *bool `json:"enable"` DefaultView *string `json:"defaultview"` Author string `json:"author" swaggerignore:"true"` }
type PatchRequest ¶
type PatchRequest struct { ID string `json:"-"` PatchEditRequest }
type Role ¶
type Store ¶
type Store interface { Find(ctx context.Context, r ListRequest, userID string) (*AggregationResult, error) GetOneBy(ctx context.Context, id string) (*User, error) Insert(ctx context.Context, r CreateRequest) (*User, error) Update(ctx context.Context, r UpdateRequest, userID string) (*User, error) Patch(ctx context.Context, r PatchRequest, userID string) (*User, error) Delete(ctx context.Context, id, userID string) (bool, error) }
type UpdateRequest ¶
type UpdateRequest struct { ID string `json:"-"` EditRequest }
type User ¶
type User struct { ID string `bson:"_id" json:"_id"` Name string `bson:"name" json:"name"` DisplayName string `bson:"display_name" json:"display_name"` Lastname string `bson:"lastname" json:"lastname"` Firstname string `bson:"firstname" json:"firstname"` Email string `bson:"email" json:"email"` Roles []Role `bson:"roles" json:"roles"` UILanguage string `bson:"ui_language" json:"ui_language"` UITheme colortheme.Response `bson:"ui_theme" json:"ui_theme"` Enabled bool `bson:"enable" json:"enable"` DefaultView *View `bson:"defaultview" json:"defaultview"` ExternalID string `bson:"external_id" json:"external_id"` Source string `bson:"source" json:"source"` AuthApiKey string `bson:"authkey" json:"authkey"` Author *author.Author `bson:"author,omitempty" json:"author,omitempty"` Created *datetime.CpsTime `bson:"created,omitempty" json:"created,omitempty" swaggertype:"integer"` Updated *datetime.CpsTime `bson:"updated,omitempty" json:"updated,omitempty" swaggertype:"integer"` ActiveConnects *int64 `bson:"-" json:"active_connects,omitempty"` Deletable *bool `bson:"-" json:"deletable,omitempty"` }
type Validator ¶
type Validator interface { ValidateCreateRequest(ctx context.Context, sl validator.StructLevel) ValidateUpdateRequest(ctx context.Context, sl validator.StructLevel) ValidatePatchRequest(ctx context.Context, sl validator.StructLevel) ValidateBulkUpdateRequestItem(ctx context.Context, sl validator.StructLevel) ValidateBulkPatchRequestItem(ctx context.Context, sl validator.StructLevel) }
Click to show internal directories.
Click to hide internal directories.