Documentation ¶
Index ¶
- func CategoriseRPCError(err error) error
- type AllServicesRequestV4
- type ApplyResult
- type RPCClientV4
- func (p *RPCClientV4) AllServices(maybeNamespace string, ignored flux.ServiceIDSet) ([]platform.Service, error)
- func (p *RPCClientV4) Apply(defs []platform.ServiceDefinition) error
- func (p *RPCClientV4) Close() error
- func (bc RPCClientV4) Export() ([]byte, error)
- func (p *RPCClientV4) Ping() error
- func (p *RPCClientV4) SomeServices(ids []flux.ServiceID) ([]platform.Service, error)
- func (bc RPCClientV4) Sync(platform.SyncDef) error
- func (p *RPCClientV4) Version() (string, error)
- type RPCClientV5
- type RPCServer
- func (p *RPCServer) AllServices(req AllServicesRequestV4, resp *[]platform.Service) error
- func (p *RPCServer) Apply(defs []platform.ServiceDefinition, applyResult *ApplyResult) error
- func (p *RPCServer) Export(_ struct{}, resp *[]byte) error
- func (p *RPCServer) Ping(_ struct{}, _ *struct{}) error
- func (p *RPCServer) Regrade(defs []platform.ServiceDefinition, applyResult *ApplyResult) error
- func (p *RPCServer) SomeServices(ids []flux.ServiceID, resp *[]platform.Service) error
- func (p *RPCServer) Sync(spec platform.SyncDef, syncResult *SyncResult) error
- func (p *RPCServer) Version(_ struct{}, resp *string) error
- type Server
- type SyncResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CategoriseRPCError ¶
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 ¶
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) Ping ¶
func (p *RPCClientV4) Ping() error
Ping is used to check if the remote platform is available.
func (*RPCClientV4) SomeServices ¶
SomeServices asks the remote platform about some specific set of services.
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
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) 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 ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server takes a platform and makes it available over RPC.
func NewServer ¶
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)