Documentation
¶
Overview ¶
Package ns provides functionality of FrostFS name system.
DNS type is designed to resolve FrostFS-related names using Domain Name System:
const containerName = "some-container" var dns DNS containerID, err := dns.ResolveContainerName(containerName) // ...
NNS type is designed to resolve FrostFS-related names using Neo Name Service:
var nns NNS err := nns.Dial(nnsServerAddress) // ... var containerDomain container.Domain containerDomain.SetName(containerName) containerID, err := nns.ResolveContainerDomain(containerDomain) // ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNS ¶
type DNS struct{}
DNS looks up FrostFS names using system DNS.
See also net package.
func (*DNS) ResolveContainerName ¶
ResolveContainerName looks up for DNS TXT records for the given domain name and returns the first one which represents valid container ID in a string format. Otherwise, returns an error.
See also net.LookupTXT.
type NNS ¶
type NNS struct {
// contains filtered or unexported fields
}
NNS looks up FrostFS names using Neo Name Service.
Instances are created with a variable declaration. Before work, the connection to the NNS server MUST be established using Dial method.
func (*NNS) Dial ¶
Dial connects to the address of the NNS server. If fails, the instance MUST NOT be used.
If URL address scheme is 'ws' or 'wss', then WebSocket protocol is used, otherwise HTTP.
func (*NNS) ResolveContainerDomain ¶
ResolveContainerDomain looks up for NNS TXT records for the given container domain by calling `resolve` method of NNS contract. Returns the first record which represents valid container ID in a string format. Otherwise, returns an error.
ResolveContainerDomain MUST NOT be called before successful Dial.
See also https://docs.neo.org/docs/en-us/reference/nns.html.