Documentation ¶
Index ¶
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 ¶
This section is empty.
Types ¶
type API ¶
func NewApi ¶
func NewApi( transformer ModelTransformer, store Store, computeChan chan<- []string, actionLogger logger.ActionLogger, logger zerolog.Logger, ) API
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 datetime.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(ctx context.Context, request CreateRequest) (*Exception, error) TransformUpdateRequestToModel(ctx context.Context, request UpdateRequest) (*Exception, error) TransformExdatesRequestToModel(ctx context.Context, 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 Store interface { Insert(ctx context.Context, model *Exception) error Find(ctx context.Context, r ListRequest) (*AggregationResult, error) GetOneById(ctx context.Context, id string) (*Exception, error) Update(ctx context.Context, model *Exception) (bool, error) Delete(ctx context.Context, id string) (bool, error) IsLinked(ctx context.Context, id string) (bool, error) Import(ctx context.Context, name, pbhType string, f multipart.File, fh *multipart.FileHeader) (*Exception, error) }
type UpdateRequest ¶
Click to show internal directories.
Click to hide internal directories.