message

package
v0.0.0-...-5ffbee6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Messages is the list of possible message types.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	Account string
	Balance *rpc.RawAmount
}

Balance encodes the wallet balance.

type BuyRequest

type BuyRequest struct {
	Payment    *PaymentRecord
	PaymentURL string
}

BuyRequest encodes a buy request.

type Client

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

Client is a websocket client.

func NewClient

func NewClient(conn wsConn, messages []reflect.Type) (c *Client)

NewClient creates a Client.

func (*Client) Read

func (c *Client) Read() (v interface{}, err error)

func (*Client) Write

func (c *Client) Write(v interface{}) (err error)

type ClientGroup

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

ClientGroup is a group of Clients.

func (*ClientGroup) Add

func (g *ClientGroup) Add(c *Client) (key int)

Add adds a client to the group.

func (*ClientGroup) Broadcast

func (g *ClientGroup) Broadcast(v interface{})

Broadcast sends a message to every Client.

func (*ClientGroup) Remove

func (g *ClientGroup) Remove(key int)

Remove removes a client from the group.

type GorillaAdapter

type GorillaAdapter struct{ Conn *gorilla.Conn }

GorillaAdapter is an adapter for gorilla websockets.

func (GorillaAdapter) Reader

func (a GorillaAdapter) Reader() (r io.Reader, err error)

Reader returns a reader.

func (GorillaAdapter) Writer

func (a GorillaAdapter) Writer() (w io.WriteCloser, err error)

Writer returns a writer.

type NhooyrAdapter

type NhooyrAdapter struct{ Conn *nhooyr.Conn }

NhooyrAdapter is an adapter for nhooyr websockets.

func (NhooyrAdapter) Reader

func (a NhooyrAdapter) Reader() (r io.Reader, err error)

Reader returns a reader.

func (NhooyrAdapter) Writer

func (a NhooyrAdapter) Writer() (w io.WriteCloser, err error)

Writer returns a writer.

type PaymentRecord

type PaymentRecord struct {
	PaymentID string
	ItemName  string
	Amount    *rpc.RawAmount
	Hash      rpc.BlockHash
}

PaymentRecord encodes a payment record.

func (*PaymentRecord) Scan

func (r *PaymentRecord) Scan(row interface{ Scan(...interface{}) error }) (err error)

Scan populates a payment record from the DB.

type PurchaseHistory

type PurchaseHistory []*PaymentRecord

PurchaseHistory encodes the purchase history.

Jump to

Keyboard shortcuts

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