spotlib

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegId

func RegId(id *cryptutil.IDCard, sig crypto.Signer) ([]byte, error)

RegId will attempt to sign & register the given id card

Types

type Client added in v0.0.3

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

Client holds information about a client, including its connections to the spot servers

func New added in v0.0.3

func New(keys ...any) (*Client, error)

New starts a new Client and establishes connection to the Spot system. If any key is passed, the first key will be used as the main signing key.

func (*Client) ConnectionCount added in v0.0.4

func (c *Client) ConnectionCount() (uint32, uint32)

ConnectionCount returns the number of spot server connections, and the number of said connections which are online (ie. past the handshake step).

func (*Client) Query added in v0.0.3

func (c *Client) Query(target string, body []byte) ([]byte, error)

Query sends a non-encrypted request & waits for the response

func (*Client) TargetId added in v0.0.4

func (c *Client) TargetId() string

TargetId returns the local client ID that can be used to transmit messages

type InstantMessage added in v0.0.3

type InstantMessage struct {
	ID        uuid.UUID
	Flags     uint64
	Recipient string
	Sender    string
	Body      []byte
	Encrypted bool
	SignedBy  [][]byte // contains the public keys that signed the message when decoding
}

func DecodeInstantMessage added in v0.0.3

func DecodeInstantMessage(buf []byte, res *cryptutil.OpenResult, err error) (*InstantMessage, error)

DecodeInstantMessage will return a InstantMessage for a given bottle, after checking the source and various details

func (*InstantMessage) Bottle added in v0.0.3

func (im *InstantMessage) Bottle() *cryptutil.Bottle

func (*InstantMessage) Bytes added in v0.0.3

func (im *InstantMessage) Bytes() []byte

func (*InstantMessage) MarshalBinary added in v0.0.3

func (im *InstantMessage) MarshalBinary() ([]byte, error)

func (*InstantMessage) ReadFrom added in v0.0.3

func (im *InstantMessage) ReadFrom(r io.Reader) (int64, error)

func (*InstantMessage) UnmarshalBinary added in v0.0.3

func (im *InstantMessage) UnmarshalBinary(r []byte) error

Jump to

Keyboard shortcuts

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