Documentation ¶
Index ¶
- Variables
- type ADNL
- type Client
- func NewClient(connectTimeout time.Duration, gateway Gateway, nodes []*Node) (*Client, error)
- func NewClientFromConfig(ctx context.Context, gateway Gateway, cfg *liteclient.GlobalConfig) (*Client, error)
- func NewClientFromConfigUrl(ctx context.Context, gateway Gateway, cfgUrl string) (*Client, error)
- func (c *Client) Close()
- func (c *Client) FindAddresses(ctx context.Context, key []byte) (*address.List, ed25519.PublicKey, error)
- func (c *Client) FindOverlayNodes(ctx context.Context, overlayKey []byte, continuation ...*Continuation) (*overlay.NodesList, *Continuation, error)
- func (c *Client) FindValue(ctx context.Context, key *Key, continuation ...*Continuation) (*Value, *Continuation, error)
- func (c *Client) Store(ctx context.Context, name []byte, index int32, value []byte, ttl time.Duration, ...) (copiesMade int, idKey []byte, err error)
- func (c *Client) StoreAddress(ctx context.Context, addresses address.List, ttl time.Duration, ...) (int, []byte, error)
- type Continuation
- type FindNode
- type FindValue
- type Gateway
- type Key
- type KeyDescription
- type Node
- type NodeInfo
- type NodesList
- type Ping
- type Pong
- type Query
- type SignedAddressListQuery
- type Store
- type Stored
- type UpdateRuleAnybody
- type UpdateRuleOverlayNodes
- type UpdateRuleSignature
- type Value
- type ValueFoundResult
- type ValueNotFoundResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDHTValueIsNotFound = errors.New("value is not found")
View Source
var Logger = func(v ...any) {}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientFromConfig ¶
func NewClientFromConfig(ctx context.Context, gateway Gateway, cfg *liteclient.GlobalConfig) (*Client, error)
func NewClientFromConfigUrl ¶
func (*Client) FindAddresses ¶
func (*Client) FindOverlayNodes ¶
func (c *Client) FindOverlayNodes(ctx context.Context, overlayKey []byte, continuation ...*Continuation) (*overlay.NodesList, *Continuation, error)
func (*Client) FindValue ¶
func (c *Client) FindValue(ctx context.Context, key *Key, continuation ...*Continuation) (*Value, *Continuation, error)
type Continuation ¶
type Continuation struct {
// contains filtered or unexported fields
}
Continuation allows to check value on the next nodes. Suitable for overlays, different DHT nodes may contain different node addresses. Can be used in case of everything is offline in single DHT node, to check another values.
type KeyDescription ¶
type Node ¶
type Node struct { ID any `tl:"struct boxed [pub.ed25519,pub.aes]"` AddrList *address.List `tl:"struct"` Version int32 `tl:"int"` Signature []byte `tl:"bytes"` }
func (*Node) CheckSignature ¶
type SignedAddressListQuery ¶
type SignedAddressListQuery struct{}
type UpdateRuleAnybody ¶
type UpdateRuleAnybody struct{}
type UpdateRuleOverlayNodes ¶
type UpdateRuleOverlayNodes struct{}
type UpdateRuleSignature ¶
type UpdateRuleSignature struct{}
type Value ¶
type Value struct { KeyDescription KeyDescription `tl:"struct"` Data []byte `tl:"bytes"` TTL int32 `tl:"int"` Signature []byte `tl:"bytes"` }
type ValueFoundResult ¶
type ValueFoundResult struct {
Value Value `tl:"struct boxed"`
}
type ValueNotFoundResult ¶
type ValueNotFoundResult struct {
Nodes NodesList `tl:"struct"`
}
Click to show internal directories.
Click to hide internal directories.