Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLinkedReasonToAction = ValidationError{Err: errors.New("reason is linked to action")}
View Source
var ErrLinkedReasonToPbehavior = ValidationError{Err: errors.New("reason is linked to pbehavior")}
Functions ¶
Types ¶
type AggregationResult ¶
type AggregationResult struct { Data []Response `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 CreateRequest ¶
type CreateRequest struct { EditRequest ID string `json:"_id" binding:"id"` }
type EditRequest ¶
type ListRequest ¶
type ListRequest struct { pagination.FilteredQuery WithHidden bool `form:"with_hidden"` SortBy string `form:"sort_by" json:"sort_by" binding:"oneoforempty=name created"` }
type Response ¶
type Response struct { ID string `bson:"_id" json:"_id"` Name string `bson:"name" json:"name"` Description string `bson:"description" json:"description"` Deletable *bool `bson:"deletable,omitempty" json:"deletable,omitempty"` Hidden bool `bson:"hidden" json:"hidden"` 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"` }
type Store ¶
type Store interface { Insert(ctx context.Context, model CreateRequest) (*Response, error) Find(ctx context.Context, query ListRequest) (*AggregationResult, error) GetByID(ctx context.Context, id string) (*Response, error) Update(ctx context.Context, model UpdateRequest) (*Response, error) Delete(ctx context.Context, id, userID string) (bool, error) IsLinkedToPbehavior(ctx context.Context, id string) (bool, error) }
type UpdateRequest ¶
type UpdateRequest struct { EditRequest ID string `json:"-"` }
type ValidationError ¶
type ValidationError struct {
Err error
}
func (ValidationError) Error ¶
func (e ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.