Documentation ¶
Index ¶
- type Client
- func (sc *Client) AddPrivateKey(ctx context.Context, key []byte) (string, error)
- func (sc *Client) AddSymmetricKey(ctx context.Context, key []byte) (string, error)
- func (sc *Client) DeleteKeyPair(ctx context.Context, id string) (string, error)
- func (ec *Client) DeleteMessageFilter(ctx context.Context, id string) error
- func (sc *Client) DeleteSymmetricKey(ctx context.Context, id string) error
- func (ec *Client) FilterMessages(ctx context.Context, id string) ([]*whisper.Message, error)
- func (sc *Client) GenerateSymmetricKeyFromPassword(ctx context.Context, passwd []byte) (string, error)
- func (sc *Client) GetSymmetricKey(ctx context.Context, id string) ([]byte, error)
- func (sc *Client) HasKeyPair(ctx context.Context, id string) (bool, error)
- func (sc *Client) HasSymmetricKey(ctx context.Context, id string) (bool, error)
- func (sc *Client) Info(ctx context.Context) (whisper.Info, error)
- func (sc *Client) MarkTrustedPeer(ctx context.Context, enode string) error
- func (sc *Client) NewKeyPair(ctx context.Context) (string, error)
- func (ec *Client) NewMessageFilter(ctx context.Context, criteria whisper.Criteria) (string, error)
- func (sc *Client) NewSymmetricKey(ctx context.Context) (string, error)
- func (sc *Client) Post(ctx context.Context, message whisper.NewMessage) error
- func (sc *Client) PrivateKey(ctx context.Context, id string) ([]byte, error)
- func (sc *Client) PublicKey(ctx context.Context, id string) ([]byte, error)
- func (sc *Client) SetMaxMessageSize(ctx context.Context, size uint32) error
- func (sc *Client) SetMinimumPoW(ctx context.Context, pow float64) error
- func (ec *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (sberex.Subscription, error)
- func (sc *Client) Version(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines typed wrappers for the Whisper v5 RPC API.
func (*Client) AddPrivateKey ¶
AddPrivateKey stored the key pair, and returns its ID.
func (*Client) AddSymmetricKey ¶
AddSymmetricKey stores the key, and returns its identifier.
func (*Client) DeleteKeyPair ¶
DeleteKeyPair delete the specifies key.
func (*Client) DeleteMessageFilter ¶
DeleteMessageFilter removes the filter associated with the given id.
func (*Client) DeleteSymmetricKey ¶
DeleteSymmetricKey deletes the symmetric key associated with the given identifier.
func (*Client) FilterMessages ¶
FilterMessages retrieves all messages that are received between the last call to this function and match the criteria that where given when the filter was created.
func (*Client) GenerateSymmetricKeyFromPassword ¶
func (sc *Client) GenerateSymmetricKeyFromPassword(ctx context.Context, passwd []byte) (string, error)
GenerateSymmetricKeyFromPassword generates the key from password, stores it, and returns its identifier.
func (*Client) GetSymmetricKey ¶
GetSymmetricKey returns the symmetric key associated with the given identifier.
func (*Client) HasKeyPair ¶
HasKeyPair returns an indication if the node has a private key or key pair matching the given ID.
func (*Client) HasSymmetricKey ¶
HasSymmetricKey returns an indication if the key associated with the given id is stored in the node.
func (*Client) MarkTrustedPeer ¶
Marks specific peer trusted, which will allow it to send historic (expired) messages. Note This function is not adding new nodes, the node needs to exists as a peer.
func (*Client) NewKeyPair ¶
NewKeyPair generates a new public and private key pair for message decryption and encryption. It returns an identifier that can be used to refer to the key.
func (*Client) NewMessageFilter ¶
NewMessageFilter creates a filter within the node. This filter can be used to poll for new messages (see FilterMessages) that satisfy the given criteria. A filter can timeout when it was polled for in whisper.filterTimeout.
func (*Client) NewSymmetricKey ¶
NewSymmetricKey generates a random symmetric key and returns its identifier. Can be used encrypting and decrypting messages where the key is known to both parties.
func (*Client) PrivateKey ¶
PrivateKey return the private key for a key ID.
func (*Client) SetMaxMessageSize ¶
SetMaxMessageSize sets the maximal message size allowed by this node. Incoming and outgoing messages with a larger size will be rejected. Whisper message size can never exceed the limit imposed by the underlying P2P protocol (10 Mb).
func (*Client) SetMinimumPoW ¶
This experimental function was introduced for the future dynamic adjustment of PoW requirement. If the node is overwhelmed with messages, it should raise the PoW requirement and notify the peers. The new value should be set relative to the old value (e.g. double). The old value could be obtained via shh_info call.
func (*Client) SubscribeMessages ¶
func (ec *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (sberex.Subscription, error)
SubscribeMessages subscribes to messages that match the given criteria. This method is only supported on bi-directional connections such as websockets and IPC. NewMessageFilter uses polling and is supported over HTTP.