rpc

package
v0.3.0-prep Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CategoriseRPCError

func CategoriseRPCError(err error) error

CategoriseError turns any old error from an RPC call into a FatalError or a (non-fatal) ClusterError; or nil, if it happens to be nil to start off with.

Types

type AllServicesRequestV4

type AllServicesRequestV4 struct {
	MaybeNamespace string
	Ignored        flux.ServiceIDSet
}

AllServicesRequest is the request datastructure for AllServices

type ApplyResult

type ApplyResult map[flux.ServiceID]string

net/rpc cannot serialise errors, so we transmit strings and reconstitute them on the other side.

type RPCClientV4

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

RPCClientV4 is the rpc-backed implementation of a platform, for talking to remote daemons.

func NewClientV4

func NewClientV4(conn io.ReadWriteCloser) *RPCClientV4

NewClient creates a new rpc-backed implementation of the platform.

func (*RPCClientV4) AllServices

func (p *RPCClientV4) AllServices(maybeNamespace string, ignored flux.ServiceIDSet) ([]platform.Service, error)

AllServices asks the remote platform to list all services.

func (*RPCClientV4) Apply

func (p *RPCClientV4) Apply(defs []platform.ServiceDefinition) error

Apply tells the remote platform to apply some new service definitions.

func (*RPCClientV4) Close

func (p *RPCClientV4) Close() error

Close closes the connection to the remote platform, it does *not* cause the remote platform to shut down.

func (RPCClientV4) Export

func (bc RPCClientV4) Export() ([]byte, error)

func (*RPCClientV4) Ping

func (p *RPCClientV4) Ping() error

Ping is used to check if the remote platform is available.

func (*RPCClientV4) SomeServices

func (p *RPCClientV4) SomeServices(ids []flux.ServiceID) ([]platform.Service, error)

SomeServices asks the remote platform about some specific set of services.

func (RPCClientV4) Sync

func (bc RPCClientV4) Sync(platform.SyncDef) error

func (*RPCClientV4) Version

func (p *RPCClientV4) Version() (string, error)

Version is used to check if the remote platform is available

type RPCClientV5

type RPCClientV5 struct {
	*RPCClientV4
}

RPCClient is the rpc-backed implementation of a platform, for talking to remote daemons.

func NewClientV5

func NewClientV5(conn io.ReadWriteCloser) *RPCClientV5

NewClient creates a new rpc-backed implementation of the platform.

func (*RPCClientV5) Export

func (p *RPCClientV5) Export() ([]byte, error)

Export is used to get service configuration in platform-specific format

func (*RPCClientV5) Sync

func (p *RPCClientV5) Sync(spec platform.SyncDef) error

type RPCServer

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

func (*RPCServer) AllServices

func (p *RPCServer) AllServices(req AllServicesRequestV4, resp *[]platform.Service) error

func (*RPCServer) Apply

func (p *RPCServer) Apply(defs []platform.ServiceDefinition, applyResult *ApplyResult) error

func (*RPCServer) Export

func (p *RPCServer) Export(_ struct{}, resp *[]byte) error

func (*RPCServer) Ping

func (p *RPCServer) Ping(_ struct{}, _ *struct{}) error

func (*RPCServer) Regrade

func (p *RPCServer) Regrade(defs []platform.ServiceDefinition, applyResult *ApplyResult) error

Regrade is still around for backwards compatibility, though it is called "Apply" everywhere else.

func (*RPCServer) SomeServices

func (p *RPCServer) SomeServices(ids []flux.ServiceID, resp *[]platform.Service) error

func (*RPCServer) Sync

func (p *RPCServer) Sync(spec platform.SyncDef, syncResult *SyncResult) error

func (*RPCServer) Version

func (p *RPCServer) Version(_ struct{}, resp *string) error

type Server

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

Server takes a platform and makes it available over RPC.

func NewServer

func NewServer(p platform.Platform) (*Server, error)

NewServer instantiates a new RPC server, handling requests on the conn by invoking methods on the underlying (assumed local) platform.

func (*Server) ServeConn

func (c *Server) ServeConn(conn io.ReadWriteCloser)

type SyncResult

type SyncResult map[string]string

Likewise with SyncResult

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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