resolver

package
v0.27.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NNSResolver = "nns"
	DNSResolver = "dns"
)

Variables

View Source
var ErrNoResolvers = errors.New("no resolvers")

ErrNoResolvers returns when trying to resolve container without any resolver.

Functions

This section is empty.

Types

type Config

type Config struct {
	FrostFS    FrostFS
	RPCAddress string
}

type ContainerResolver

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

func NewContainerResolver

func NewContainerResolver(resolverNames []string, cfg *Config) (*ContainerResolver, error)

func (*ContainerResolver) Resolve

func (r *ContainerResolver) Resolve(ctx context.Context, cnrName string) (*cid.ID, error)

func (*ContainerResolver) UpdateResolvers

func (r *ContainerResolver) UpdateResolvers(resolverNames []string, cfg *Config) error

type FrostFS

type FrostFS interface {
	// SystemDNS reads system DNS network parameters of the FrostFS.
	//
	// Returns exactly on non-zero value. Returns any error encountered
	// which prevented the parameter to be read.
	SystemDNS(context.Context) (string, error)
}

FrostFS represents virtual connection to the FrostFS network.

type FrostFSResolver

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

FrostFSResolver represents virtual connection to the FrostFS network. It implements resolver.FrostFS.

func NewFrostFSResolver

func NewFrostFSResolver(p *pool.Pool) *FrostFSResolver

NewFrostFSResolver creates new FrostFSResolver using provided pool.Pool.

func (*FrostFSResolver) SystemDNS

func (x *FrostFSResolver) SystemDNS(ctx context.Context) (string, error)

SystemDNS implements resolver.FrostFS interface method.

type Resolver

type Resolver struct {
	Name string
	// contains filtered or unexported fields
}

func NewDNSResolver

func NewDNSResolver(frostFS FrostFS) (*Resolver, error)

func NewNNSResolver

func NewNNSResolver(rpcAddress string) (*Resolver, error)

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, name string) (*cid.ID, error)

func (*Resolver) SetResolveFunc

func (r *Resolver) SetResolveFunc(fn func(context.Context, string) (*cid.ID, error))

Jump to

Keyboard shortcuts

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