router

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Zones    []Zone
	ApplyCmd []string
	CORS     bool
	Security security.Guard
	UI       fs.FS
	APIRoot  string
}

type Handler

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

func New

func New(cfg Config) (*Handler, error)

func (*Handler) ApplyRecords

func (h *Handler) ApplyRecords(w http.ResponseWriter, r *http.Request, mod *model.Model)

ApplyRecords reads the records from the request body, reads all records from the zonefile, removes all records from the zonefile and inserts the A-records from the request body.

func (*Handler) ListRecords

func (h *Handler) ListRecords(w http.ResponseWriter, r *http.Request, mod *model.Model)

func (*Handler) ListZones added in v0.9.0

func (h *Handler) ListZones(w http.ResponseWriter, r *http.Request)

func (*Handler) MatchModel added in v0.9.0

func (h *Handler) MatchModel(mh ModelHandler) http.Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ModelHandler added in v0.9.0

type ModelHandler func(w http.ResponseWriter, r *http.Request, mod *model.Model)

type Zone added in v0.9.0

type Zone struct {
	Name   string
	Path   string
	Origin string
	TTL    int64
}

Jump to

Keyboard shortcuts

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