Documentation ¶
Index ¶
- func NewMessageGroupRepo() repository.EventGroupRepo
- func NewMessageRepo() repository.EventRepo
- func NewRuleRepo() repository.RuleRepo
- type EventGroupRepo
- func (m *EventGroupRepo) Add(grp repository.EventGroup) (id primitive.ObjectID, err error)
- func (m *EventGroupRepo) CollectingGroup(rule repository.EventGroupRule) (group repository.EventGroup, err error)
- func (m *EventGroupRepo) Count(filter bson.M) (int64, error)
- func (m *EventGroupRepo) Delete(filter bson.M) error
- func (m *EventGroupRepo) DeleteID(id primitive.ObjectID) error
- func (m *EventGroupRepo) Find(filter bson.M) (grps []repository.EventGroup, err error)
- func (m *EventGroupRepo) Get(id primitive.ObjectID) (grp repository.EventGroup, err error)
- func (m *EventGroupRepo) LastGroup(filter bson.M) (grp repository.EventGroup, err error)
- func (m *EventGroupRepo) Paginate(filter bson.M, offset, limit int64) (grps []repository.EventGroup, next int64, err error)
- func (m *EventGroupRepo) StatByDatetimeCount(ctx context.Context, startTime, endTime time.Time, hour int64) ([]repository.EventGroupByDatetimeCount, error)
- func (m *EventGroupRepo) StatByRuleCount(ctx context.Context, startTime, endTime time.Time) ([]repository.EventGroupByRuleCount, error)
- func (m *EventGroupRepo) StatByUserCount(ctx context.Context, startTime, endTime time.Time) ([]repository.EventGroupByUserCount, error)
- func (m *EventGroupRepo) Traverse(filter bson.M, cb func(grp repository.EventGroup) error) error
- func (m *EventGroupRepo) UpdateID(id primitive.ObjectID, grp repository.EventGroup) error
- type MessageRepo
- func (m *MessageRepo) Add(msg repository.Event) (id primitive.ObjectID, err error)
- func (m *MessageRepo) AddWithContext(ctx context.Context, msg repository.Event) (id primitive.ObjectID, err error)
- func (m *MessageRepo) Count(filter interface{}) (int64, error)
- func (m *MessageRepo) Delete(filter interface{}) error
- func (m *MessageRepo) DeleteID(id primitive.ObjectID) error
- func (m *MessageRepo) Find(filter interface{}) (messages []repository.Event, err error)
- func (m *MessageRepo) Get(id primitive.ObjectID) (msg repository.Event, err error)
- func (m *MessageRepo) Paginate(filter interface{}, offset, limit int64) (messages []repository.Event, next int64, err error)
- func (m *MessageRepo) Traverse(filter interface{}, cb func(msg repository.Event) error) error
- func (m *MessageRepo) UpdateID(id primitive.ObjectID, update repository.Event) error
- type RuleRepo
- func (r *RuleRepo) Add(rule repository.Rule) (id primitive.ObjectID, err error)
- func (r *RuleRepo) Count(filter bson.M) (int64, error)
- func (r *RuleRepo) Delete(filter bson.M) error
- func (r *RuleRepo) DeleteID(id primitive.ObjectID) error
- func (r *RuleRepo) Find(filter bson.M) (rules []repository.Rule, err error)
- func (r *RuleRepo) Get(id primitive.ObjectID) (rule repository.Rule, err error)
- func (r *RuleRepo) Paginate(filter interface{}, offset, limit int64) (rules []repository.Rule, next int64, err error)
- func (r *RuleRepo) Tags(ctx context.Context) ([]repository.Tag, error)
- func (r *RuleRepo) Traverse(filter bson.M, cb func(rule repository.Rule) error) error
- func (r *RuleRepo) UpdateID(id primitive.ObjectID, rule repository.Rule) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMessageGroupRepo ¶
func NewMessageGroupRepo() repository.EventGroupRepo
func NewMessageRepo ¶
func NewMessageRepo() repository.EventRepo
func NewRuleRepo ¶
func NewRuleRepo() repository.RuleRepo
Types ¶
type EventGroupRepo ¶
type EventGroupRepo struct {
Groups []repository.EventGroup
}
func (*EventGroupRepo) Add ¶
func (m *EventGroupRepo) Add(grp repository.EventGroup) (id primitive.ObjectID, err error)
func (*EventGroupRepo) CollectingGroup ¶
func (m *EventGroupRepo) CollectingGroup(rule repository.EventGroupRule) (group repository.EventGroup, err error)
func (*EventGroupRepo) Find ¶
func (m *EventGroupRepo) Find(filter bson.M) (grps []repository.EventGroup, err error)
func (*EventGroupRepo) Get ¶
func (m *EventGroupRepo) Get(id primitive.ObjectID) (grp repository.EventGroup, err error)
func (*EventGroupRepo) LastGroup ¶
func (m *EventGroupRepo) LastGroup(filter bson.M) (grp repository.EventGroup, err error)
func (*EventGroupRepo) Paginate ¶
func (m *EventGroupRepo) Paginate(filter bson.M, offset, limit int64) (grps []repository.EventGroup, next int64, err error)
func (*EventGroupRepo) StatByDatetimeCount ¶
func (m *EventGroupRepo) StatByDatetimeCount(ctx context.Context, startTime, endTime time.Time, hour int64) ([]repository.EventGroupByDatetimeCount, error)
func (*EventGroupRepo) StatByRuleCount ¶
func (m *EventGroupRepo) StatByRuleCount(ctx context.Context, startTime, endTime time.Time) ([]repository.EventGroupByRuleCount, error)
func (*EventGroupRepo) StatByUserCount ¶
func (m *EventGroupRepo) StatByUserCount(ctx context.Context, startTime, endTime time.Time) ([]repository.EventGroupByUserCount, error)
func (*EventGroupRepo) Traverse ¶
func (m *EventGroupRepo) Traverse(filter bson.M, cb func(grp repository.EventGroup) error) error
func (*EventGroupRepo) UpdateID ¶
func (m *EventGroupRepo) UpdateID(id primitive.ObjectID, grp repository.EventGroup) error
type MessageRepo ¶
type MessageRepo struct {
Messages []repository.Event
}
func (*MessageRepo) Add ¶
func (m *MessageRepo) Add(msg repository.Event) (id primitive.ObjectID, err error)
func (*MessageRepo) AddWithContext ¶
func (m *MessageRepo) AddWithContext(ctx context.Context, msg repository.Event) (id primitive.ObjectID, err error)
func (*MessageRepo) Count ¶
func (m *MessageRepo) Count(filter interface{}) (int64, error)
func (*MessageRepo) Delete ¶
func (m *MessageRepo) Delete(filter interface{}) error
func (*MessageRepo) Find ¶
func (m *MessageRepo) Find(filter interface{}) (messages []repository.Event, err error)
func (*MessageRepo) Get ¶
func (m *MessageRepo) Get(id primitive.ObjectID) (msg repository.Event, err error)
func (*MessageRepo) Paginate ¶
func (m *MessageRepo) Paginate(filter interface{}, offset, limit int64) (messages []repository.Event, next int64, err error)
func (*MessageRepo) Traverse ¶
func (m *MessageRepo) Traverse(filter interface{}, cb func(msg repository.Event) error) error
func (*MessageRepo) UpdateID ¶
func (m *MessageRepo) UpdateID(id primitive.ObjectID, update repository.Event) error
Click to show internal directories.
Click to hide internal directories.