dnscontext

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dnscontext provides a DNS specific tools.

Index

Constants

View Source
const (
	// SearchProperty means search list for host-name lookup
	SearchProperty = "search"
	// NameserverProperty means name server IP address
	NameserverProperty = "nameserver"
	// OptionsProperty  allows certain internal resolver variables to be modified
	OptionsProperty = "options"
	// AnyDomain means that allowed any host-name
	AnyDomain = "."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder []*networkservice.DNSConfig

Decoder allows to parse []*networkservice.DNSConfig from json string. Can be used for env configuration. See at https://github.com/kelseyhightower/envconfig#custom-decoders

func (*Decoder) Decode

func (d *Decoder) Decode(v string) error

Decode parses values from passed string.

type Manager

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

Manager can store, remove []dnscontext.Config and also present it as corefile. See what is corefile here: https://coredns.io/2017/07/23/corefile-explained/

func (*Manager) Remove

func (m *Manager) Remove(id string)

Remove removes dns config by id

func (*Manager) Store

func (m *Manager) Store(id string, configs ...*networkservice.DNSConfig)

Store stores new config with specific id

func (*Manager) String

func (m *Manager) String() string

type ResolveConfig

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

ResolveConfig provides API for editing / reading resolv.conf

func OpenResolveConfig

func OpenResolveConfig(p string) (*ResolveConfig, error)

OpenResolveConfig reads resolve config file from specific path

func (*ResolveConfig) Save

func (r *ResolveConfig) Save() error

Save saves resolve config file

func (*ResolveConfig) SetValue

func (r *ResolveConfig) SetValue(k string, values ...string)

SetValue sets value for specific property

func (*ResolveConfig) Value

func (r *ResolveConfig) Value(k string) []string

Value returns value of property

Jump to

Keyboard shortcuts

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