baker

package module
v0.0.1-b1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAddCallback

func WithAddCallback(callback func(*Container)) func(*ActionRunner)

func WithBufferSize

func WithBufferSize(size int) serverOptFunc

func WithGetCallback

func WithGetCallback(callback func(string, string) *Container) func(*ActionRunner)

func WithPingDuration

func WithPingDuration(d time.Duration) serverOptFunc

func WithPingerCallback

func WithPingerCallback(callback func()) func(*ActionRunner)

func WithRemoveCallback

func WithRemoveCallback(callback func(*Container)) func(*ActionRunner)

func WithUpdateCallback

func WithUpdateCallback(callback func(*Container, string, string)) func(*ActionRunner)

Types

type ActionCallback

type ActionCallback func(*ActionRunner)

type ActionRunner

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

func NewActionRunner

func NewActionRunner(bufferSize int, cbs ...ActionCallback) *ActionRunner

func (*ActionRunner) Add

func (ar *ActionRunner) Add(container *Container)

func (*ActionRunner) Close

func (ar *ActionRunner) Close()

func (*ActionRunner) Get

func (ar *ActionRunner) Get(ctx context.Context, domain, path string) *Container

func (*ActionRunner) Pinger

func (ar *ActionRunner) Pinger()

func (*ActionRunner) Remove

func (ar *ActionRunner) Remove(container *Container)

func (*ActionRunner) Update

func (ar *ActionRunner) Update(container *Container, domain string, path string)

type Config

type Config struct {
	Endpoints []Endpoint `json:"endpoints"`
}

type Container

type Container struct {
	Id         string
	ConfigPath string
	Addr       netip.AddrPort
}

type Driver

type Driver interface {
	Add(*Container)
	Remove(*Container)
}

type Endpoint

type Endpoint struct {
	Domain string `json:"domain"`
	Path   string `json:"path"`
}

type Event

type Event struct {
	Type      EventType
	Container *Container
	Domain    string
	Path      string
	Result    chan *Container
}

type EventType

type EventType int

type Server

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

func NewServer

func NewServer(opts ...serverOpt) *Server

func (*Server) Close

func (s *Server) Close()

func (*Server) RegisterDriver

func (s *Server) RegisterDriver(fn func(Driver))

func (*Server) ServeHTTP

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

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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