Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Messages = []reflect.Type{ reflect.TypeOf(Balance{}), reflect.TypeOf(BuyRequest{}), reflect.TypeOf(PaymentRecord{}), reflect.TypeOf(PurchaseHistory{}), }
Messages is the list of possible message types.
Functions ¶
This section is empty.
Types ¶
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.
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 ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.