server

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package server is a generated GoMock package.

Package server is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockReset

func MockReset()

func MockServerGetter

func MockServerGetter(gt Getter)

Types

type Getter

type Getter func(volumeID uint64, addr string) (Server, error)

type Instance

type Instance interface {
	ID() vanus.ID
	Address() string
	Close() error
	GetMeta() *metadata.VolumeMetadata
	CreateBlock(context.Context, int64) (*metadata.Block, error)
	DeleteBlock(context.Context, vanus.ID) error
	GetServer() Server
	SetServer(Server)
}

func NewInstance

func NewInstance(md *metadata.VolumeMetadata) Instance

type Manager

type Manager interface {
	AddServer(ctx context.Context, srv Server) error
	RemoveServer(ctx context.Context, srv Server) error
	GetServerByAddress(addr string) Server
	GetServerByVolumeID(id uint64) Server
	Run(ctx context.Context) error
	Stop(ctx context.Context)
	CanCreateEventbus(ctx context.Context, replicaNum int) bool
}

func NewServerManager

func NewServerManager() Manager

type MockInstance

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

MockInstance is a mock of Instance interface.

func NewMockInstance

func NewMockInstance(ctrl *gomock.Controller) *MockInstance

NewMockInstance creates a new mock instance.

func (*MockInstance) Address

func (m *MockInstance) Address() string

Address mocks base method.

func (*MockInstance) Close

func (m *MockInstance) Close() error

Close mocks base method.

func (*MockInstance) CreateBlock

func (m *MockInstance) CreateBlock(arg0 context.Context, arg1 int64) (*metadata.Block, error)

CreateBlock mocks base method.

func (*MockInstance) DeleteBlock

func (m *MockInstance) DeleteBlock(arg0 context.Context, arg1 vanus.ID) error

DeleteBlock mocks base method.

func (*MockInstance) EXPECT

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

func (*MockInstance) GetMeta

func (m *MockInstance) GetMeta() *metadata.VolumeMetadata

GetMeta mocks base method.

func (*MockInstance) GetServer

func (m *MockInstance) GetServer() Server

GetServer mocks base method.

func (*MockInstance) ID

func (m *MockInstance) ID() vanus.ID

ID mocks base method.

func (*MockInstance) SetServer

func (m *MockInstance) SetServer(arg0 Server)

SetServer mocks base method.

type MockInstanceMockRecorder

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

MockInstanceMockRecorder is the mock recorder for MockInstance.

func (*MockInstanceMockRecorder) Address

func (mr *MockInstanceMockRecorder) Address() *gomock.Call

Address indicates an expected call of Address.

func (*MockInstanceMockRecorder) Close

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

Close indicates an expected call of Close.

func (*MockInstanceMockRecorder) CreateBlock

func (mr *MockInstanceMockRecorder) CreateBlock(arg0, arg1 interface{}) *gomock.Call

CreateBlock indicates an expected call of CreateBlock.

func (*MockInstanceMockRecorder) DeleteBlock

func (mr *MockInstanceMockRecorder) DeleteBlock(arg0, arg1 interface{}) *gomock.Call

DeleteBlock indicates an expected call of DeleteBlock.

func (*MockInstanceMockRecorder) GetMeta

func (mr *MockInstanceMockRecorder) GetMeta() *gomock.Call

GetMeta indicates an expected call of GetMeta.

func (*MockInstanceMockRecorder) GetServer

func (mr *MockInstanceMockRecorder) GetServer() *gomock.Call

GetServer indicates an expected call of GetServer.

func (*MockInstanceMockRecorder) ID

ID indicates an expected call of ID.

func (*MockInstanceMockRecorder) SetServer

func (mr *MockInstanceMockRecorder) SetServer(arg0 interface{}) *gomock.Call

SetServer indicates an expected call of SetServer.

type MockManager

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

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) AddServer

func (m *MockManager) AddServer(ctx context.Context, srv Server) error

AddServer mocks base method.

func (*MockManager) CanCreateEventbus

func (m *MockManager) CanCreateEventbus(ctx context.Context, replicaNum int) bool

CanCreateEventbus mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

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

func (*MockManager) GetServerByAddress

func (m *MockManager) GetServerByAddress(addr string) Server

GetServerByAddress mocks base method.

func (*MockManager) GetServerByVolumeID

func (m *MockManager) GetServerByVolumeID(id uint64) Server

GetServerByVolumeID mocks base method.

func (*MockManager) RemoveServer

func (m *MockManager) RemoveServer(ctx context.Context, srv Server) error

RemoveServer mocks base method.

func (*MockManager) Run

func (m *MockManager) Run(ctx context.Context) error

Run mocks base method.

func (*MockManager) Stop

func (m *MockManager) Stop(ctx context.Context)

Stop mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) AddServer

func (mr *MockManagerMockRecorder) AddServer(ctx, srv interface{}) *gomock.Call

AddServer indicates an expected call of AddServer.

func (*MockManagerMockRecorder) CanCreateEventbus

func (mr *MockManagerMockRecorder) CanCreateEventbus(ctx, replicaNum interface{}) *gomock.Call

CanCreateEventbus indicates an expected call of CanCreateEventbus.

func (*MockManagerMockRecorder) GetServerByAddress

func (mr *MockManagerMockRecorder) GetServerByAddress(addr interface{}) *gomock.Call

GetServerByAddress indicates an expected call of GetServerByAddress.

func (*MockManagerMockRecorder) GetServerByVolumeID

func (mr *MockManagerMockRecorder) GetServerByVolumeID(id interface{}) *gomock.Call

GetServerByVolumeID indicates an expected call of GetServerByVolumeID.

func (*MockManagerMockRecorder) RemoveServer

func (mr *MockManagerMockRecorder) RemoveServer(ctx, srv interface{}) *gomock.Call

RemoveServer indicates an expected call of RemoveServer.

func (*MockManagerMockRecorder) Run

func (mr *MockManagerMockRecorder) Run(ctx interface{}) *gomock.Call

Run indicates an expected call of Run.

func (*MockManagerMockRecorder) Stop

func (mr *MockManagerMockRecorder) Stop(ctx interface{}) *gomock.Call

Stop indicates an expected call of Stop.

type MockServer

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

MockServer is a mock of Server interface.

func NewMockServer

func NewMockServer(ctrl *gomock.Controller) *MockServer

NewMockServer creates a new mock instance.

func (*MockServer) Address

func (m *MockServer) Address() string

Address mocks base method.

func (*MockServer) Close

func (m *MockServer) Close() error

Close mocks base method.

func (*MockServer) EXPECT

func (m *MockServer) EXPECT() *MockServerMockRecorder

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

func (*MockServer) GetClient

func (m *MockServer) GetClient() segment.SegmentServerClient

GetClient mocks base method.

func (*MockServer) IsActive

func (m *MockServer) IsActive(ctx context.Context) bool

IsActive mocks base method.

func (*MockServer) Polish

func (m *MockServer) Polish()

Polish mocks base method.

func (*MockServer) RemoteStart

func (m *MockServer) RemoteStart(ctx context.Context) error

RemoteStart mocks base method.

func (*MockServer) RemoteStop

func (m *MockServer) RemoteStop(ctx context.Context)

RemoteStop mocks base method.

func (*MockServer) Uptime

func (m *MockServer) Uptime() time.Time

Uptime mocks base method.

func (*MockServer) VolumeID

func (m *MockServer) VolumeID() uint64

VolumeID mocks base method.

type MockServerMockRecorder

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

MockServerMockRecorder is the mock recorder for MockServer.

func (*MockServerMockRecorder) Address

func (mr *MockServerMockRecorder) Address() *gomock.Call

Address indicates an expected call of Address.

func (*MockServerMockRecorder) Close

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

Close indicates an expected call of Close.

func (*MockServerMockRecorder) GetClient

func (mr *MockServerMockRecorder) GetClient() *gomock.Call

GetClient indicates an expected call of GetClient.

func (*MockServerMockRecorder) IsActive

func (mr *MockServerMockRecorder) IsActive(ctx interface{}) *gomock.Call

IsActive indicates an expected call of IsActive.

func (*MockServerMockRecorder) Polish

func (mr *MockServerMockRecorder) Polish() *gomock.Call

Polish indicates an expected call of Polish.

func (*MockServerMockRecorder) RemoteStart

func (mr *MockServerMockRecorder) RemoteStart(ctx interface{}) *gomock.Call

RemoteStart indicates an expected call of RemoteStart.

func (*MockServerMockRecorder) RemoteStop

func (mr *MockServerMockRecorder) RemoteStop(ctx interface{}) *gomock.Call

RemoteStop indicates an expected call of RemoteStop.

func (*MockServerMockRecorder) Uptime

func (mr *MockServerMockRecorder) Uptime() *gomock.Call

Uptime indicates an expected call of Uptime.

func (*MockServerMockRecorder) VolumeID

func (mr *MockServerMockRecorder) VolumeID() *gomock.Call

VolumeID indicates an expected call of VolumeID.

type Server

type Server interface {
	RemoteStart(ctx context.Context) error
	RemoteStop(ctx context.Context)
	GetClient() segpb.SegmentServerClient
	VolumeID() uint64
	Address() string
	Close() error
	Polish()
	IsActive(ctx context.Context) bool
	Uptime() time.Time
}

func NewSegmentServer

func NewSegmentServer(volumeID uint64, addr string) (Server, error)

func NewSegmentServerWithVolumeID

func NewSegmentServerWithVolumeID(volumeID uint64, addr string) (Server, error)

Jump to

Keyboard shortcuts

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