Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewValidator ¶
Types ¶
type AggregationResult ¶
type AggregationResult struct { Data []BroadcastMessage `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 BroadcastMessage ¶
type FilteredQuery ¶
type FilteredQuery struct { pagination.FilteredQuery SortBy string `json:"sort_by" form:"sort_by" binding:"oneoforempty=_id message"` }
type Payload ¶
type Payload struct { Color string `bson:"color" json:"color" binding:"required,iscolor"` Message string `bson:"message" json:"message" binding:"required"` Start datetime.CpsTime `bson:"start" json:"start" binding:"required" swaggertype:"integer"` End datetime.CpsTime `bson:"end" json:"end" binding:"required" swaggertype:"integer"` Created *datetime.CpsTime `bson:"created,omitempty" json:"created,omitempty" swaggertype:"integer"` Updated *datetime.CpsTime `bson:"updated,omitempty" json:"updated,omitempty" swaggertype:"integer"` Maintenance bool `bson:"-" json:"maintenance,omitempty"` }
type Store ¶
type Store interface { Insert(ctx context.Context, model *BroadcastMessage) error GetById(ctx context.Context, id string) (*BroadcastMessage, error) Find(ctx context.Context, query FilteredQuery) (*AggregationResult, error) Update(ctx context.Context, model *BroadcastMessage) (bool, error) Delete(ctx context.Context, id string) (bool, error) GetActive(ctx context.Context) ([]BroadcastMessage, error) }
Click to show internal directories.
Click to hide internal directories.