Documentation ¶
Index ¶
- func NewAgentRepo(db *mongo.Database) repository.AgentRepo
- func NewAuditLogRepo(db *mongo.Database) repository.AuditLogRepo
- func NewDingdingRobotRepo(db *mongo.Database) repository.DingdingRobotRepo
- func NewEventGroupRepo(db *mongo.Database, seqRepo repository.SequenceRepo) repository.EventGroupRepo
- func NewEventRelationNoteRepo(db *mongo.Database) repository.EventRelationNoteRepo
- func NewEventRelationRepo(db *mongo.Database) repository.EventRelationRepo
- func NewEventRepo(db *mongo.Database, seqRepo repository.SequenceRepo) repository.EventRepo
- func NewKVRepo(db *mongo.Database) repository.KVRepo
- func NewLockRepo(db *mongo.Database) repository.LockRepo
- func NewQueueRepo(db *mongo.Database) repository.QueueRepo
- func NewRecoveryRepo(db *mongo.Database) repository.RecoveryRepo
- func NewRuleRepo(db *mongo.Database) repository.RuleRepo
- func NewSequenceRepo(db *mongo.Database) repository.SequenceRepo
- func NewTemplateRepo(db *mongo.Database) repository.TemplateRepo
- func NewUserRepo(db *mongo.Database) repository.UserRepo
- type AgentRepo
- func (a AgentRepo) Delete(filter bson.M) error
- func (a AgentRepo) DeleteID(id repository.ID) error
- func (a AgentRepo) Find(filter bson.M) (agents []repository.Agent, err error)
- func (a AgentRepo) Get(id repository.ID) (agent repository.Agent, err error)
- func (a AgentRepo) Update(agent repository.Agent) (repository.ID, error)
- type AuditLogRepo
- func (alr *AuditLogRepo) Add(al repository.AuditLog) (id primitive.ObjectID, err error)
- func (alr *AuditLogRepo) Delete(filter bson.M) error
- func (alr *AuditLogRepo) DeleteID(id primitive.ObjectID) error
- func (alr *AuditLogRepo) Get(id primitive.ObjectID) (al repository.AuditLog, err error)
- func (alr *AuditLogRepo) Paginate(filter bson.M, offset, limit int64) (als []repository.AuditLog, next int64, err error)
- type DingdingRobotRepo
- func (u DingdingRobotRepo) Add(robot repository.DingdingRobot) (id primitive.ObjectID, err error)
- func (u DingdingRobotRepo) Count(filter bson.M) (int64, error)
- func (u DingdingRobotRepo) Delete(filter bson.M) error
- func (u DingdingRobotRepo) DeleteID(id primitive.ObjectID) error
- func (u DingdingRobotRepo) Find(filter bson.M) (robots []repository.DingdingRobot, err error)
- func (u DingdingRobotRepo) Get(id primitive.ObjectID) (robot repository.DingdingRobot, err error)
- func (u DingdingRobotRepo) Paginate(filter bson.M, offset, limit int64) (robots []repository.DingdingRobot, next int64, err error)
- func (u DingdingRobotRepo) Update(id primitive.ObjectID, robot repository.DingdingRobot) error
- 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) StatByAggCount(ctx context.Context, ruleID primitive.ObjectID, startTime, endTime time.Time) ([]repository.EventGroupAggCount, error)
- func (m EventGroupRepo) StatByAggCountInPeriod(ctx context.Context, ruleID primitive.ObjectID, startTime, endTime time.Time, ...) ([]repository.EventGroupAggByDatetimeCount, error)
- func (m EventGroupRepo) StatByDatetimeCount(ctx context.Context, filter bson.M, 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 EventRelationNoteRepo
- func (m *EventRelationNoteRepo) AddNote(ctx context.Context, note repository.EventRelationNote) (repository.ID, error)
- func (m *EventRelationNoteRepo) DeleteNote(ctx context.Context, relID primitive.ObjectID, filter bson.M) error
- func (m *EventRelationNoteRepo) PaginateNotes(ctx context.Context, relID primitive.ObjectID, filter bson.M, ...) (notes []repository.EventRelationNote, next int64, err error)
- type EventRelationRepo
- func (m *EventRelationRepo) AddOrUpdateEventRelation(ctx context.Context, summary string, matchedRuleID primitive.ObjectID) (eventRel repository.EventRelation, err error)
- func (m *EventRelationRepo) Count(ctx context.Context, filter interface{}) (int64, error)
- func (m *EventRelationRepo) Get(ctx context.Context, id primitive.ObjectID) (eventRel repository.EventRelation, err error)
- func (m *EventRelationRepo) Paginate(ctx context.Context, filter interface{}, offset, limit int64) (eventRels []repository.EventRelation, next int64, err error)
- type EventRepo
- func (m EventRepo) Add(msg repository.Event) (id primitive.ObjectID, err error)
- func (m EventRepo) AddWithContext(ctx context.Context, msg repository.Event) (id primitive.ObjectID, err error)
- func (m EventRepo) Count(filter interface{}) (int64, error)
- func (m EventRepo) CountByDatetime(ctx context.Context, filter bson.M, startTime, endTime time.Time, hour int64) ([]repository.EventByDatetimeCount, error)
- func (m EventRepo) Delete(filter interface{}) error
- func (m EventRepo) DeleteID(id primitive.ObjectID) error
- func (m EventRepo) Find(filter interface{}) (messages []repository.Event, err error)
- func (m EventRepo) FindIDs(ctx context.Context, filter interface{}, limit int64) ([]primitive.ObjectID, error)
- func (m EventRepo) Get(id primitive.ObjectID) (msg repository.Event, err error)
- func (m EventRepo) Paginate(filter interface{}, offset, limit int64) (messages []repository.Event, next int64, err error)
- func (m EventRepo) Traverse(filter interface{}, cb func(msg repository.Event) error) error
- func (m EventRepo) UpdateID(id primitive.ObjectID, update repository.Event) error
- type KVRepo
- func (repo KVRepo) All(filter bson.M) (pairs []repository.KV, err error)
- func (repo KVRepo) GC() error
- func (repo KVRepo) Get(key string) (pair repository.KV, err error)
- func (repo KVRepo) Remove(key string) (removeCount int64, err error)
- func (repo KVRepo) Set(key string, value interface{}) error
- func (repo KVRepo) SetWithTTL(key string, value interface{}, ttl time.Duration) error
- type LockRepo
- type QueueRepo
- func (q *QueueRepo) Count(filter bson.M) (int64, error)
- func (q *QueueRepo) Delete(filter bson.M) error
- func (q *QueueRepo) DeleteID(id primitive.ObjectID) error
- func (q *QueueRepo) Dequeue(ctx context.Context) (item repository.QueueJob, err error)
- func (q *QueueRepo) Enqueue(ctx context.Context, item repository.QueueJob) (id primitive.ObjectID, err error)
- func (q *QueueRepo) Get(id primitive.ObjectID) (repository.QueueJob, error)
- func (q *QueueRepo) Paginate(filter bson.M, offset, limit int64) (items []repository.QueueJob, next int64, err error)
- func (q *QueueRepo) Update(ctx context.Context, filter bson.M, item repository.QueueJob) error
- func (q *QueueRepo) UpdateID(ctx context.Context, id primitive.ObjectID, jobItem repository.QueueJob) error
- type RecoveryRepo
- 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
- type SequenceRepo
- type ServiceProvider
- type TemplateRepo
- func (t TemplateRepo) Add(temp repository.Template) (id primitive.ObjectID, err error)
- func (t TemplateRepo) Count(filter bson.M) (int64, error)
- func (t TemplateRepo) Delete(filter bson.M) error
- func (t TemplateRepo) DeleteID(id primitive.ObjectID) error
- func (t TemplateRepo) Find(filter bson.M) (templates []repository.Template, err error)
- func (t TemplateRepo) Get(id primitive.ObjectID) (temp repository.Template, err error)
- func (t TemplateRepo) Paginate(filter bson.M, offset, limit int64) (templates []repository.Template, next int64, err error)
- func (t TemplateRepo) Update(id primitive.ObjectID, temp repository.Template) error
- type UserRepo
- func (u UserRepo) Add(user repository.User) (id primitive.ObjectID, err error)
- func (u UserRepo) Count(filter bson.M) (int64, error)
- func (u UserRepo) Delete(filter bson.M) error
- func (u UserRepo) DeleteID(id primitive.ObjectID) error
- func (u UserRepo) Find(filter bson.M) (users []repository.User, err error)
- func (u UserRepo) Get(id primitive.ObjectID) (user repository.User, err error)
- func (u UserRepo) GetByEmail(email string) (user repository.User, err error)
- func (u UserRepo) GetUserMetas(queryK, queryV, field string) ([]string, error)
- func (u UserRepo) Paginate(filter bson.M, offset, limit int64) (users []repository.User, next int64, err error)
- func (u UserRepo) Update(id primitive.ObjectID, user repository.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAgentRepo ¶
func NewAgentRepo(db *mongo.Database) repository.AgentRepo
func NewAuditLogRepo ¶
func NewAuditLogRepo(db *mongo.Database) repository.AuditLogRepo
NewAuditLogRepo 创建一个 审计日志仓库
func NewDingdingRobotRepo ¶
func NewDingdingRobotRepo(db *mongo.Database) repository.DingdingRobotRepo
func NewEventGroupRepo ¶
func NewEventGroupRepo(db *mongo.Database, seqRepo repository.SequenceRepo) repository.EventGroupRepo
func NewEventRelationNoteRepo ¶
func NewEventRelationNoteRepo(db *mongo.Database) repository.EventRelationNoteRepo
func NewEventRelationRepo ¶
func NewEventRelationRepo(db *mongo.Database) repository.EventRelationRepo
func NewEventRepo ¶
func NewEventRepo(db *mongo.Database, seqRepo repository.SequenceRepo) repository.EventRepo
func NewLockRepo ¶
func NewLockRepo(db *mongo.Database) repository.LockRepo
func NewQueueRepo ¶
func NewQueueRepo(db *mongo.Database) repository.QueueRepo
func NewRecoveryRepo ¶
func NewRecoveryRepo(db *mongo.Database) repository.RecoveryRepo
func NewRuleRepo ¶
func NewRuleRepo(db *mongo.Database) repository.RuleRepo
func NewSequenceRepo ¶
func NewSequenceRepo(db *mongo.Database) repository.SequenceRepo
func NewTemplateRepo ¶
func NewTemplateRepo(db *mongo.Database) repository.TemplateRepo
func NewUserRepo ¶
func NewUserRepo(db *mongo.Database) repository.UserRepo
Types ¶
type AgentRepo ¶
type AgentRepo struct {
// contains filtered or unexported fields
}
func (AgentRepo) Get ¶
func (a AgentRepo) Get(id repository.ID) (agent repository.Agent, err error)
func (AgentRepo) Update ¶
func (a AgentRepo) Update(agent repository.Agent) (repository.ID, error)
type AuditLogRepo ¶
type AuditLogRepo struct {
// contains filtered or unexported fields
}
AuditLogRepo 审计日志仓库
func (*AuditLogRepo) Add ¶
func (alr *AuditLogRepo) Add(al repository.AuditLog) (id primitive.ObjectID, err error)
Add 添加日志
func (*AuditLogRepo) DeleteID ¶
func (alr *AuditLogRepo) DeleteID(id primitive.ObjectID) error
DeleteID 删除单条
func (*AuditLogRepo) Get ¶
func (alr *AuditLogRepo) Get(id primitive.ObjectID) (al repository.AuditLog, err error)
Get 查询单个日志
func (*AuditLogRepo) Paginate ¶
func (alr *AuditLogRepo) Paginate(filter bson.M, offset, limit int64) (als []repository.AuditLog, next int64, err error)
Paginate 分页查询
type DingdingRobotRepo ¶
type DingdingRobotRepo struct {
// contains filtered or unexported fields
}
func (DingdingRobotRepo) Add ¶
func (u DingdingRobotRepo) Add(robot repository.DingdingRobot) (id primitive.ObjectID, err error)
func (DingdingRobotRepo) DeleteID ¶
func (u DingdingRobotRepo) DeleteID(id primitive.ObjectID) error
func (DingdingRobotRepo) Find ¶
func (u DingdingRobotRepo) Find(filter bson.M) (robots []repository.DingdingRobot, err error)
func (DingdingRobotRepo) Get ¶
func (u DingdingRobotRepo) Get(id primitive.ObjectID) (robot repository.DingdingRobot, err error)
func (DingdingRobotRepo) Paginate ¶
func (u DingdingRobotRepo) Paginate(filter bson.M, offset, limit int64) (robots []repository.DingdingRobot, next int64, err error)
func (DingdingRobotRepo) Update ¶
func (u DingdingRobotRepo) Update(id primitive.ObjectID, robot repository.DingdingRobot) error
type EventGroupRepo ¶
type EventGroupRepo struct {
// contains filtered or unexported fields
}
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) 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 ¶
func (m EventGroupRepo) UpdateID(id primitive.ObjectID, grp repository.EventGroup) error
type EventRelationNoteRepo ¶
type EventRelationNoteRepo struct {
// contains filtered or unexported fields
}
func (*EventRelationNoteRepo) AddNote ¶
func (m *EventRelationNoteRepo) AddNote(ctx context.Context, note repository.EventRelationNote) (repository.ID, error)
func (*EventRelationNoteRepo) DeleteNote ¶
func (*EventRelationNoteRepo) PaginateNotes ¶
func (m *EventRelationNoteRepo) PaginateNotes(ctx context.Context, relID primitive.ObjectID, filter bson.M, offset, limit int64) (notes []repository.EventRelationNote, next int64, err error)
type EventRelationRepo ¶
type EventRelationRepo struct {
// contains filtered or unexported fields
}
func (*EventRelationRepo) AddOrUpdateEventRelation ¶
func (m *EventRelationRepo) AddOrUpdateEventRelation(ctx context.Context, summary string, matchedRuleID primitive.ObjectID) (eventRel repository.EventRelation, err error)
func (*EventRelationRepo) Count ¶
func (m *EventRelationRepo) Count(ctx context.Context, filter interface{}) (int64, error)
func (*EventRelationRepo) Get ¶
func (m *EventRelationRepo) Get(ctx context.Context, id primitive.ObjectID) (eventRel repository.EventRelation, err error)
func (*EventRelationRepo) Paginate ¶
func (m *EventRelationRepo) Paginate(ctx context.Context, filter interface{}, offset, limit int64) (eventRels []repository.EventRelation, next int64, err error)
type EventRepo ¶
type EventRepo struct {
// contains filtered or unexported fields
}
func (EventRepo) AddWithContext ¶
func (EventRepo) CountByDatetime ¶
func (EventRepo) Find ¶
func (m EventRepo) Find(filter interface{}) (messages []repository.Event, err error)
type LockRepo ¶
type LockRepo struct {
// contains filtered or unexported fields
}
func (*LockRepo) Lock ¶
Lock acquire a lock One of three things will happen when we run this change (upsert).
- If the resource exists and has any locks on it (shared or exclusive), we will get a duplicate key error.
- If the resource exists but doesn't have any locks on it, we will update it to obtain an exclusive lock.
- If the resource doesn't exist yet, it will be inserted which will give us an exclusive lock on it.
type QueueRepo ¶
type QueueRepo struct {
// contains filtered or unexported fields
}
type RecoveryRepo ¶
type RecoveryRepo struct {
// contains filtered or unexported fields
}
func (RecoveryRepo) Delete ¶
func (r RecoveryRepo) Delete(ctx context.Context, recoveryID string) error
func (RecoveryRepo) RecoverableEvents ¶
func (r RecoveryRepo) RecoverableEvents(ctx context.Context, deadline time.Time) ([]repository.Recovery, error)
type RuleRepo ¶
type RuleRepo struct {
// contains filtered or unexported fields
}
type SequenceRepo ¶
type SequenceRepo struct {
// contains filtered or unexported fields
}
func (SequenceRepo) Next ¶
func (s SequenceRepo) Next(name string) (seq repository.Sequence, err error)
func (SequenceRepo) Truncate ¶
func (s SequenceRepo) Truncate(name string) error
type ServiceProvider ¶
type ServiceProvider struct{}
func (ServiceProvider) Boot ¶
func (s ServiceProvider) Boot(app infra.Glacier)
func (ServiceProvider) Register ¶
func (s ServiceProvider) Register(app container.Container)
type TemplateRepo ¶
type TemplateRepo struct {
// contains filtered or unexported fields
}
func (TemplateRepo) Add ¶
func (t TemplateRepo) Add(temp repository.Template) (id primitive.ObjectID, err error)
func (TemplateRepo) Find ¶
func (t TemplateRepo) Find(filter bson.M) (templates []repository.Template, err error)
func (TemplateRepo) Get ¶
func (t TemplateRepo) Get(id primitive.ObjectID) (temp repository.Template, err error)
func (TemplateRepo) Paginate ¶
func (t TemplateRepo) Paginate(filter bson.M, offset, limit int64) (templates []repository.Template, next int64, err error)
func (TemplateRepo) Update ¶
func (t TemplateRepo) Update(id primitive.ObjectID, temp repository.Template) error
Click to show internal directories.
Click to hide internal directories.