rpcdriver

package
v0.0.0-...-dfdfe39 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RPCServiceNameV0 = `RpcServerDriver`
	RPCServiceNameV1 = `RPCServerDriver`

	HeartbeatMethod       = `.Heartbeat`
	GetVersionMethod      = `.GetVersion`
	CloseMethod           = `.Close`
	SetConfigRawMethod    = `.SetConfigRaw`
	UpdateConfigRawMethod = `.UpdateConfigRaw`
	GetConfigRawMethod    = `.GetConfigRaw`
	DriverNameMethod      = `.DriverName`
	GetMachineNameMethod  = `.GetMachineName`
	GetIPMethod           = `.GetIP`
	GetBundleNameMethod   = `.GetBundleName`
	GetStateMethod        = `.GetState`
	PreCreateCheckMethod  = `.PreCreateCheck`
	CreateMethod          = `.Create`
	RemoveMethod          = `.Remove`
	StartMethod           = `.Start`
	StopMethod            = `.Stop`
	KillMethod            = `.Kill`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRPCClientDriverFactory

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

func (*DefaultRPCClientDriverFactory) Close

func (*DefaultRPCClientDriverFactory) NewRPCClientDriver

func (f *DefaultRPCClientDriverFactory) NewRPCClientDriver(driverName string, driverPath string, rawDriver []byte) (*RPCClientDriver, error)

type InternalClient

type InternalClient struct {
	MachineName string
	RPCClient   *rpc.Client
	// contains filtered or unexported fields
}

func NewInternalClient

func NewInternalClient(rpcclient *rpc.Client) *InternalClient

func (*InternalClient) Call

func (ic *InternalClient) Call(serviceMethod string, args interface{}, reply interface{}) error

type RPCCall

type RPCCall struct {
	ServiceMethod string
	Args          interface{}
	Reply         interface{}
}

type RPCClientDriver

type RPCClientDriver struct {
	Client *InternalClient
	// contains filtered or unexported fields
}

func (*RPCClientDriver) Create

func (c *RPCClientDriver) Create() error

func (*RPCClientDriver) DriverName

func (c *RPCClientDriver) DriverName() string

DriverName returns the name of the driver

func (*RPCClientDriver) DriverVersion

func (c *RPCClientDriver) DriverVersion() string

DriverVersion returns the name of the driver

func (*RPCClientDriver) GetBundleName

func (c *RPCClientDriver) GetBundleName() (string, error)

func (*RPCClientDriver) GetConfigRaw

func (c *RPCClientDriver) GetConfigRaw() ([]byte, error)

func (*RPCClientDriver) GetIP

func (c *RPCClientDriver) GetIP() (string, error)

func (*RPCClientDriver) GetMachineName

func (c *RPCClientDriver) GetMachineName() string

func (*RPCClientDriver) GetState

func (c *RPCClientDriver) GetState() (state.State, error)

func (*RPCClientDriver) Kill

func (c *RPCClientDriver) Kill() error

func (*RPCClientDriver) MarshalJSON

func (c *RPCClientDriver) MarshalJSON() ([]byte, error)

func (*RPCClientDriver) PreCreateCheck

func (c *RPCClientDriver) PreCreateCheck() error

func (*RPCClientDriver) Remove

func (c *RPCClientDriver) Remove() error

func (*RPCClientDriver) SetConfigRaw

func (c *RPCClientDriver) SetConfigRaw(data []byte) error

func (*RPCClientDriver) Start

func (c *RPCClientDriver) Start() error

func (*RPCClientDriver) Stop

func (c *RPCClientDriver) Stop() error

func (*RPCClientDriver) UnmarshalJSON

func (c *RPCClientDriver) UnmarshalJSON(data []byte) error

func (*RPCClientDriver) UpdateConfigRaw

func (c *RPCClientDriver) UpdateConfigRaw(data []byte) error

type RPCClientDriverFactory

type RPCClientDriverFactory interface {
	NewRPCClientDriver(driverName string, driverPath string, rawDriver []byte) (*RPCClientDriver, error)
	io.Closer
}

func NewRPCClientDriverFactory

func NewRPCClientDriverFactory() RPCClientDriverFactory

type RPCServerDriver

type RPCServerDriver struct {
	ActualDriver drivers.Driver
	CloseCh      chan bool
	HeartbeatCh  chan bool
}

func NewRPCServerDriver

func NewRPCServerDriver(d drivers.Driver) *RPCServerDriver

func (*RPCServerDriver) Close

func (r *RPCServerDriver) Close(_, _ *struct{}) error

func (*RPCServerDriver) Create

func (r *RPCServerDriver) Create(_, _ *struct{}) (err error)

func (*RPCServerDriver) DriverName

func (r *RPCServerDriver) DriverName(_ *struct{}, reply *string) error

func (*RPCServerDriver) GetBundleName

func (r *RPCServerDriver) GetBundleName(_ *struct{}, reply *string) error

func (*RPCServerDriver) GetConfigRaw

func (r *RPCServerDriver) GetConfigRaw(_ *struct{}, reply *[]byte) error

func (*RPCServerDriver) GetIP

func (r *RPCServerDriver) GetIP(_ *struct{}, reply *string) error

func (*RPCServerDriver) GetMachineName

func (r *RPCServerDriver) GetMachineName(_ *struct{}, reply *string) error

func (*RPCServerDriver) GetState

func (r *RPCServerDriver) GetState(_ *struct{}, reply *state.State) error

func (*RPCServerDriver) GetVersion

func (r *RPCServerDriver) GetVersion(_ *struct{}, reply *int) error

func (*RPCServerDriver) Heartbeat

func (r *RPCServerDriver) Heartbeat(_ *struct{}, _ *struct{}) error

func (*RPCServerDriver) Kill

func (r *RPCServerDriver) Kill(_ *struct{}, _ *struct{}) error

func (*RPCServerDriver) PreCreateCheck

func (r *RPCServerDriver) PreCreateCheck(_ *struct{}, _ *struct{}) error

func (*RPCServerDriver) Remove

func (r *RPCServerDriver) Remove(_ *struct{}, _ *struct{}) error

func (*RPCServerDriver) SetConfigRaw

func (r *RPCServerDriver) SetConfigRaw(data []byte, _ *struct{}) error

func (*RPCServerDriver) Start

func (r *RPCServerDriver) Start(_ *struct{}, _ *struct{}) error

func (*RPCServerDriver) Stop

func (r *RPCServerDriver) Stop(_ *struct{}, _ *struct{}) error

func (*RPCServerDriver) UpdateConfigRaw

func (r *RPCServerDriver) UpdateConfigRaw(data []byte, _ *struct{}) error

type Stacker

type Stacker interface {
	Stack() []byte
}

type StandardStack

type StandardStack struct{}

func (*StandardStack) Stack

func (ss *StandardStack) Stack() []byte

Jump to

Keyboard shortcuts

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