placement

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package placement is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Init will initialize a placement give a valid placement request
	Init(request *admin.PlacementInitRequest) error
	// Get will provide the current placement
	Get() (placement m3placement.Placement, err error)
	// Delete will delete the current placment
	Delete() error
	// Add will add an instance to the placement
	Add(instance placementpb.Instance) error
	// Remove removes a given instance with the given ID from the placement.
	Remove(id string) error
	// Replace replaces one instance with another.
	Replace(leavingInstanceID string, newInstance placementpb.Instance) error
}

Client provides the interface to interact with the placement API

func NewClient

func NewClient(opts ...Option) (Client, error)

NewClient is the constructor the Placement interface

type MockClient

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

MockClient is a mock of Client interface

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance

func (*MockClient) Add

func (m *MockClient) Add(instance placementpb.Instance) error

Add mocks base method

func (*MockClient) Delete

func (m *MockClient) Delete() error

Delete mocks base method

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) Get

func (m *MockClient) Get() (placement.Placement, error)

Get mocks base method

func (*MockClient) Init

func (m *MockClient) Init(request *admin.PlacementInitRequest) error

Init mocks base method

func (*MockClient) Remove

func (m *MockClient) Remove(id string) error

Remove mocks base method

func (*MockClient) Replace

func (m *MockClient) Replace(leavingInstanceID string, newInstance placementpb.Instance) error

Replace mocks base method

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient

func (*MockClientMockRecorder) Add

func (mr *MockClientMockRecorder) Add(instance interface{}) *gomock.Call

Add indicates an expected call of Add

func (*MockClientMockRecorder) Delete

func (mr *MockClientMockRecorder) Delete() *gomock.Call

Delete indicates an expected call of Delete

func (*MockClientMockRecorder) Get

func (mr *MockClientMockRecorder) Get() *gomock.Call

Get indicates an expected call of Get

func (*MockClientMockRecorder) Init

func (mr *MockClientMockRecorder) Init(request interface{}) *gomock.Call

Init indicates an expected call of Init

func (*MockClientMockRecorder) Remove

func (mr *MockClientMockRecorder) Remove(id interface{}) *gomock.Call

Remove indicates an expected call of Remove

func (*MockClientMockRecorder) Replace

func (mr *MockClientMockRecorder) Replace(leavingInstanceID, newInstance interface{}) *gomock.Call

Replace indicates an expected call of Replace

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option provides an interface that can be used for setter options with the constructor

func WithClient

func WithClient(cl m3admin.Client) Option

WithClient configures an m3admin client.

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger is a setter to override the default logger

func WithURL

func WithURL(u string) Option

WithURL is a setter to override the default URL

Jump to

Keyboard shortcuts

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