repository

package
v0.0.0-...-4963dd4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 (*EventGroupRepo) CollectingGroup

func (m *EventGroupRepo) CollectingGroup(rule repository.EventGroupRule) (group repository.EventGroup, err error)

func (*EventGroupRepo) Count

func (m *EventGroupRepo) Count(filter bson.M) (int64, error)

func (*EventGroupRepo) Delete

func (m *EventGroupRepo) Delete(filter bson.M) error

func (*EventGroupRepo) DeleteID

func (m *EventGroupRepo) DeleteID(id primitive.ObjectID) error

func (*EventGroupRepo) Find

func (m *EventGroupRepo) Find(filter bson.M) (grps []repository.EventGroup, err error)

func (*EventGroupRepo) Get

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, sortByCreatedAtDesc bool) (grps []repository.EventGroup, next int64, err error)

func (*EventGroupRepo) StatByAggCount

func (m *EventGroupRepo) StatByAggCount(ctx context.Context, ruleID primitive.ObjectID, startTime, endTime time.Time) ([]repository.EventGroupAggCount, error)

func (*EventGroupRepo) StatByAggCountInPeriod

func (m *EventGroupRepo) StatByAggCountInPeriod(ctx context.Context, ruleID primitive.ObjectID, startTime, endTime time.Time, hour int64) ([]repository.EventGroupAggByDatetimeCount, error)

func (*EventGroupRepo) StatByDatetimeCount

func (m *EventGroupRepo) StatByDatetimeCount(ctx context.Context, filter bson.M, 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

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) CountByDatetime

func (m *MessageRepo) CountByDatetime(ctx context.Context, filter bson.M, startTime, endTime time.Time, hour int64) ([]repository.EventByDatetimeCount, error)

func (*MessageRepo) Delete

func (m *MessageRepo) Delete(filter interface{}) error

func (*MessageRepo) DeleteID

func (m *MessageRepo) DeleteID(id primitive.ObjectID) error

func (*MessageRepo) Find

func (m *MessageRepo) Find(filter interface{}) (messages []repository.Event, err error)

func (*MessageRepo) FindIDs

func (m *MessageRepo) FindIDs(ctx context.Context, filter interface{}, limit int64) ([]primitive.ObjectID, error)

func (*MessageRepo) Get

func (m *MessageRepo) Get(id primitive.ObjectID) (msg repository.Event, err error)

func (*MessageRepo) Has

func (m *MessageRepo) Has(filter interface{}) (bool, 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

type RuleRepo

type RuleRepo struct {
	Rules []repository.Rule
}

func (*RuleRepo) Add

func (r *RuleRepo) Add(rule repository.Rule) (id primitive.ObjectID, err error)

func (*RuleRepo) Count

func (r *RuleRepo) Count(filter bson.M) (int64, error)

func (*RuleRepo) Delete

func (r *RuleRepo) Delete(filter bson.M) error

func (*RuleRepo) DeleteID

func (r *RuleRepo) DeleteID(id primitive.ObjectID) error

func (*RuleRepo) Find

func (r *RuleRepo) Find(filter bson.M) (rules []repository.Rule, err error)

func (*RuleRepo) Get

func (r *RuleRepo) Get(id primitive.ObjectID) (rule repository.Rule, err error)

func (*RuleRepo) Paginate

func (r *RuleRepo) Paginate(filter interface{}, offset, limit int64) (rules []repository.Rule, next int64, err error)

func (*RuleRepo) Tags

func (r *RuleRepo) Tags(ctx context.Context) ([]repository.Tag, error)

func (*RuleRepo) Traverse

func (r *RuleRepo) Traverse(filter bson.M, cb func(rule repository.Rule) error) error

func (*RuleRepo) UpdateID

func (r *RuleRepo) UpdateID(id primitive.ObjectID, rule repository.Rule) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL