constellation

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunNode

func RunNode(cfgPath, nodeSocketPath string) error

Types

type Client

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

func NewClient

func NewClient(publicKeyPath string, nodeSocketPath string) (*Client, error)

func (*Client) ReceivePayload

func (c *Client) ReceivePayload(key []byte) ([]byte, error)

func (*Client) SendPayload

func (c *Client) SendPayload(pl []byte, b64From string, b64To []string) ([]byte, error)

type Config

type Config struct {
	Url            string   `toml:"url"`
	Port           int      `toml:"port"`
	SocketPath     string   `toml:"socketPath"`
	OtherNodeUrls  []string `toml:"otherNodeUrls"`
	PublicKeyPath  string   `toml:"publicKeyPath"`
	PrivateKeyPath string   `toml:"privateKeyPath"`
	StoragePath    string   `toml:"storagePath"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type Constellation

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

func MaybeNew

func MaybeNew(configPath string) *Constellation

func MustNew

func MustNew(configPath string) *Constellation

func New

func New(configPath string) (*Constellation, error)

func (*Constellation) Receive

func (g *Constellation) Receive(data []byte) ([]byte, error)

func (*Constellation) Send

func (g *Constellation) Send(data []byte, from string, to []string) (out []byte, err error)

type ReceiveRequest

type ReceiveRequest struct {
	Key string `json:"key"`
	To  string `json:"to"`
}

type ReceiveResponse

type ReceiveResponse struct {
	Payload string `json:"payload"`
}

type SendRequest

type SendRequest struct {
	Payload string   `json:"payload"`
	From    string   `json:"from"`
	To      []string `json:"to"`
}

type SendResponse

type SendResponse struct {
	Key string `json:"key"`
}

Jump to

Keyboard shortcuts

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