varlink

package module
v0.0.0-...-b4f51b2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 8 Imported by: 0

README

Go Reference

A Go library for Varlink.

License

MIT

Documentation

Overview

Package varlink implements the Varlink protocol.

See https://varlink.org/

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
}

func NewClient

func NewClient(conn net.Conn) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Do

func (c *Client) Do(method string, in, out interface{}) error

func (*Client) DoMore

func (c *Client) DoMore(method string, in interface{}) (*ClientCall, error)

type ClientCall

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

func (*ClientCall) Next

func (cc *ClientCall) Next(out interface{}) error

type ClientError

type ClientError struct {
	Name       string
	Parameters json.RawMessage
}

func (*ClientError) Error

func (err *ClientError) Error() string

type Handler

type Handler interface {
	HandleVarlink(call *ServerCall, req *ServerRequest) error
}

type Server

type Server struct {
	Handler Handler
}

func NewServer

func NewServer() *Server

func (*Server) Serve

func (srv *Server) Serve(ln net.Listener) error

type ServerCall

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

func (*ServerCall) CloseWithReply

func (call *ServerCall) CloseWithReply(parameters interface{}) error

func (*ServerCall) Reply

func (call *ServerCall) Reply(parameters interface{}) error

type ServerError

type ServerError struct {
	Name       string
	Parameters interface{}
}

func (*ServerError) Error

func (err *ServerError) Error() string

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"`
}

Directories

Path Synopsis
cmd
Package varlinkdef implements the Varlink interface definition format.
Package varlinkdef implements the Varlink interface definition format.

Jump to

Keyboard shortcuts

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