Help us shape the future of Go! Take the 2026 Go Developer Survey

caddyadminclient

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = errors.New("conflict")
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrReadOnly = errors.New("read-only")

Functions

This section is empty.

Types

type HandlerConf

type HandlerConf struct {
	Type     string   `json:"type"`
	APIs     []string `json:"apis,omitempty"`
	Upstream string   `json:"upstream,omitempty"`
	Root     string   `json:"root,omitempty"`
}

type Manager

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

func NewManager

func NewManager(adminAddr string) *Manager

func (*Manager) AddRoute

func (m *Manager) AddRoute(ctx context.Context, serverID string, req *RouteRequest) error

func (*Manager) CreateServer

func (m *Manager) CreateServer(ctx context.Context, req *ServerRequest) error

func (*Manager) DeleteRoute

func (m *Manager) DeleteRoute(ctx context.Context, serverID, routeID string) error

func (*Manager) DeleteServer

func (m *Manager) DeleteServer(ctx context.Context, id string) error

func (*Manager) GetServer

func (m *Manager) GetServer(ctx context.Context, id string) (*ServerResponse, error)

func (*Manager) ListRoutes

func (m *Manager) ListRoutes(ctx context.Context, serverID string) ([]*RouteResponse, error)

func (*Manager) ListServers

func (m *Manager) ListServers(ctx context.Context) ([]*ServerResponse, error)

func (*Manager) SetReadOnlyServerIDs

func (m *Manager) SetReadOnlyServerIDs(ids []string)

func (*Manager) UpdateRoute

func (m *Manager) UpdateRoute(ctx context.Context, serverID, routeID string, req *RouteRequest) error

func (*Manager) UpdateServer

func (m *Manager) UpdateServer(ctx context.Context, req *ServerRequest) error

type MatchConf

type MatchConf struct {
	Paths []string `json:"paths,omitempty"`
	Hosts []string `json:"hosts,omitempty"`
}

type RouteRequest

type RouteRequest struct {
	ID       string        `json:"id"`
	Order    int           `json:"order"`
	Match    MatchConf     `json:"match"`
	Handlers []HandlerConf `json:"handlers"`
}

type RouteResponse

type RouteResponse struct {
	ID       string        `json:"id"`
	Order    int           `json:"order"`
	Match    MatchConf     `json:"match"`
	Handlers []HandlerConf `json:"handlers"`
}

type ServerRequest

type ServerRequest struct {
	ID     string   `json:"id"`
	Listen []string `json:"listen"`
	TLS    *TLSConf `json:"tls,omitempty"`
}

type ServerResponse

type ServerResponse struct {
	ID        string          `json:"id"`
	Listen    []string        `json:"listen"`
	Routes    []RouteResponse `json:"routes,omitempty"`
	ReadOnly  bool            `json:"readonly,omitempty"`
	Source    string          `json:"source,omitempty"`
	PublicURL string          `json:"public_url,omitempty"`
}

type TLSConf

type TLSConf struct {
	Auto     bool   `json:"auto,omitempty"`
	CertFile string `json:"cert_file,omitempty"`
	KeyFile  string `json:"key_file,omitempty"`
}

Jump to

Keyboard shortcuts

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