Documentation ¶
Index ¶
- Variables
- func NewApi(transformer ModelTransformer, store Store, ...) common.CrudAPI
- func ValidateExdateRequest(sl validator.StructLevel)
- type AggregationResult
- type CreateRequest
- type Exception
- type Exdate
- type ExdateRequest
- type ListRequest
- type ModelTransformer
- type Request
- type Store
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLinkedException = errors.New("exception is linked with pbehavior")
View Source
var ErrTypeNotExists = errors.New("type doesn't exist")
Functions ¶
func NewApi ¶
func NewApi( transformer ModelTransformer, store Store, computeChan chan<- pbehavior.ComputeTask, actionLogger logger.ActionLogger, logger zerolog.Logger, ) common.CrudAPI
func ValidateExdateRequest ¶
func ValidateExdateRequest(sl validator.StructLevel)
Types ¶
type AggregationResult ¶
type AggregationResult struct { Data []Exception `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 Exception ¶
type Exception struct { ID string `bson:"_id" json:"_id"` Name string `bson:"name" json:"name"` Description string `bson:"description" json:"description"` Exdates []Exdate `bson:"exdates" json:"exdates"` Created types.CpsTime `bson:"created" json:"created" swaggertype:"integer"` Deletable *bool `bson:"deletable,omitempty" json:"deletable,omitempty"` }
type ExdateRequest ¶
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) (*Exception, error) TransformUpdateRequestToModel(request UpdateRequest) (*Exception, error) TransformExdatesRequestToModel(request []ExdateRequest) ([]Exdate, error) }
func NewModelTransformer ¶
func NewModelTransformer(dbClient mongo.DbClient) ModelTransformer
type Request ¶
type Request struct { Name string `json:"name" binding:"required,max=255"` Description string `json:"description" binding:"required,max=255"` Exdates []ExdateRequest `json:"exdates" binding:"required,notblank,dive"` }
type Store ¶
type UpdateRequest ¶
Click to show internal directories.
Click to hide internal directories.