services

package
v0.0.0-...-0d671b9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Index

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

func (m *MockC2) NewClientKey(arg0 context.Context, arg1 string) error

NewClientKey mocks base method

func (*MockC2) NewTopicKey

func (m *MockC2) NewTopicKey(arg0 context.Context, arg1 string) error

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

Context mocks base method

func (*MockC2EventStreamClient) EXPECT

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

CloseSend indicates an expected call of CloseSend

func (*MockC2EventStreamClientMockRecorder) Context

Context indicates an expected call of Context

func (*MockC2EventStreamClientMockRecorder) Header

Header indicates an expected call of Header

func (*MockC2EventStreamClientMockRecorder) Recv

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

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

func (m *MockRuleService) All(arg0 context.Context) ([]models.Rule, error)

All mocks base method

func (*MockRuleService) ByID

func (m *MockRuleService) ByID(arg0 context.Context, arg1 int) (models.Rule, error)

ByID mocks base method

func (*MockRuleService) Delete

func (m *MockRuleService) Delete(arg0 context.Context, arg1 models.Rule) error

Delete mocks base method

func (*MockRuleService) DeleteTargets

func (m *MockRuleService) DeleteTargets(arg0 context.Context, arg1 ...models.Target) error

DeleteTargets mocks base method

func (*MockRuleService) DeleteTriggers

func (m *MockRuleService) DeleteTriggers(arg0 context.Context, arg1 ...models.Trigger) error

DeleteTriggers mocks base method

func (*MockRuleService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRuleService) Save

func (m *MockRuleService) Save(arg0 context.Context, arg1 *models.Rule) error

Save mocks base method

func (*MockRuleService) TargetByID

func (m *MockRuleService) TargetByID(arg0 context.Context, arg1 int) (models.Target, error)

TargetByID mocks base method

func (*MockRuleService) TriggerByID

func (m *MockRuleService) TriggerByID(arg0 context.Context, arg1 int) (models.Trigger, error)

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

EXPECT returns an object that allows the caller to indicate expected use

func (*MockTriggerStateService) Save

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

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

type TargetWriter interface {
	DeleteTargets(ctx context.Context, targets ...models.Target) error
}

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

type TriggerWriter

type TriggerWriter interface {
	DeleteTriggers(ctx context.Context, triggers ...models.Trigger) error
}

TriggerWriter defines methods to write triggers

Jump to

Keyboard shortcuts

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