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 BroadcastMessage struct { ID string `bson:"_id" json:"_id" binding:"id"` BroadcastMessagePayload `bson:",inline"` }
type BroadcastMessagePayload ¶
type BroadcastMessagePayload struct { Color string `bson:"color" json:"color" binding:"required,iscolor"` Message string `bson:"message" json:"message" binding:"required"` Start types.CpsTime `bson:"start" json:"start" binding:"required" swaggertype:"integer"` End types.CpsTime `bson:"end" json:"end" binding:"required" swaggertype:"integer"` Created *types.CpsTime `bson:"created,omitempty" json:"created,omitempty" swaggertype:"integer"` Updated *types.CpsTime `bson:"updated,omitempty" json:"updated,omitempty" swaggertype:"integer"` }
type FilteredQuery ¶
type FilteredQuery struct { pagination.FilteredQuery SortBy string `json:"sort_by" form:"sort_by" binding:"oneoforempty=_id message"` }
type Store ¶
type Store interface { Insert(model *BroadcastMessage) error GetById(id string) (*BroadcastMessage, error) Find(query FilteredQuery) (*AggregationResult, error) Update(model *BroadcastMessage) (bool, error) Delete(id string) (bool, error) GetActive() ([]*BroadcastMessage, error) }
Click to show internal directories.
Click to hide internal directories.