Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateEditRequest ¶
func ValidateEditRequest(sl validator.StructLevel)
Types ¶
type API ¶
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 BulkDeleteRequestItem ¶
type BulkDeleteRequestItem struct {
ID string `json:"_id" binding:"required"`
}
type CategoriesRequest ¶
type EditRequest ¶
type EditRequest struct { ID string `json:"-"` Name string `json:"name" binding:"required,max=255"` Type string `json:"type" binding:"required,oneof=alarm entity"` Enabled *bool `json:"enabled" binding:"required"` Links []link.Parameters `json:"links" binding:"dive"` SourceCode string `json:"source_code"` Author string `json:"author" swaggerignore:"true"` ExternalData map[string]link.ExternalDataParameters `bson:"external_data" json:"external_data" binding:"dive"` common.AlarmPatternFieldsRequest common.EntityPatternFieldsRequest }
type ListRequest ¶
type ListRequest struct { pagination.FilteredQuery SortBy string `json:"sort_by" form:"sort_by" binding:"oneoforempty=_id name author.name author.display_name created updated"` }
type Response ¶
type Response struct { ID string `bson:"_id" json:"_id"` Name string `bson:"name" json:"name"` Type string `bson:"type" json:"type"` Enabled bool `bson:"enabled" json:"enabled"` Links []link.Parameters `bson:"links" json:"links,omitempty"` SourceCode string `bson:"source_code" json:"source_code,omitempty"` Author *author.Author `bson:"author" json:"author"` Created datetime.CpsTime `bson:"created,omitempty" json:"created,omitempty" swaggertype:"integer"` Updated datetime.CpsTime `bson:"updated,omitempty" json:"updated,omitempty" swaggertype:"integer"` ExternalData map[string]link.ExternalDataParameters `bson:"external_data" json:"external_data"` savedpattern.EntityPatternFields `bson:",inline"` savedpattern.AlarmPatternFields `bson:",inline"` }
type Store ¶
type Store interface { Insert(ctx context.Context, r EditRequest) (*Response, error) GetByID(ctx context.Context, id string) (*Response, error) Find(ctx context.Context, r ListRequest) (*AggregationResult, error) Update(ctx context.Context, r EditRequest) (*Response, error) Delete(ctx context.Context, id, userID string) (bool, error) GetCategories(ctx context.Context, r CategoriesRequest) (*CategoryResponse, error) }
Click to show internal directories.
Click to hide internal directories.