Documentation ¶
Overview ¶
Package services is a generated GoMock package.
Package services is a generated GoMock package.
Package services is a generated GoMock package.
Index ¶
- type C2
- type C2EventStreamClient
- type MockC2
- type MockC2EventStreamClient
- func (m *MockC2EventStreamClient) CloseSend() error
- func (m *MockC2EventStreamClient) Context() context.Context
- func (m *MockC2EventStreamClient) EXPECT() *MockC2EventStreamClientMockRecorder
- func (m *MockC2EventStreamClient) Header() (metadata.MD, error)
- func (m *MockC2EventStreamClient) Recv() (*pb.Event, error)
- func (m *MockC2EventStreamClient) RecvMsg(arg0 interface{}) error
- func (m *MockC2EventStreamClient) SendMsg(arg0 interface{}) error
- func (m *MockC2EventStreamClient) Trailer() metadata.MD
- type MockC2EventStreamClientMockRecorder
- func (mr *MockC2EventStreamClientMockRecorder) CloseSend() *gomock.Call
- func (mr *MockC2EventStreamClientMockRecorder) Context() *gomock.Call
- func (mr *MockC2EventStreamClientMockRecorder) Header() *gomock.Call
- func (mr *MockC2EventStreamClientMockRecorder) Recv() *gomock.Call
- func (mr *MockC2EventStreamClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call
- func (mr *MockC2EventStreamClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call
- func (mr *MockC2EventStreamClientMockRecorder) Trailer() *gomock.Call
- type MockC2MockRecorder
- type MockRuleService
- func (m *MockRuleService) All(arg0 context.Context) ([]models.Rule, error)
- func (m *MockRuleService) ByID(arg0 context.Context, arg1 int) (models.Rule, error)
- func (m *MockRuleService) Delete(arg0 context.Context, arg1 models.Rule) error
- func (m *MockRuleService) DeleteTargets(arg0 context.Context, arg1 ...models.Target) error
- func (m *MockRuleService) DeleteTriggers(arg0 context.Context, arg1 ...models.Trigger) error
- func (m *MockRuleService) EXPECT() *MockRuleServiceMockRecorder
- func (m *MockRuleService) Save(arg0 context.Context, arg1 *models.Rule) error
- func (m *MockRuleService) TargetByID(arg0 context.Context, arg1 int) (models.Target, error)
- func (m *MockRuleService) TriggerByID(arg0 context.Context, arg1 int) (models.Trigger, error)
- type MockRuleServiceMockRecorder
- func (mr *MockRuleServiceMockRecorder) All(arg0 interface{}) *gomock.Call
- func (mr *MockRuleServiceMockRecorder) ByID(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockRuleServiceMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockRuleServiceMockRecorder) DeleteTargets(arg0 interface{}, arg1 ...interface{}) *gomock.Call
- func (mr *MockRuleServiceMockRecorder) DeleteTriggers(arg0 interface{}, arg1 ...interface{}) *gomock.Call
- func (mr *MockRuleServiceMockRecorder) Save(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockRuleServiceMockRecorder) TargetByID(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockRuleServiceMockRecorder) TriggerByID(arg0, arg1 interface{}) *gomock.Call
- type MockTriggerStateService
- type MockTriggerStateServiceMockRecorder
- type RuleReader
- type RuleService
- type RuleWriter
- type TargetReader
- type TargetWriter
- type TriggerReader
- type TriggerStateService
- type TriggerWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type C2 ¶
type C2 interface { NewClientKey(ctx context.Context, clientName string) error NewTopicKey(ctx context.Context, topic string) error SubscribeToEventStream(ctx context.Context) (C2EventStreamClient, error) }
C2 describes a C2 client service interface
func NewC2 ¶
func NewC2(c2pbClientFactory pb.C2PbClientFactory) C2
NewC2 creates a new C2 client service
type C2EventStreamClient ¶
type C2EventStreamClient interface { c2pb.C2_SubscribeToEventStreamClient }
C2EventStreamClient wrap around the c2pb.C2_SubscribeToEventStreamClient definition
type MockC2 ¶
type MockC2 struct {
// contains filtered or unexported fields
}
MockC2 is a mock of C2 interface
func NewMockC2 ¶
func NewMockC2(ctrl *gomock.Controller) *MockC2
NewMockC2 creates a new mock instance
func (*MockC2) EXPECT ¶
func (m *MockC2) EXPECT() *MockC2MockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockC2) NewClientKey ¶
NewClientKey mocks base method
func (*MockC2) NewTopicKey ¶
NewTopicKey mocks base method
func (*MockC2) SubscribeToEventStream ¶
func (m *MockC2) SubscribeToEventStream(arg0 context.Context) (C2EventStreamClient, error)
SubscribeToEventStream mocks base method
type MockC2EventStreamClient ¶
type MockC2EventStreamClient struct {
// contains filtered or unexported fields
}
MockC2EventStreamClient is a mock of C2EventStreamClient interface
func NewMockC2EventStreamClient ¶
func NewMockC2EventStreamClient(ctrl *gomock.Controller) *MockC2EventStreamClient
NewMockC2EventStreamClient creates a new mock instance
func (*MockC2EventStreamClient) CloseSend ¶
func (m *MockC2EventStreamClient) CloseSend() error
CloseSend mocks base method
func (*MockC2EventStreamClient) Context ¶
func (m *MockC2EventStreamClient) Context() context.Context
Context mocks base method
func (*MockC2EventStreamClient) EXPECT ¶
func (m *MockC2EventStreamClient) EXPECT() *MockC2EventStreamClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockC2EventStreamClient) Header ¶
func (m *MockC2EventStreamClient) Header() (metadata.MD, error)
Header mocks base method
func (*MockC2EventStreamClient) Recv ¶
func (m *MockC2EventStreamClient) Recv() (*pb.Event, error)
Recv mocks base method
func (*MockC2EventStreamClient) RecvMsg ¶
func (m *MockC2EventStreamClient) RecvMsg(arg0 interface{}) error
RecvMsg mocks base method
func (*MockC2EventStreamClient) SendMsg ¶
func (m *MockC2EventStreamClient) SendMsg(arg0 interface{}) error
SendMsg mocks base method
func (*MockC2EventStreamClient) Trailer ¶
func (m *MockC2EventStreamClient) Trailer() metadata.MD
Trailer mocks base method
type MockC2EventStreamClientMockRecorder ¶
type MockC2EventStreamClientMockRecorder struct {
// contains filtered or unexported fields
}
MockC2EventStreamClientMockRecorder is the mock recorder for MockC2EventStreamClient
func (*MockC2EventStreamClientMockRecorder) CloseSend ¶
func (mr *MockC2EventStreamClientMockRecorder) CloseSend() *gomock.Call
CloseSend indicates an expected call of CloseSend
func (*MockC2EventStreamClientMockRecorder) Context ¶
func (mr *MockC2EventStreamClientMockRecorder) Context() *gomock.Call
Context indicates an expected call of Context
func (*MockC2EventStreamClientMockRecorder) Header ¶
func (mr *MockC2EventStreamClientMockRecorder) Header() *gomock.Call
Header indicates an expected call of Header
func (*MockC2EventStreamClientMockRecorder) Recv ¶
func (mr *MockC2EventStreamClientMockRecorder) Recv() *gomock.Call
Recv indicates an expected call of Recv
func (*MockC2EventStreamClientMockRecorder) RecvMsg ¶
func (mr *MockC2EventStreamClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call
RecvMsg indicates an expected call of RecvMsg
func (*MockC2EventStreamClientMockRecorder) SendMsg ¶
func (mr *MockC2EventStreamClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call
SendMsg indicates an expected call of SendMsg
func (*MockC2EventStreamClientMockRecorder) Trailer ¶
func (mr *MockC2EventStreamClientMockRecorder) Trailer() *gomock.Call
Trailer indicates an expected call of Trailer
type MockC2MockRecorder ¶
type MockC2MockRecorder struct {
// contains filtered or unexported fields
}
MockC2MockRecorder is the mock recorder for MockC2
func (*MockC2MockRecorder) NewClientKey ¶
func (mr *MockC2MockRecorder) NewClientKey(arg0, arg1 interface{}) *gomock.Call
NewClientKey indicates an expected call of NewClientKey
func (*MockC2MockRecorder) NewTopicKey ¶
func (mr *MockC2MockRecorder) NewTopicKey(arg0, arg1 interface{}) *gomock.Call
NewTopicKey indicates an expected call of NewTopicKey
func (*MockC2MockRecorder) SubscribeToEventStream ¶
func (mr *MockC2MockRecorder) SubscribeToEventStream(arg0 interface{}) *gomock.Call
SubscribeToEventStream indicates an expected call of SubscribeToEventStream
type MockRuleService ¶
type MockRuleService struct {
// contains filtered or unexported fields
}
MockRuleService is a mock of RuleService interface
func NewMockRuleService ¶
func NewMockRuleService(ctrl *gomock.Controller) *MockRuleService
NewMockRuleService creates a new mock instance
func (*MockRuleService) DeleteTargets ¶
DeleteTargets mocks base method
func (*MockRuleService) DeleteTriggers ¶
DeleteTriggers mocks base method
func (*MockRuleService) EXPECT ¶
func (m *MockRuleService) EXPECT() *MockRuleServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRuleService) TargetByID ¶
TargetByID mocks base method
func (*MockRuleService) TriggerByID ¶
TriggerByID mocks base method
type MockRuleServiceMockRecorder ¶
type MockRuleServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockRuleServiceMockRecorder is the mock recorder for MockRuleService
func (*MockRuleServiceMockRecorder) All ¶
func (mr *MockRuleServiceMockRecorder) All(arg0 interface{}) *gomock.Call
All indicates an expected call of All
func (*MockRuleServiceMockRecorder) ByID ¶
func (mr *MockRuleServiceMockRecorder) ByID(arg0, arg1 interface{}) *gomock.Call
ByID indicates an expected call of ByID
func (*MockRuleServiceMockRecorder) Delete ¶
func (mr *MockRuleServiceMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
Delete indicates an expected call of Delete
func (*MockRuleServiceMockRecorder) DeleteTargets ¶
func (mr *MockRuleServiceMockRecorder) DeleteTargets(arg0 interface{}, arg1 ...interface{}) *gomock.Call
DeleteTargets indicates an expected call of DeleteTargets
func (*MockRuleServiceMockRecorder) DeleteTriggers ¶
func (mr *MockRuleServiceMockRecorder) DeleteTriggers(arg0 interface{}, arg1 ...interface{}) *gomock.Call
DeleteTriggers indicates an expected call of DeleteTriggers
func (*MockRuleServiceMockRecorder) Save ¶
func (mr *MockRuleServiceMockRecorder) Save(arg0, arg1 interface{}) *gomock.Call
Save indicates an expected call of Save
func (*MockRuleServiceMockRecorder) TargetByID ¶
func (mr *MockRuleServiceMockRecorder) TargetByID(arg0, arg1 interface{}) *gomock.Call
TargetByID indicates an expected call of TargetByID
func (*MockRuleServiceMockRecorder) TriggerByID ¶
func (mr *MockRuleServiceMockRecorder) TriggerByID(arg0, arg1 interface{}) *gomock.Call
TriggerByID indicates an expected call of TriggerByID
type MockTriggerStateService ¶
type MockTriggerStateService struct {
// contains filtered or unexported fields
}
MockTriggerStateService is a mock of TriggerStateService interface
func NewMockTriggerStateService ¶
func NewMockTriggerStateService(ctrl *gomock.Controller) *MockTriggerStateService
NewMockTriggerStateService creates a new mock instance
func (*MockTriggerStateService) ByTriggerID ¶
func (m *MockTriggerStateService) ByTriggerID(arg0 context.Context, arg1 int) (models.TriggerState, error)
ByTriggerID mocks base method
func (*MockTriggerStateService) EXPECT ¶
func (m *MockTriggerStateService) EXPECT() *MockTriggerStateServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockTriggerStateService) Save ¶
func (m *MockTriggerStateService) Save(arg0 context.Context, arg1 *models.TriggerState) error
Save mocks base method
type MockTriggerStateServiceMockRecorder ¶
type MockTriggerStateServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockTriggerStateServiceMockRecorder is the mock recorder for MockTriggerStateService
func (*MockTriggerStateServiceMockRecorder) ByTriggerID ¶
func (mr *MockTriggerStateServiceMockRecorder) ByTriggerID(arg0, arg1 interface{}) *gomock.Call
ByTriggerID indicates an expected call of ByTriggerID
func (*MockTriggerStateServiceMockRecorder) Save ¶
func (mr *MockTriggerStateServiceMockRecorder) Save(arg0, arg1 interface{}) *gomock.Call
Save indicates an expected call of Save
type RuleReader ¶
type RuleReader interface { All(ctx context.Context) ([]models.Rule, error) ByID(ctx context.Context, ruleID int) (models.Rule, error) }
RuleReader defines methods available to read rules from database
type RuleService ¶
type RuleService interface { RuleReader RuleWriter TargetReader TargetWriter TriggerReader TriggerWriter }
RuleService defines methods to interact with rules models and database
func NewRuleService ¶
func NewRuleService(db models.Database, validator models.Validator) RuleService
NewRuleService creates a new RuleService
type RuleWriter ¶
type RuleWriter interface { Save(ctx context.Context, rule *models.Rule) error Delete(ctx context.Context, rule models.Rule) error }
RuleWriter defines methods available to write rules
type TargetReader ¶
type TargetReader interface {
TargetByID(ctx context.Context, targetID int) (models.Target, error)
}
TargetReader defines methods to read targets
type TargetWriter ¶
TargetWriter defines methods to write Targets
type TriggerReader ¶
type TriggerReader interface {
TriggerByID(ctx context.Context, triggerID int) (models.Trigger, error)
}
TriggerReader defines methods to read triggers
type TriggerStateService ¶
type TriggerStateService interface { Save(context.Context, *models.TriggerState) error ByTriggerID(context.Context, int) (models.TriggerState, error) }
TriggerStateService defines a service for managing triggerState models.
func NewTriggerStateService ¶
func NewTriggerStateService(db models.Database) TriggerStateService
NewTriggerStateService creates a new service for handling triggerState models