Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 CreateRequest ¶
type CreateRequest struct { EditRequest `bson:",inline"` ID string `bson:"_id" json:"_id" binding:"id"` }
type EditRequest ¶
type EditRequest 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"` Author string `bson:"author,omitempty" json:"author,omitempty" swaggerignore:"true"` Created *datetime.CpsTime `bson:"created,omitempty" json:"-" swaggerignore:"true"` Updated *datetime.CpsTime `bson:"updated,omitempty" json:"-" swaggerignore:"true"` }
type FilteredQuery ¶
type FilteredQuery struct { pagination.FilteredQuery SortBy string `json:"sort_by" form:"sort_by" binding:"oneoforempty=_id message"` }
type Response ¶
type Response struct { ID string `bson:"_id" json:"_id"` Color string `bson:"color" json:"color"` Message string `bson:"message" json:"message"` Start datetime.CpsTime `bson:"start" json:"start" swaggertype:"integer"` End datetime.CpsTime `bson:"end" json:"end" swaggertype:"integer"` Author *author.Author `bson:"author,omitempty" json:"author,omitempty"` 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 Service ¶
Service is used to implement websocket room for broadcast messages.
type Store ¶
type Store interface { Insert(ctx context.Context, r CreateRequest) (*Response, error) GetByID(ctx context.Context, id string) (*Response, error) Find(ctx context.Context, query FilteredQuery) (*AggregationResult, error) Update(ctx context.Context, r UpdateRequest) (*Response, error) Delete(ctx context.Context, id, userID string) (bool, error) GetActive(ctx context.Context) ([]Response, error) }
type UpdateRequest ¶
type UpdateRequest struct { EditRequest `bson:",inline"` ID string `bson:"_id" json:"-"` }
Click to show internal directories.
Click to hide internal directories.