caddy

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout time.Duration = 10 * time.Second

Functions

func JSONType added in v0.0.59

func JSONType(data json.RawMessage) (result struct {
	Scalar  bool
	True    bool
	False   bool
	Boolean bool
	Null    bool
	String  bool
	Number  bool
	Array   bool
	Object  bool
})

Types

type CaddyClient

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

func NewClient

func NewClient(endpoint string, timeout time.Duration) (*CaddyClient, error)

func (*CaddyClient) GetConfig added in v0.0.45

func (client *CaddyClient) GetConfig(ctx context.Context, config *ConfigItem) (*ConfigStatus, error)

func (*CaddyClient) Register

func (client *CaddyClient) Register(ctx context.Context, register bool, configs ConfigItems) error

type CaddyHandle added in v0.0.45

type CaddyHandle struct {
	Handler   string            `json:"handler"`
	Upstreams []json.RawMessage `json:"upstreams"`
}

type CaddyRoute added in v0.0.45

type CaddyRoute struct {
	Match  []json.RawMessage `json:"match"`
	Handle []CaddyHandle     `json:"handle"`
}

type ConfigItem

type ConfigItem struct {
	DeprecatedId string          `json:"id"`
	MountPoint   string          `json:"mount_point"`
	Config       json.RawMessage `json:"config"`
	RegisterOnly bool            `json:"register_only"`
	Id           string          `json:"-"`
}

func (*ConfigItem) GetId added in v0.0.45

func (config *ConfigItem) GetId() (string, error)

func (*ConfigItem) IsScalar added in v0.0.59

func (cfg *ConfigItem) IsScalar() bool

type ConfigItems added in v0.0.45

type ConfigItems []*ConfigItem

func (ConfigItems) SetDefaults added in v0.0.45

func (configs ConfigItems) SetDefaults() error

type ConfigSnip

type ConfigSnip struct {
	Id string `json:"@id"`
}

type ConfigStatus added in v0.0.45

type ConfigStatus struct {
	MountPoint string          `json:"parent_id"`
	Id         string          `json:"id"`
	Present    bool            `json:"present"`
	Config     json.RawMessage `json:"config"`
	Item       *ConfigItem     `json:"-"`
}

func (*ConfigStatus) Dial added in v0.0.45

func (cfg *ConfigStatus) Dial() (string, error)

func (*ConfigStatus) MatchConfig added in v0.0.45

func (cfg *ConfigStatus) MatchConfig() ([]json.RawMessage, error)

func (*ConfigStatus) UpstreamDials added in v0.0.45

func (cfg *ConfigStatus) UpstreamDials() ([]string, error)

func (*ConfigStatus) Upstreams added in v0.0.45

func (cfg *ConfigStatus) Upstreams() ([]json.RawMessage, error)

Jump to

Keyboard shortcuts

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