Documentation ¶
Index ¶
- Variables
- type ADNL
- type Bucket
- type Client
- 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, id any, name []byte, index int32, value []byte, rule any, ...) (_ int, idKey []byte, err error)
- func (c *Client) StoreAddress(ctx context.Context, addresses address.List, ttl time.Duration, ...) (replicasMade int, idKey []byte, err error)
- func (c *Client) StoreOverlayNodes(ctx context.Context, overlayKey []byte, nodes *overlay.NodesList, ...) (replicasMade int, idKey []byte, err 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(gateway Gateway, cfg *liteclient.GlobalConfig) (*Client, error)
func NewClientFromConfigUrl ¶
func (*Client) FindAddresses ¶
func (*Client) FindOverlayNodes ¶ added in v1.6.0
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)
func (*Client) StoreAddress ¶
type Continuation ¶ added in v1.6.0
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 ¶ added in v1.6.0
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.