cli

package
v0.0.0-...-0e2b5c9 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: 9 Imported by: 0

Documentation

Overview

Package cli is a generated GoMock package.

Index

Constants

View Source
const (
	// EndpointFlag is the global flag name used to store the api endpoint url
	EndpointFlag = "endpoint"
	// CertFlag is the global flag name used to store the api certificate path
	CertFlag = "cert"
)
View Source
const (
	// MaxPageSize defines the maximum number of clients to fetch per api query
	MaxPageSize int64 = 100
)

Variables

View Source
var (
	// ErrEndpointFlagUndefined is returned when the endpoint flag cannot be found on given command
	ErrEndpointFlagUndefined = errors.New("cannot retrieve endpoint flag on given cobra command")
	// ErrCertFlagUndefined is returned when the cert flag cannot be found on given command
	ErrCertFlagUndefined = errors.New("cannot retrieve cert flag on given cobra command")
)

Functions

This section is empty.

Types

type APIClientFactory

type APIClientFactory interface {
	NewClient(cmd *cobra.Command) (C2Client, error)
}

APIClientFactory allows to create pb.C2Client instances

func NewAPIClientFactory

func NewAPIClientFactory() APIClientFactory

NewAPIClientFactory creates a new C2AutomationEngineClient factory

type C2Client

type C2Client interface {
	pb.C2Client
	Close() error
}

C2Client override the protobuf client definition to offer a Close method for the grpc connection

type Command

type Command interface {
	CobraCmd() *cobra.Command
}

Command defines a cli Command

type MockAPIClientFactory

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

MockAPIClientFactory is a mock of APIClientFactory interface

func NewMockAPIClientFactory

func NewMockAPIClientFactory(ctrl *gomock.Controller) *MockAPIClientFactory

NewMockAPIClientFactory creates a new mock instance

func (*MockAPIClientFactory) EXPECT

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

func (*MockAPIClientFactory) NewClient

func (m *MockAPIClientFactory) NewClient(arg0 *cobra.Command) (C2Client, error)

NewClient mocks base method

type MockAPIClientFactoryMockRecorder

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

MockAPIClientFactoryMockRecorder is the mock recorder for MockAPIClientFactory

func (*MockAPIClientFactoryMockRecorder) NewClient

func (mr *MockAPIClientFactoryMockRecorder) NewClient(arg0 interface{}) *gomock.Call

NewClient indicates an expected call of NewClient

type MockC2Client

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

MockC2Client is a mock of C2Client interface

func NewMockC2Client

func NewMockC2Client(ctrl *gomock.Controller) *MockC2Client

NewMockC2Client creates a new mock instance

func (*MockC2Client) Close

func (m *MockC2Client) Close() error

Close mocks base method

func (*MockC2Client) CountClients

func (m *MockC2Client) CountClients(arg0 context.Context, arg1 *pb.CountClientsRequest, arg2 ...grpc.CallOption) (*pb.CountClientsResponse, error)

CountClients mocks base method

func (*MockC2Client) CountClientsForTopic

CountClientsForTopic mocks base method

func (*MockC2Client) CountLinkedClients

CountLinkedClients mocks base method

func (*MockC2Client) CountTopics

func (m *MockC2Client) CountTopics(arg0 context.Context, arg1 *pb.CountTopicsRequest, arg2 ...grpc.CallOption) (*pb.CountTopicsResponse, error)

CountTopics mocks base method

func (*MockC2Client) CountTopicsForClient

CountTopicsForClient mocks base method

func (*MockC2Client) EXPECT

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

func (*MockC2Client) GetClients

func (m *MockC2Client) GetClients(arg0 context.Context, arg1 *pb.GetClientsRequest, arg2 ...grpc.CallOption) (*pb.GetClientsResponse, error)

GetClients mocks base method

func (*MockC2Client) GetClientsForTopic

GetClientsForTopic mocks base method

func (*MockC2Client) GetCryptoMode

func (m *MockC2Client) GetCryptoMode(arg0 context.Context, arg1 *pb.GetCryptoModeRequest, arg2 ...grpc.CallOption) (*pb.GetCryptoModeResponse, error)

GetCryptoMode mocks base method

func (*MockC2Client) GetLinkedClients

func (m *MockC2Client) GetLinkedClients(arg0 context.Context, arg1 *pb.GetLinkedClientsRequest, arg2 ...grpc.CallOption) (*pb.GetLinkedClientsResponse, error)

GetLinkedClients mocks base method

func (*MockC2Client) GetTopics

func (m *MockC2Client) GetTopics(arg0 context.Context, arg1 *pb.GetTopicsRequest, arg2 ...grpc.CallOption) (*pb.GetTopicsResponse, error)

GetTopics mocks base method

func (*MockC2Client) GetTopicsForClient

GetTopicsForClient mocks base method

func (*MockC2Client) HealthCheck

func (m *MockC2Client) HealthCheck(arg0 context.Context, arg1 *pb.HealthCheckRequest, arg2 ...grpc.CallOption) (*pb.HealthCheckResponse, error)

HealthCheck mocks base method

func (*MockC2Client) LinkClient

func (m *MockC2Client) LinkClient(arg0 context.Context, arg1 *pb.LinkClientRequest, arg2 ...grpc.CallOption) (*pb.LinkClientResponse, error)

LinkClient mocks base method

func (*MockC2Client) NewC2Key

func (m *MockC2Client) NewC2Key(arg0 context.Context, arg1 *pb.NewC2KeyRequest, arg2 ...grpc.CallOption) (*pb.NewC2KeyResponse, error)

NewC2Key mocks base method

func (*MockC2Client) NewClient

func (m *MockC2Client) NewClient(arg0 context.Context, arg1 *pb.NewClientRequest, arg2 ...grpc.CallOption) (*pb.NewClientResponse, error)

NewClient mocks base method

func (*MockC2Client) NewClientKey

func (m *MockC2Client) NewClientKey(arg0 context.Context, arg1 *pb.NewClientKeyRequest, arg2 ...grpc.CallOption) (*pb.NewClientKeyResponse, error)

NewClientKey mocks base method

func (*MockC2Client) NewTopic

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

NewTopic mocks base method

func (*MockC2Client) NewTopicClient

func (m *MockC2Client) NewTopicClient(arg0 context.Context, arg1 *pb.NewTopicClientRequest, arg2 ...grpc.CallOption) (*pb.NewTopicClientResponse, error)

NewTopicClient mocks base method

func (*MockC2Client) ProtectMessage

func (m *MockC2Client) ProtectMessage(arg0 context.Context, arg1 *pb.ProtectMessageRequest, arg2 ...grpc.CallOption) (*pb.ProtectMessageResponse, error)

ProtectMessage mocks base method

func (*MockC2Client) RemoveClient

func (m *MockC2Client) RemoveClient(arg0 context.Context, arg1 *pb.RemoveClientRequest, arg2 ...grpc.CallOption) (*pb.RemoveClientResponse, error)

RemoveClient mocks base method

func (*MockC2Client) RemoveClientPubKey

RemoveClientPubKey mocks base method

func (*MockC2Client) RemoveTopic

func (m *MockC2Client) RemoveTopic(arg0 context.Context, arg1 *pb.RemoveTopicRequest, arg2 ...grpc.CallOption) (*pb.RemoveTopicResponse, error)

RemoveTopic mocks base method

func (*MockC2Client) RemoveTopicClient

RemoveTopicClient mocks base method

func (*MockC2Client) ResetClient

func (m *MockC2Client) ResetClient(arg0 context.Context, arg1 *pb.ResetClientRequest, arg2 ...grpc.CallOption) (*pb.ResetClientResponse, error)

ResetClient mocks base method

func (*MockC2Client) ResetClientPubKeys

ResetClientPubKeys mocks base method

func (*MockC2Client) SendClientPubKey

func (m *MockC2Client) SendClientPubKey(arg0 context.Context, arg1 *pb.SendClientPubKeyRequest, arg2 ...grpc.CallOption) (*pb.SendClientPubKeyResponse, error)

SendClientPubKey mocks base method

func (*MockC2Client) SubscribeToEventStream

SubscribeToEventStream mocks base method

func (*MockC2Client) UnlinkClient

func (m *MockC2Client) UnlinkClient(arg0 context.Context, arg1 *pb.UnlinkClientRequest, arg2 ...grpc.CallOption) (*pb.UnlinkClientResponse, error)

UnlinkClient mocks base method

func (*MockC2Client) UnprotectMessage

func (m *MockC2Client) UnprotectMessage(arg0 context.Context, arg1 *pb.UnprotectMessageRequest, arg2 ...grpc.CallOption) (*pb.UnprotectMessageResponse, error)

UnprotectMessage mocks base method

type MockC2ClientMockRecorder

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

MockC2ClientMockRecorder is the mock recorder for MockC2Client

func (*MockC2ClientMockRecorder) Close

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

Close indicates an expected call of Close

func (*MockC2ClientMockRecorder) CountClients

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

CountClients indicates an expected call of CountClients

func (*MockC2ClientMockRecorder) CountClientsForTopic

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

CountClientsForTopic indicates an expected call of CountClientsForTopic

func (*MockC2ClientMockRecorder) CountLinkedClients

func (mr *MockC2ClientMockRecorder) CountLinkedClients(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

CountLinkedClients indicates an expected call of CountLinkedClients

func (*MockC2ClientMockRecorder) CountTopics

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

CountTopics indicates an expected call of CountTopics

func (*MockC2ClientMockRecorder) CountTopicsForClient

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

CountTopicsForClient indicates an expected call of CountTopicsForClient

func (*MockC2ClientMockRecorder) GetClients

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

GetClients indicates an expected call of GetClients

func (*MockC2ClientMockRecorder) GetClientsForTopic

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

GetClientsForTopic indicates an expected call of GetClientsForTopic

func (*MockC2ClientMockRecorder) GetCryptoMode

func (mr *MockC2ClientMockRecorder) GetCryptoMode(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetCryptoMode indicates an expected call of GetCryptoMode

func (*MockC2ClientMockRecorder) GetLinkedClients

func (mr *MockC2ClientMockRecorder) GetLinkedClients(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

GetLinkedClients indicates an expected call of GetLinkedClients

func (*MockC2ClientMockRecorder) GetTopics

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

GetTopics indicates an expected call of GetTopics

func (*MockC2ClientMockRecorder) GetTopicsForClient

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

GetTopicsForClient indicates an expected call of GetTopicsForClient

func (*MockC2ClientMockRecorder) HealthCheck

func (mr *MockC2ClientMockRecorder) HealthCheck(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

HealthCheck indicates an expected call of HealthCheck

func (*MockC2ClientMockRecorder) LinkClient

func (mr *MockC2ClientMockRecorder) LinkClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

LinkClient indicates an expected call of LinkClient

func (*MockC2ClientMockRecorder) NewC2Key

func (mr *MockC2ClientMockRecorder) NewC2Key(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

NewC2Key indicates an expected call of NewC2Key

func (*MockC2ClientMockRecorder) NewClient

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

NewClient indicates an expected call of NewClient

func (*MockC2ClientMockRecorder) NewClientKey

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

NewClientKey indicates an expected call of NewClientKey

func (*MockC2ClientMockRecorder) NewTopic

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

NewTopic indicates an expected call of NewTopic

func (*MockC2ClientMockRecorder) NewTopicClient

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

NewTopicClient indicates an expected call of NewTopicClient

func (*MockC2ClientMockRecorder) ProtectMessage

func (mr *MockC2ClientMockRecorder) ProtectMessage(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

ProtectMessage indicates an expected call of ProtectMessage

func (*MockC2ClientMockRecorder) RemoveClient

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

RemoveClient indicates an expected call of RemoveClient

func (*MockC2ClientMockRecorder) RemoveClientPubKey

func (mr *MockC2ClientMockRecorder) RemoveClientPubKey(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

RemoveClientPubKey indicates an expected call of RemoveClientPubKey

func (*MockC2ClientMockRecorder) RemoveTopic

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

RemoveTopic indicates an expected call of RemoveTopic

func (*MockC2ClientMockRecorder) RemoveTopicClient

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

RemoveTopicClient indicates an expected call of RemoveTopicClient

func (*MockC2ClientMockRecorder) ResetClient

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

ResetClient indicates an expected call of ResetClient

func (*MockC2ClientMockRecorder) ResetClientPubKeys

func (mr *MockC2ClientMockRecorder) ResetClientPubKeys(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

ResetClientPubKeys indicates an expected call of ResetClientPubKeys

func (*MockC2ClientMockRecorder) SendClientPubKey

func (mr *MockC2ClientMockRecorder) SendClientPubKey(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

SendClientPubKey indicates an expected call of SendClientPubKey

func (*MockC2ClientMockRecorder) SubscribeToEventStream

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

SubscribeToEventStream indicates an expected call of SubscribeToEventStream

func (*MockC2ClientMockRecorder) UnlinkClient

func (mr *MockC2ClientMockRecorder) UnlinkClient(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

UnlinkClient indicates an expected call of UnlinkClient

func (*MockC2ClientMockRecorder) UnprotectMessage

func (mr *MockC2ClientMockRecorder) UnprotectMessage(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

UnprotectMessage indicates an expected call of UnprotectMessage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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