controlclient

package
v0.0.0-...-7fa21a5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAcquireNonce = errors.New("Could not acquire nonce")
	ErrMarshal      = errors.New("Could not marshal payload")
	ErrBadResponse  = errors.New("Invalid response from API server")
	ErrDecrypt      = errors.New("Could not decrypt response")
	ErrEncrypt      = errors.New("Could not encrypt payload")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	AuthKey *jose.JSONWebKey `json:"auth_key"`
	BaseURL string           `json:"base_url"`
}

func FromPeer

func FromPeer(peer *config.Peer) *Client

func Load

func Load(filename string) (*Client, error)

func (*Client) Exchange

func (c *Client) Exchange(msg api.Request, peer bool) (api.Message, error)

func (*Client) GetNonce

func (c *Client) GetNonce(peer bool) ([]byte, error)

func (*Client) PrepareRequest

func (c *Client) PrepareRequest(msg api.Request, peer bool) ([]byte, error)

func (*Client) SendRequest

func (c *Client) SendRequest(msg api.Request, peer bool) (*http.Response, error)

Jump to

Keyboard shortcuts

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