somcsrv

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CRC16("github.com/privatix/dappctrl/agent/somcsrv") = 0x60E6
	ErrInternal errors.Error = 0x60E6<<8 + iota
	ErrChannelNotFound
	ErrEndpointNotFound
	ErrOfferingNotFound
)

Errors.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client can retrieve data from agents somc server.

func NewClient

func NewClient(client *http.Client, hostname string) *Client

NewClient creates a new Client.

func (*Client) Endpoint

func (c *Client) Endpoint(channelKey data.Base64String) (data.Base64String, error)

Endpoint gets endpoint message through tor net.

func (*Client) Offering

func (c *Client) Offering(hash data.HexString) (data.Base64String, error)

Offering gets offering message through tor net.

func (*Client) Ping

func (c *Client) Ping() error

Ping returns an error if remote enpoint cannot be reached.

type Handler

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

Handler is agents RPC handler.

func NewHandler

func NewHandler(db *reform.DB, logger log.Logger) *Handler

NewHandler creates a new RPC handler.

func (*Handler) Endpoint

func (h *Handler) Endpoint(key data.Base64String) (*data.Base64String, error)

Endpoint returns endpoint msg for a channel with given key.

func (*Handler) Offering

func (h *Handler) Offering(hash data.HexString) (*data.Base64String, error)

Offering returns offerings raw msg with given hash.

Jump to

Keyboard shortcuts

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