juju

package module
v0.0.0-...-b8b985e Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

README

juju-coredns-plugin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Ttl         *uint32               `yaml:"ttl"`
	Controllers map[string]Controller `yaml:"controllers"`
}

func FromConfigFile

func FromConfigFile() (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type Controller

type Controller struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Address  string `yaml:"address"`
}

type Juju

type Juju struct {
	Next        plugin.Handler
	Controllers map[string]Controller
	Ttl         uint32
}

func NewJuju

func NewJuju(controllers map[string]Controller) *Juju

func (*Juju) GetAddress

func (j *Juju) GetAddress(ctx context.Context, fqdn JujuFQDN) (net.IP, error)

func (*Juju) GetConnection

func (j *Juju) GetConnection(controllerName, modelUUID string, controller Controller) (api.Connection, error)

func (*Juju) GetModelTag

func (j *Juju) GetModelTag(conn api.Connection, username string, fqdn JujuFQDN) (names.ModelTag, error)

func (*Juju) GetUnitAddress

func (j *Juju) GetUnitAddress(ctx context.Context, controller Controller, modelTag names.ModelTag, fqdn JujuFQDN) (net.IP, error)

func (*Juju) Name

func (j *Juju) Name() string

Name implements the Handler interface.

func (*Juju) ServeDNS

func (j *Juju) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

type JujuFQDN

type JujuFQDN struct {
	Controller  string
	Model       string
	Application string
	Unit        string
}

func ParseJujuFQDN

func ParseJujuFQDN(qname string) (JujuFQDN, error)

func (*JujuFQDN) IsValid

func (j *JujuFQDN) IsValid() bool

Jump to

Keyboard shortcuts

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