pb

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: 23 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package pb is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ActionType_name = map[int32]string{
	0: "UNDEFINED_ACTION",
	1: "KEY_ROTATION",
}
View Source
var ActionType_value = map[string]int32{
	"UNDEFINED_ACTION": 0,
	"KEY_ROTATION":     1,
}
View Source
var TargetType_name = map[int32]string{
	0: "ANY",
	1: "TOPIC",
	2: "CLIENT",
}
View Source
var TargetType_value = map[string]int32{
	"ANY":    0,
	"TOPIC":  1,
	"CLIENT": 2,
}
View Source
var TriggerType_name = map[int32]string{
	0: "UNDEFINED_TRIGGER",
	1: "TIME_INTERVAL",
	2: "EVENT",
}
View Source
var TriggerType_value = map[string]int32{
	"UNDEFINED_TRIGGER": 0,
	"TIME_INTERVAL":     1,
	"EVENT":             2,
}

Functions

func RegisterC2AutomationEngineHandler

func RegisterC2AutomationEngineHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterC2AutomationEngineHandler registers the http handlers for service C2AutomationEngine to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterC2AutomationEngineHandlerClient

func RegisterC2AutomationEngineHandlerClient(ctx context.Context, mux *runtime.ServeMux, client C2AutomationEngineClient) error

RegisterC2AutomationEngineHandlerClient registers the http handlers for service C2AutomationEngine to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "C2AutomationEngineClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "C2AutomationEngineClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "C2AutomationEngineClient" to call the correct interceptors.

func RegisterC2AutomationEngineHandlerFromEndpoint

func RegisterC2AutomationEngineHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterC2AutomationEngineHandlerFromEndpoint is same as RegisterC2AutomationEngineHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterC2AutomationEngineHandlerServer

func RegisterC2AutomationEngineHandlerServer(ctx context.Context, mux *runtime.ServeMux, server C2AutomationEngineServer) error

RegisterC2AutomationEngineHandlerServer registers the http handlers for service C2AutomationEngine to "mux". UnaryRPC :call C2AutomationEngineServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterC2AutomationEngineServer

func RegisterC2AutomationEngineServer(s *grpc.Server, srv C2AutomationEngineServer)

Types

type ActionType

type ActionType int32

List of supported ActionType

const (
	ActionType_UNDEFINED_ACTION ActionType = 0
	ActionType_KEY_ROTATION     ActionType = 1
)

func (ActionType) EnumDescriptor

func (ActionType) EnumDescriptor() ([]byte, []int)

func (ActionType) String

func (x ActionType) String() string

type AddRuleRequest

type AddRuleRequest struct {
	Description          string     `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	Action               ActionType `protobuf:"varint,2,opt,name=action,proto3,enum=pb.ActionType" json:"action,omitempty"`
	Triggers             []*Trigger `protobuf:"bytes,3,rep,name=triggers,proto3" json:"triggers,omitempty"`
	Targets              []*Target  `protobuf:"bytes,4,rep,name=targets,proto3" json:"targets,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*AddRuleRequest) Descriptor

func (*AddRuleRequest) Descriptor() ([]byte, []int)

func (*AddRuleRequest) GetAction

func (m *AddRuleRequest) GetAction() ActionType

func (*AddRuleRequest) GetDescription

func (m *AddRuleRequest) GetDescription() string

func (*AddRuleRequest) GetTargets

func (m *AddRuleRequest) GetTargets() []*Target

func (*AddRuleRequest) GetTriggers

func (m *AddRuleRequest) GetTriggers() []*Trigger

func (*AddRuleRequest) ProtoMessage

func (*AddRuleRequest) ProtoMessage()

func (*AddRuleRequest) Reset

func (m *AddRuleRequest) Reset()

func (*AddRuleRequest) String

func (m *AddRuleRequest) String() string

func (*AddRuleRequest) XXX_DiscardUnknown

func (m *AddRuleRequest) XXX_DiscardUnknown()

func (*AddRuleRequest) XXX_Marshal

func (m *AddRuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddRuleRequest) XXX_Merge

func (m *AddRuleRequest) XXX_Merge(src proto.Message)

func (*AddRuleRequest) XXX_Size

func (m *AddRuleRequest) XXX_Size() int

func (*AddRuleRequest) XXX_Unmarshal

func (m *AddRuleRequest) XXX_Unmarshal(b []byte) error

type C2AutomationEngineClient

type C2AutomationEngineClient interface {
	// Retrieve list of existing rules
	ListRules(ctx context.Context, in *ListRulesRequest, opts ...grpc.CallOption) (*RulesResponse, error)
	// Retrieve a single rule, by its ID
	GetRule(ctx context.Context, in *GetRuleRequest, opts ...grpc.CallOption) (*RuleResponse, error)
	// Create a new rule
	AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*RuleResponse, error)
	// Update an existing rule
	UpdateRule(ctx context.Context, in *UpdateRuleRequest, opts ...grpc.CallOption) (*RuleResponse, error)
	// Remove a rule
	DeleteRule(ctx context.Context, in *DeleteRuleRequest, opts ...grpc.CallOption) (*DeleteRuleResponse, error)
	HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}

C2AutomationEngineClient is the client API for C2AutomationEngine service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type C2AutomationEngineServer

type C2AutomationEngineServer interface {
	// Retrieve list of existing rules
	ListRules(context.Context, *ListRulesRequest) (*RulesResponse, error)
	// Retrieve a single rule, by its ID
	GetRule(context.Context, *GetRuleRequest) (*RuleResponse, error)
	// Create a new rule
	AddRule(context.Context, *AddRuleRequest) (*RuleResponse, error)
	// Update an existing rule
	UpdateRule(context.Context, *UpdateRuleRequest) (*RuleResponse, error)
	// Remove a rule
	DeleteRule(context.Context, *DeleteRuleRequest) (*DeleteRuleResponse, error)
	HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
}

C2AutomationEngineServer is the server API for C2AutomationEngine service.

type C2PbClient

type C2PbClient interface {
	c2pb.C2Client
	Close() error
}

C2PbClient wrap e4.C2Client in a local interface and provide a way to close its connection

type C2PbClientFactory

type C2PbClientFactory interface {
	Create() (C2PbClient, error)
}

C2PbClientFactory defines a factory creating C2PbClient

func NewC2PbClientFactory

func NewC2PbClientFactory(endpoint string, certPath string) (C2PbClientFactory, error)

NewC2PbClientFactory creates a new factory for C2 protobuf client

type DeleteRuleRequest

type DeleteRuleRequest struct {
	RuleId               int32    `protobuf:"varint,1,opt,name=ruleId,proto3" json:"ruleId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteRuleRequest) Descriptor

func (*DeleteRuleRequest) Descriptor() ([]byte, []int)

func (*DeleteRuleRequest) GetRuleId

func (m *DeleteRuleRequest) GetRuleId() int32

func (*DeleteRuleRequest) ProtoMessage

func (*DeleteRuleRequest) ProtoMessage()

func (*DeleteRuleRequest) Reset

func (m *DeleteRuleRequest) Reset()

func (*DeleteRuleRequest) String

func (m *DeleteRuleRequest) String() string

func (*DeleteRuleRequest) XXX_DiscardUnknown

func (m *DeleteRuleRequest) XXX_DiscardUnknown()

func (*DeleteRuleRequest) XXX_Marshal

func (m *DeleteRuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteRuleRequest) XXX_Merge

func (m *DeleteRuleRequest) XXX_Merge(src proto.Message)

func (*DeleteRuleRequest) XXX_Size

func (m *DeleteRuleRequest) XXX_Size() int

func (*DeleteRuleRequest) XXX_Unmarshal

func (m *DeleteRuleRequest) XXX_Unmarshal(b []byte) error

type DeleteRuleResponse

type DeleteRuleResponse struct {
	RuleId               int32    `protobuf:"varint,1,opt,name=ruleId,proto3" json:"ruleId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteRuleResponse) Descriptor

func (*DeleteRuleResponse) Descriptor() ([]byte, []int)

func (*DeleteRuleResponse) GetRuleId

func (m *DeleteRuleResponse) GetRuleId() int32

func (*DeleteRuleResponse) ProtoMessage

func (*DeleteRuleResponse) ProtoMessage()

func (*DeleteRuleResponse) Reset

func (m *DeleteRuleResponse) Reset()

func (*DeleteRuleResponse) String

func (m *DeleteRuleResponse) String() string

func (*DeleteRuleResponse) XXX_DiscardUnknown

func (m *DeleteRuleResponse) XXX_DiscardUnknown()

func (*DeleteRuleResponse) XXX_Marshal

func (m *DeleteRuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteRuleResponse) XXX_Merge

func (m *DeleteRuleResponse) XXX_Merge(src proto.Message)

func (*DeleteRuleResponse) XXX_Size

func (m *DeleteRuleResponse) XXX_Size() int

func (*DeleteRuleResponse) XXX_Unmarshal

func (m *DeleteRuleResponse) XXX_Unmarshal(b []byte) error

type EventType

type EventType string

EventType is a custom type for all available Trigger Events

var (
	// EventTypeClientSubscribed describes the event emitted when a client subscribe
	EventTypeClientSubscribed EventType = EventType(c2pb.EventType_CLIENT_SUBSCRIBED.String())
	// EventTypeClientUnsubscribed describes the event emitted when a client unsubscribe
	EventTypeClientUnsubscribed EventType = EventType(c2pb.EventType_CLIENT_UNSUBSCRIBED.String())
)

type GetRuleRequest

type GetRuleRequest struct {
	RuleId               int32    `protobuf:"varint,1,opt,name=ruleId,proto3" json:"ruleId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetRuleRequest) Descriptor

func (*GetRuleRequest) Descriptor() ([]byte, []int)

func (*GetRuleRequest) GetRuleId

func (m *GetRuleRequest) GetRuleId() int32

func (*GetRuleRequest) ProtoMessage

func (*GetRuleRequest) ProtoMessage()

func (*GetRuleRequest) Reset

func (m *GetRuleRequest) Reset()

func (*GetRuleRequest) String

func (m *GetRuleRequest) String() string

func (*GetRuleRequest) XXX_DiscardUnknown

func (m *GetRuleRequest) XXX_DiscardUnknown()

func (*GetRuleRequest) XXX_Marshal

func (m *GetRuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRuleRequest) XXX_Merge

func (m *GetRuleRequest) XXX_Merge(src proto.Message)

func (*GetRuleRequest) XXX_Size

func (m *GetRuleRequest) XXX_Size() int

func (*GetRuleRequest) XXX_Unmarshal

func (m *GetRuleRequest) XXX_Unmarshal(b []byte) error

type HealthCheckRequest

type HealthCheckRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthCheckRequest) Descriptor

func (*HealthCheckRequest) Descriptor() ([]byte, []int)

func (*HealthCheckRequest) ProtoMessage

func (*HealthCheckRequest) ProtoMessage()

func (*HealthCheckRequest) Reset

func (m *HealthCheckRequest) Reset()

func (*HealthCheckRequest) String

func (m *HealthCheckRequest) String() string

func (*HealthCheckRequest) XXX_DiscardUnknown

func (m *HealthCheckRequest) XXX_DiscardUnknown()

func (*HealthCheckRequest) XXX_Marshal

func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HealthCheckRequest) XXX_Merge

func (m *HealthCheckRequest) XXX_Merge(src proto.Message)

func (*HealthCheckRequest) XXX_Size

func (m *HealthCheckRequest) XXX_Size() int

func (*HealthCheckRequest) XXX_Unmarshal

func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error

type HealthCheckResponse

type HealthCheckResponse struct {
	Code                 int64    `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	Status               string   `protobuf:"bytes,2,opt,name=Status,proto3" json:"Status,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthCheckResponse) Descriptor

func (*HealthCheckResponse) Descriptor() ([]byte, []int)

func (*HealthCheckResponse) GetCode

func (m *HealthCheckResponse) GetCode() int64

func (*HealthCheckResponse) GetStatus

func (m *HealthCheckResponse) GetStatus() string

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) Reset

func (m *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (m *HealthCheckResponse) String() string

func (*HealthCheckResponse) XXX_DiscardUnknown

func (m *HealthCheckResponse) XXX_DiscardUnknown()

func (*HealthCheckResponse) XXX_Marshal

func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HealthCheckResponse) XXX_Merge

func (m *HealthCheckResponse) XXX_Merge(src proto.Message)

func (*HealthCheckResponse) XXX_Size

func (m *HealthCheckResponse) XXX_Size() int

func (*HealthCheckResponse) XXX_Unmarshal

func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error

type ListRulesRequest

type ListRulesRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListRulesRequest) Descriptor

func (*ListRulesRequest) Descriptor() ([]byte, []int)

func (*ListRulesRequest) ProtoMessage

func (*ListRulesRequest) ProtoMessage()

func (*ListRulesRequest) Reset

func (m *ListRulesRequest) Reset()

func (*ListRulesRequest) String

func (m *ListRulesRequest) String() string

func (*ListRulesRequest) XXX_DiscardUnknown

func (m *ListRulesRequest) XXX_DiscardUnknown()

func (*ListRulesRequest) XXX_Marshal

func (m *ListRulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListRulesRequest) XXX_Merge

func (m *ListRulesRequest) XXX_Merge(src proto.Message)

func (*ListRulesRequest) XXX_Size

func (m *ListRulesRequest) XXX_Size() int

func (*ListRulesRequest) XXX_Unmarshal

func (m *ListRulesRequest) XXX_Unmarshal(b []byte) error

type MockC2PbClient

type MockC2PbClient struct {
	// contains filtered or unexported fields
}

MockC2PbClient is a mock of C2PbClient interface

func NewMockC2PbClient

func NewMockC2PbClient(ctrl *gomock.Controller) *MockC2PbClient

NewMockC2PbClient creates a new mock instance

func (*MockC2PbClient) Close

func (m *MockC2PbClient) Close() error

Close mocks base method

func (*MockC2PbClient) CountClients

CountClients mocks base method

func (*MockC2PbClient) CountClientsForTopic

CountClientsForTopic mocks base method

func (*MockC2PbClient) CountTopics

CountTopics mocks base method

func (*MockC2PbClient) CountTopicsForClient

CountTopicsForClient mocks base method

func (*MockC2PbClient) EXPECT

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

func (*MockC2PbClient) GetClients

GetClients mocks base method

func (*MockC2PbClient) GetClientsForTopic

GetClientsForTopic mocks base method

func (*MockC2PbClient) GetTopics

GetTopics mocks base method

func (*MockC2PbClient) GetTopicsForClient

GetTopicsForClient mocks base method

func (*MockC2PbClient) NewClient

NewClient mocks base method

func (*MockC2PbClient) NewClientKey

NewClientKey mocks base method

func (*MockC2PbClient) NewTopic

func (m *MockC2PbClient) NewTopic(arg0 context.Context, arg1 *pb0.NewTopicRequest, arg2 ...grpc.CallOption) (*pb0.NewTopicResponse, error)

NewTopic mocks base method

func (*MockC2PbClient) NewTopicClient

NewTopicClient mocks base method

func (*MockC2PbClient) RemoveClient

RemoveClient mocks base method

func (*MockC2PbClient) RemoveTopic

RemoveTopic mocks base method

func (*MockC2PbClient) RemoveTopicClient

RemoveTopicClient mocks base method

func (*MockC2PbClient) ResetClient

ResetClient mocks base method

func (*MockC2PbClient) SendMessage

SendMessage mocks base method

func (*MockC2PbClient) SubscribeToEventStream

SubscribeToEventStream mocks base method

type MockC2PbClientFactory

type MockC2PbClientFactory struct {
	// contains filtered or unexported fields
}

MockC2PbClientFactory is a mock of C2PbClientFactory interface

func NewMockC2PbClientFactory

func NewMockC2PbClientFactory(ctrl *gomock.Controller) *MockC2PbClientFactory

NewMockC2PbClientFactory creates a new mock instance

func (*MockC2PbClientFactory) Create

func (m *MockC2PbClientFactory) Create() (C2PbClient, error)

Create mocks base method

func (*MockC2PbClientFactory) EXPECT

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

type MockC2PbClientFactoryMockRecorder

type MockC2PbClientFactoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockC2PbClientFactoryMockRecorder is the mock recorder for MockC2PbClientFactory

func (*MockC2PbClientFactoryMockRecorder) Create

Create indicates an expected call of Create

type MockC2PbClientMockRecorder

type MockC2PbClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockC2PbClientMockRecorder is the mock recorder for MockC2PbClient

func (*MockC2PbClientMockRecorder) Close

func (mr *MockC2PbClientMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockC2PbClientMockRecorder) CountClients

func (mr *MockC2PbClientMockRecorder) CountClients(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

CountClients indicates an expected call of CountClients

func (*MockC2PbClientMockRecorder) CountClientsForTopic

func (mr *MockC2PbClientMockRecorder) CountClientsForTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

CountClientsForTopic indicates an expected call of CountClientsForTopic

func (*MockC2PbClientMockRecorder) CountTopics

func (mr *MockC2PbClientMockRecorder) CountTopics(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

CountTopics indicates an expected call of CountTopics

func (*MockC2PbClientMockRecorder) CountTopicsForClient

func (mr *MockC2PbClientMockRecorder) CountTopicsForClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

CountTopicsForClient indicates an expected call of CountTopicsForClient

func (*MockC2PbClientMockRecorder) GetClients

func (mr *MockC2PbClientMockRecorder) GetClients(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetClients indicates an expected call of GetClients

func (*MockC2PbClientMockRecorder) GetClientsForTopic

func (mr *MockC2PbClientMockRecorder) GetClientsForTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetClientsForTopic indicates an expected call of GetClientsForTopic

func (*MockC2PbClientMockRecorder) GetTopics

func (mr *MockC2PbClientMockRecorder) GetTopics(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetTopics indicates an expected call of GetTopics

func (*MockC2PbClientMockRecorder) GetTopicsForClient

func (mr *MockC2PbClientMockRecorder) GetTopicsForClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetTopicsForClient indicates an expected call of GetTopicsForClient

func (*MockC2PbClientMockRecorder) NewClient

func (mr *MockC2PbClientMockRecorder) NewClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

NewClient indicates an expected call of NewClient

func (*MockC2PbClientMockRecorder) NewClientKey

func (mr *MockC2PbClientMockRecorder) NewClientKey(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

NewClientKey indicates an expected call of NewClientKey

func (*MockC2PbClientMockRecorder) NewTopic

func (mr *MockC2PbClientMockRecorder) NewTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

NewTopic indicates an expected call of NewTopic

func (*MockC2PbClientMockRecorder) NewTopicClient

func (mr *MockC2PbClientMockRecorder) NewTopicClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

NewTopicClient indicates an expected call of NewTopicClient

func (*MockC2PbClientMockRecorder) RemoveClient

func (mr *MockC2PbClientMockRecorder) RemoveClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

RemoveClient indicates an expected call of RemoveClient

func (*MockC2PbClientMockRecorder) RemoveTopic

func (mr *MockC2PbClientMockRecorder) RemoveTopic(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

RemoveTopic indicates an expected call of RemoveTopic

func (*MockC2PbClientMockRecorder) RemoveTopicClient

func (mr *MockC2PbClientMockRecorder) RemoveTopicClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

RemoveTopicClient indicates an expected call of RemoveTopicClient

func (*MockC2PbClientMockRecorder) ResetClient

func (mr *MockC2PbClientMockRecorder) ResetClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

ResetClient indicates an expected call of ResetClient

func (*MockC2PbClientMockRecorder) SendMessage

func (mr *MockC2PbClientMockRecorder) SendMessage(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

SendMessage indicates an expected call of SendMessage

func (*MockC2PbClientMockRecorder) SubscribeToEventStream

func (mr *MockC2PbClientMockRecorder) SubscribeToEventStream(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

SubscribeToEventStream indicates an expected call of SubscribeToEventStream

type Rule

type Rule struct {
	Id                   int32                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Description          string               `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Action               ActionType           `protobuf:"varint,3,opt,name=action,proto3,enum=pb.ActionType" json:"action,omitempty"`
	LastExecuted         *timestamp.Timestamp `protobuf:"bytes,4,opt,name=lastExecuted,proto3" json:"lastExecuted,omitempty"`
	Triggers             []*Trigger           `protobuf:"bytes,5,rep,name=triggers,proto3" json:"triggers,omitempty"`
	Targets              []*Target            `protobuf:"bytes,6,rep,name=targets,proto3" json:"targets,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*Rule) Descriptor

func (*Rule) Descriptor() ([]byte, []int)

func (*Rule) GetAction

func (m *Rule) GetAction() ActionType

func (*Rule) GetDescription

func (m *Rule) GetDescription() string

func (*Rule) GetId

func (m *Rule) GetId() int32

func (*Rule) GetLastExecuted

func (m *Rule) GetLastExecuted() *timestamp.Timestamp

func (*Rule) GetTargets

func (m *Rule) GetTargets() []*Target

func (*Rule) GetTriggers

func (m *Rule) GetTriggers() []*Trigger

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) Reset

func (m *Rule) Reset()

func (*Rule) String

func (m *Rule) String() string

func (*Rule) XXX_DiscardUnknown

func (m *Rule) XXX_DiscardUnknown()

func (*Rule) XXX_Marshal

func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Rule) XXX_Merge

func (m *Rule) XXX_Merge(src proto.Message)

func (*Rule) XXX_Size

func (m *Rule) XXX_Size() int

func (*Rule) XXX_Unmarshal

func (m *Rule) XXX_Unmarshal(b []byte) error

type RuleResponse

type RuleResponse struct {
	Rule                 *Rule    `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RuleResponse) Descriptor

func (*RuleResponse) Descriptor() ([]byte, []int)

func (*RuleResponse) GetRule

func (m *RuleResponse) GetRule() *Rule

func (*RuleResponse) ProtoMessage

func (*RuleResponse) ProtoMessage()

func (*RuleResponse) Reset

func (m *RuleResponse) Reset()

func (*RuleResponse) String

func (m *RuleResponse) String() string

func (*RuleResponse) XXX_DiscardUnknown

func (m *RuleResponse) XXX_DiscardUnknown()

func (*RuleResponse) XXX_Marshal

func (m *RuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RuleResponse) XXX_Merge

func (m *RuleResponse) XXX_Merge(src proto.Message)

func (*RuleResponse) XXX_Size

func (m *RuleResponse) XXX_Size() int

func (*RuleResponse) XXX_Unmarshal

func (m *RuleResponse) XXX_Unmarshal(b []byte) error

type RulesResponse

type RulesResponse struct {
	Rules                []*Rule  `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RulesResponse) Descriptor

func (*RulesResponse) Descriptor() ([]byte, []int)

func (*RulesResponse) GetRules

func (m *RulesResponse) GetRules() []*Rule

func (*RulesResponse) ProtoMessage

func (*RulesResponse) ProtoMessage()

func (*RulesResponse) Reset

func (m *RulesResponse) Reset()

func (*RulesResponse) String

func (m *RulesResponse) String() string

func (*RulesResponse) XXX_DiscardUnknown

func (m *RulesResponse) XXX_DiscardUnknown()

func (*RulesResponse) XXX_Marshal

func (m *RulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RulesResponse) XXX_Merge

func (m *RulesResponse) XXX_Merge(src proto.Message)

func (*RulesResponse) XXX_Size

func (m *RulesResponse) XXX_Size() int

func (*RulesResponse) XXX_Unmarshal

func (m *RulesResponse) XXX_Unmarshal(b []byte) error

type Target

type Target struct {
	Id                   int32      `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Type                 TargetType `protobuf:"varint,2,opt,name=type,proto3,enum=pb.TargetType" json:"type,omitempty"`
	Expr                 string     `protobuf:"bytes,3,opt,name=expr,proto3" json:"expr,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*Target) Descriptor

func (*Target) Descriptor() ([]byte, []int)

func (*Target) GetExpr

func (m *Target) GetExpr() string

func (*Target) GetId

func (m *Target) GetId() int32

func (*Target) GetType

func (m *Target) GetType() TargetType

func (*Target) ProtoMessage

func (*Target) ProtoMessage()

func (*Target) Reset

func (m *Target) Reset()

func (*Target) String

func (m *Target) String() string

func (*Target) XXX_DiscardUnknown

func (m *Target) XXX_DiscardUnknown()

func (*Target) XXX_Marshal

func (m *Target) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Target) XXX_Merge

func (m *Target) XXX_Merge(src proto.Message)

func (*Target) XXX_Size

func (m *Target) XXX_Size() int

func (*Target) XXX_Unmarshal

func (m *Target) XXX_Unmarshal(b []byte) error

type TargetType

type TargetType int32

List of supported TargetType

const (
	TargetType_ANY    TargetType = 0
	TargetType_TOPIC  TargetType = 1
	TargetType_CLIENT TargetType = 2
)

func (TargetType) EnumDescriptor

func (TargetType) EnumDescriptor() ([]byte, []int)

func (TargetType) String

func (x TargetType) String() string

type Trigger

type Trigger struct {
	Id                   int32       `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Type                 TriggerType `protobuf:"varint,2,opt,name=type,proto3,enum=pb.TriggerType" json:"type,omitempty"`
	Settings             []byte      `protobuf:"bytes,3,opt,name=settings,proto3" json:"settings,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*Trigger) Descriptor

func (*Trigger) Descriptor() ([]byte, []int)

func (*Trigger) GetId

func (m *Trigger) GetId() int32

func (*Trigger) GetSettings

func (m *Trigger) GetSettings() []byte

func (*Trigger) GetType

func (m *Trigger) GetType() TriggerType

func (*Trigger) MarshalJSON

func (t *Trigger) MarshalJSON() ([]byte, error)

MarshalJSON is a custom json marshalling for Trigger type allowing to decode binary Settings and State to a proper json representation

func (*Trigger) ProtoMessage

func (*Trigger) ProtoMessage()

func (*Trigger) Reset

func (m *Trigger) Reset()

func (*Trigger) String

func (m *Trigger) String() string

func (*Trigger) XXX_DiscardUnknown

func (m *Trigger) XXX_DiscardUnknown()

func (*Trigger) XXX_Marshal

func (m *Trigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Trigger) XXX_Merge

func (m *Trigger) XXX_Merge(src proto.Message)

func (*Trigger) XXX_Size

func (m *Trigger) XXX_Size() int

func (*Trigger) XXX_Unmarshal

func (m *Trigger) XXX_Unmarshal(b []byte) error

type TriggerSettings

type TriggerSettings interface {
	Validate() error
	Encode() ([]byte, error)
	Decode([]byte) error
}

TriggerSettings defines a generic trigger settings structure

func Decode

func Decode(t TriggerType, settings []byte) (TriggerSettings, error)

Decode will attempt to turn []byte settings into matching struct given the trigger type

type TriggerSettingsEvent

type TriggerSettingsEvent struct {
	EventType     EventType `json:"eventType,omitempty"`
	MaxOccurrence int       `json:"maxOccurrence,omitempty"`
}

TriggerSettingsEvent holds settings for event driven trigger types

func (*TriggerSettingsEvent) Decode

func (t *TriggerSettingsEvent) Decode(b []byte) error

Decode json decode bytes to settings

func (*TriggerSettingsEvent) Encode

func (t *TriggerSettingsEvent) Encode() ([]byte, error)

Encode json encode settings to []byte

func (*TriggerSettingsEvent) Validate

func (t *TriggerSettingsEvent) Validate() error

Validate implements TriggerSettings and returns an error when the settings are invalid

type TriggerSettingsTimeInterval

type TriggerSettingsTimeInterval struct {
	Expr string `json:"expr,omitempty"`
}

TriggerSettingsTimeInterval holds settings for pb.TriggerType_TIME_INTERVAL trigger types

func (*TriggerSettingsTimeInterval) Decode

func (t *TriggerSettingsTimeInterval) Decode(b []byte) error

Decode json decode bytes to settings

func (*TriggerSettingsTimeInterval) Encode

func (t *TriggerSettingsTimeInterval) Encode() ([]byte, error)

Encode json encode settings to []byte

func (*TriggerSettingsTimeInterval) Validate

func (t *TriggerSettingsTimeInterval) Validate() error

Validate implements TriggerSettings and returns an error when the settings are invalid

type TriggerType

type TriggerType int32

List of supported TriggerType

const (
	TriggerType_UNDEFINED_TRIGGER TriggerType = 0
	TriggerType_TIME_INTERVAL     TriggerType = 1
	TriggerType_EVENT             TriggerType = 2
)

func (TriggerType) EnumDescriptor

func (TriggerType) EnumDescriptor() ([]byte, []int)

func (TriggerType) String

func (x TriggerType) String() string

type UnimplementedC2AutomationEngineServer

type UnimplementedC2AutomationEngineServer struct {
}

UnimplementedC2AutomationEngineServer can be embedded to have forward compatible implementations.

func (*UnimplementedC2AutomationEngineServer) AddRule

func (*UnimplementedC2AutomationEngineServer) DeleteRule

func (*UnimplementedC2AutomationEngineServer) GetRule

func (*UnimplementedC2AutomationEngineServer) HealthCheck

func (*UnimplementedC2AutomationEngineServer) ListRules

func (*UnimplementedC2AutomationEngineServer) UpdateRule

type UpdateRuleRequest

type UpdateRuleRequest struct {
	RuleId               int32      `protobuf:"varint,1,opt,name=ruleId,proto3" json:"ruleId,omitempty"`
	Description          string     `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Action               ActionType `protobuf:"varint,3,opt,name=action,proto3,enum=pb.ActionType" json:"action,omitempty"`
	Triggers             []*Trigger `protobuf:"bytes,4,rep,name=triggers,proto3" json:"triggers,omitempty"`
	Targets              []*Target  `protobuf:"bytes,5,rep,name=targets,proto3" json:"targets,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

UpdateRuleRequest will fetch the rule identified by ruleId, and override its description, action, triggers and targets values with those provided.

func (*UpdateRuleRequest) Descriptor

func (*UpdateRuleRequest) Descriptor() ([]byte, []int)

func (*UpdateRuleRequest) GetAction

func (m *UpdateRuleRequest) GetAction() ActionType

func (*UpdateRuleRequest) GetDescription

func (m *UpdateRuleRequest) GetDescription() string

func (*UpdateRuleRequest) GetRuleId

func (m *UpdateRuleRequest) GetRuleId() int32

func (*UpdateRuleRequest) GetTargets

func (m *UpdateRuleRequest) GetTargets() []*Target

func (*UpdateRuleRequest) GetTriggers

func (m *UpdateRuleRequest) GetTriggers() []*Trigger

func (*UpdateRuleRequest) ProtoMessage

func (*UpdateRuleRequest) ProtoMessage()

func (*UpdateRuleRequest) Reset

func (m *UpdateRuleRequest) Reset()

func (*UpdateRuleRequest) String

func (m *UpdateRuleRequest) String() string

func (*UpdateRuleRequest) XXX_DiscardUnknown

func (m *UpdateRuleRequest) XXX_DiscardUnknown()

func (*UpdateRuleRequest) XXX_Marshal

func (m *UpdateRuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateRuleRequest) XXX_Merge

func (m *UpdateRuleRequest) XXX_Merge(src proto.Message)

func (*UpdateRuleRequest) XXX_Size

func (m *UpdateRuleRequest) XXX_Size() int

func (*UpdateRuleRequest) XXX_Unmarshal

func (m *UpdateRuleRequest) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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