Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLinkedReasonToAction = ValidationError(errors.New("reason is linked to action"))
View Source
var ErrLinkedReasonToPbehavior = ValidationError(errors.New("reason is linked to pbehavior"))
Functions ¶
func NewApi ¶
func NewApi( transformer ModelTransformer, store Store, computeChan chan<- pbehavior.ComputeTask, actionLogger logger.ActionLogger, logger zerolog.Logger, ) common.CrudAPI
Types ¶
type AggregationResult ¶
type AggregationResult struct { Data []Reason `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 ListRequest ¶
type ListRequest struct { pagination.FilteredQuery SortBy string `form:"sort_by" json:"sort_by" binding:"oneoforempty=name created"` }
type ModelTransformer ¶
type ModelTransformer interface { TransformCreateRequestToModel(request CreateRequest) *Reason TransformUpdateRequestToModel(request UpdateRequest) *Reason }
func NewModelTransformer ¶
func NewModelTransformer() ModelTransformer
type Store ¶
type UpdateRequest ¶
type ValidationError ¶
type ValidationError error
Click to show internal directories.
Click to hide internal directories.