hesiod

package module
v0.0.0-...-8af8fe5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package hesiod provides a Go hesiod protocol implementation.

Hesiod is a DNS-based directory service developed at MIT for Project Athena. The Go implementation provides a significantly simplified API than the C library.

More information about Hesiod is available from the USENIX paper available from

ftp://athena-dist.mit.edu/pub/ATHENA/usenix/hesiod.PS

Index

Constants

View Source
const DefaultHesiodConfigFile = "/etc/hesiod.conf"

DefaultHesiodConfigFile is a path to the systemd-wide hesiod.conf file. On UNIX-like systems, this should be /etc/hesiod.conf.

Variables

View Source
var AthenaConfig = &Config{
	Nameserver: ".ns",
	Realm:      ".athena.mit.edu",
}

AthenaConfig is the default configuration for Hesiod, for use at MIT.

Functions

This section is empty.

Types

type Config

type Config struct {
	Nameserver string
	Realm      string
}

A Config contains the Hesiod name server prefix as well as the realm suffix. See AthenaConfig for an example of a typical configuration.

type Hesiod

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

The Hesiod service itself.

func NewHesiod

func NewHesiod() *Hesiod

NewHesiod initializes a Hesiod resolver with the machine's local Hesiod configuration.

func NewHesiodWithConfig

func NewHesiodWithConfig(config *Config) *Hesiod

NewHesiodWithConfig allows the application to override the machine's local Hesiod configuration with the specified configuration. In the C Hesiod library, this was controlled through the HESIOD_CONFIG environment variable, which is intentionally unsupported in hesiod-go.

func (*Hesiod) GetServiceByName

func (hesiod *Hesiod) GetServiceByName(service string, proto string) (result ServiceEntry, err error)

GetServiceByName queries Hesiod for the service information (protocol, port).

func (*Hesiod) Resolve

func (hesiod *Hesiod) Resolve(question string, queryType string) (txt []string, err error)

Resolve performs the Hesiod resolution of the given query and its type. For example, try Resolve("hesiod", "sloc") or Resolve("achernya", "passwd") with the Athena configuration.

type ServiceEntry

type ServiceEntry struct {
	ServiceName string
	Port        int
	Protocol    string
}

ServiceEntry contains the information similar to getservbyname(3) method, and is used by GetServiceByName().

Jump to

Keyboard shortcuts

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