servers

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSServer

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

DNSServer represents a DNS server

func NewDNSServer

func NewDNSServer(c *utils.Config) *DNSServer

NewDNSServer create a new DNSServer

func (*DNSServer) AddService

func (s *DNSServer) AddService(id string, service Service) (err error)

AddService adds a new container and thus new DNS records

func (*DNSServer) GetAllServices

func (s *DNSServer) GetAllServices() map[string]Service

GetAllServices reads all services from the repository

func (*DNSServer) GetService

func (s *DNSServer) GetService(id string) (Service, error)

GetService reads a service from the repository

func (*DNSServer) RemoveService

func (s *DNSServer) RemoveService(id string) (err error)

RemoveService removes a new container and thus DNS records

func (*DNSServer) Start

func (s *DNSServer) Start() error

Start starts the DNSServer

func (*DNSServer) Stop

func (s *DNSServer) Stop() error

Stop stops the DNSServer

type HTTPServer

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

HTTPServer represents the http endpoint

func NewHTTPServer

func NewHTTPServer(c *utils.Config, list ServiceListProvider) *HTTPServer

NewHTTPServer create a new http endpoint

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts the http endpoint

type Service

type Service struct {
	Name    string
	Image   string
	IPs     []net.IP
	TTL     int
	Aliases []string
}

Service represents a container and an attached DNS record

func NewService

func NewService() (s *Service)

NewService creates a new service

func (Service) String

func (s Service) String() string

type ServiceListProvider

type ServiceListProvider interface {
	AddService(string, Service) error
	RemoveService(string) error
	GetService(string) (Service, error)
	GetAllServices() map[string]Service
}

ServiceListProvider represents the entrypoint to get containers

Jump to

Keyboard shortcuts

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