registry

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Registry Client in Go

Based on the Rust Registry Client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHashTree

func NewHashTree(tree *v1.MixedHashTree) (*hashtree.HashTree, error)

Types

type Client

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

func New

func New() (*Client, error)

func (*Client) GetLatestVersion

func (c *Client) GetLatestVersion() (uint64, error)

func (*Client) GetNNSSubnetID

func (c *Client) GetNNSSubnetID() (*principal.Principal, error)

func (*Client) GetNodeListSince

func (c *Client) GetNodeListSince(version uint64) (NodeMap, error)

func (*Client) GetSubnetDetails

func (c *Client) GetSubnetDetails(subnetID principal.Principal) (*v1.SubnetRecord, error)

func (*Client) GetSubnetIDs

func (c *Client) GetSubnetIDs() ([]principal.Principal, error)

func (*Client) GetSubnetPublicKey

func (c *Client) GetSubnetPublicKey(subnetID principal.Principal) ([]byte, error)

type DataCenterMap

type DataCenterMap map[string][]NodeDetails

type DataProvider

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

func NewDataProvider

func NewDataProvider() (*DataProvider, error)

func (DataProvider) GetCertifiedChangesSince

func (d DataProvider) GetCertifiedChangesSince(version uint64, publicKey []byte) ([]VersionedRecord, uint64, error)

func (DataProvider) GetChangesSince

func (d DataProvider) GetChangesSince(version uint64) ([]*v1.RegistryDelta, uint64, error)

GetChangesSince returns the changes since the given version.

func (DataProvider) GetLatestVersion

func (d DataProvider) GetLatestVersion() (uint64, error)

func (DataProvider) GetValue

func (d DataProvider) GetValue(key []byte, version *uint64) ([]byte, uint64, error)

GetValue returns the value of the given key and its version. If version is nil, the latest version is returned.

func (DataProvider) GetValueUpdate

func (d DataProvider) GetValueUpdate(key []byte, version *uint64) ([]byte, uint64, error)

GetValueUpdate returns the value of the given key and its version.

type IPv4Interface

type IPv4Interface struct {
	Address      string
	Gateways     []string
	PrefixLength uint32
}

type NodeDetails

type NodeDetails struct {
	IPv6            string
	IPv4            *IPv4Interface
	NodeOperatorID  principal.Principal
	NodeProviderID  principal.Principal
	DCID            string
	HostOSVersionID *string
	Domain          *string
}

type NodeMap

type NodeMap map[string]NodeDetails

func (NodeMap) ByDataCenter

func (n NodeMap) ByDataCenter() DataCenterMap

func (NodeMap) ByNodeOperator

func (n NodeMap) ByNodeOperator() NodeOperatorMap

func (NodeMap) ByNodeProvider

func (n NodeMap) ByNodeProvider() NodeProviderMap

type NodeOperatorMap

type NodeOperatorMap map[string][]NodeDetails

type NodeProviderMap

type NodeProviderMap map[string][]NodeDetails

type VersionedRecord

type VersionedRecord struct {
	Key     string
	Version uint64
	Value   []byte
}

Directories

Path Synopsis
proto
v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL