api

package
v0.0.0-...-01d4b77 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(url, domain, key string) (c *Client)

func (*Client) Do

func (c *Client) Do() (err error)

type Config

type Config struct {
	TTL        time.Duration     `yaml:"ttl"` // Time to live.
	DomainKeys map[string]string `yaml:"keys"`
}

type Data

type Data struct {
	Domain string `json:"domain"`
	Key    string `json:"key"`
}

type Server

type Server struct {
	closer.Closer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cl closer.Closer, listenAddr, configPath string, d *db.DB) (s *Server, err error)

func (*Server) Run

func (s *Server) Run()

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http server handler.

Jump to

Keyboard shortcuts

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