Documentation ¶
Overview ¶
Package varlink implements the Varlink protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Varlink client.
Client methods are safe to use from multiple goroutines.
type ClientCall ¶
type ClientCall struct {
// contains filtered or unexported fields
}
ClientCall represents an in-progress Varlink method call.
func (*ClientCall) Next ¶
func (cc *ClientCall) Next(out interface{}) error
Next waits for a reply.
If there are no more replies, io.EOF is returned.
type ClientError ¶
type ClientError struct { Name string Parameters json.RawMessage }
ClientError is a Varlink error returned by a service to a Client.
func (*ClientError) Error ¶
func (err *ClientError) Error() string
Error implements the error interface.
type Handler ¶
type Handler interface {
HandleVarlink(call *ServerCall, req *ServerRequest) error
}
A Handler processes Varlink requests.
type Server ¶
type Server struct {
Handler Handler
}
Server is a Varlink server.
The Handler field must be set to a Varlink request handler.
type ServerCall ¶
type ServerCall struct {
// contains filtered or unexported fields
}
ServerCall represents an in-progress Varlink method call.
Handlers may call Reply any number of times, then they must end the call with CloseWithReply.
func (*ServerCall) CloseWithReply ¶
func (call *ServerCall) CloseWithReply(parameters interface{}) error
CloseWithReply sends a final reply and closes the call.
No more replies may be sent.
func (*ServerCall) Reply ¶
func (call *ServerCall) Reply(parameters interface{}) error
Reply sends a non-final reply.
This can only be used if ServerRequest.More is set to true.
type ServerError ¶
type ServerError struct { Name string Parameters interface{} }
ServerError is an error to be sent to a Varlink client.
func (*ServerError) Error ¶
func (err *ServerError) Error() string
Error implements the error interface.
type ServerRequest ¶
type ServerRequest struct { Method string `json:"method"` Parameters json.RawMessage `json:"parameters"` Oneway bool `json:"oneway,omitempty"` More bool `json:"more,omitempty"` Upgrade bool `json:"upgrade,omitempty"` }
ServerRequest is a request coming from a Varlink client.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package varlinkdef implements the Varlink interface definition format.
|
Package varlinkdef implements the Varlink interface definition format. |