Packages
services
Relay

relay

import "command-line-arguments"

Index

func GenerateRandomIdentifier (opens in a new tab)

func GenerateRandomIdentifier() (string, error)

func RecoverIdentity (opens in a new tab)

func RecoverIdentity(signature *pb.Signature) (*pb.Identity, error)

type Client (opens in a new tab)

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

func (*Client) Connect (opens in a new tab)

func (client *Client) Connect()

func (*Client) Disconnect (opens in a new tab)

func (client *Client) Disconnect()

func (*Client) GetChannel (opens in a new tab)

func (client *Client) GetChannel() chan *pb.Message

func (*Client) GetIdentity (opens in a new tab)

func (client *Client) GetIdentity() *pb.Identity

func (*Client) GetLimiter (opens in a new tab)

func (client *Client) GetLimiter() *rate.Limiter

func (*Client) HasSufficientBalance (opens in a new tab)

func (client *Client) HasSufficientBalance() bool

func (*Client) IsConnected (opens in a new tab)

func (client *Client) IsConnected() bool

func (*Client) IsIdle (opens in a new tab)

func (client *Client) IsIdle(idleTimeoutTime int) bool

func (*Client) Ping (opens in a new tab)

func (client *Client) Ping()

func (*Client) SetHasSufficientBalance (opens in a new tab)

func (client *Client) SetHasSufficientBalance(hasSufficientBalance bool)

func (*Client) ShouldCheckBalance (opens in a new tab)

func (client *Client) ShouldCheckBalance() bool

type ClientRegistry (opens in a new tab)

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

func (*ClientRegistry) Count (opens in a new tab)

func (registry *ClientRegistry) Count() int

func (*ClientRegistry) CountConnected (opens in a new tab)

func (registry *ClientRegistry) CountConnected() int

func (*ClientRegistry) DisconnectAll (opens in a new tab)

func (registry *ClientRegistry) DisconnectAll()

func (*ClientRegistry) GetClientFromIdentity (opens in a new tab)

func (registry *ClientRegistry) GetClientFromIdentity(identity *pb.Identity) (*Client, error)

func (*ClientRegistry) GetClientFromSignature (opens in a new tab)

func (registry *ClientRegistry) GetClientFromSignature(signature *pb.Signature) (*Client, *pb.Identity, error)

func (*ClientRegistry) GetClients (opens in a new tab)

func (registry *ClientRegistry) GetClients() []*Client

func (*ClientRegistry) IsRegistered (opens in a new tab)

func (registry *ClientRegistry) IsRegistered(identity *pb.Identity) bool

func (*ClientRegistry) Register (opens in a new tab)

func (registry *ClientRegistry) Register(identity *pb.Identity, config *RelayServerConfig)

func (*ClientRegistry) Unregister (opens in a new tab)

func (registry *ClientRegistry) Unregister(identity *pb.Identity) error

type MessageLabel (opens in a new tab)

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

func (*MessageLabel) IsSubscribed (opens in a new tab)

func (label *MessageLabel) IsSubscribed(client *Client) bool

func (*MessageLabel) Propagate (opens in a new tab)

func (label *MessageLabel) Propagate(message *pb.Message, origin *pb.Identity)

func (*MessageLabel) Subscribe (opens in a new tab)

func (label *MessageLabel) Subscribe(client *Client)

func (*MessageLabel) Unsubscribe (opens in a new tab)

func (label *MessageLabel) Unsubscribe(client *Client) error

type RelayServerConfig (opens in a new tab)

type RelayServerConfig struct {
    IdleTimeoutTime        int
    IdleDisconnectInterval int
    MessageDriftTime       int
    MinAccountBalance      float64
    MaxDataSize            int
 
    VerifyMessageSignature bool
    VerifyAccountBalance   bool
    VerifyDataSize         bool
    MessageRateLimit       int
}

type SubscriptionRegistry (opens in a new tab)

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

func (*SubscriptionRegistry) GetLabel (opens in a new tab)

func (registry *SubscriptionRegistry) GetLabel(key string) *MessageLabel

func (*SubscriptionRegistry) Init (opens in a new tab)

func (registry *SubscriptionRegistry) Init()

Generated by gomarkdoc (opens in a new tab)