caddyconfig

package module
v0.0.0-...-f85d451 Latest Latest
Warning

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

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

README

caddy-config

caddy app used for configure resources

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProvisionPreApps

func ProvisionPreApps(ctx caddy.Context, curApp string, preApps []string) error

Types

type Config

type Config struct {
	// PreApps 设定前置Apps
	PreApps []string `json:"pre_apps"`

	// InitHook used to config init attrs, e.g. `app_name`
	*InitHook `json:"init_hook"`

	// Logging 定义应用依赖的三方库使用的logger资源
	Logging *logging.Logging `json:"logging,omitempty"`

	// Tracers 配置兼容opentracing的Tracers
	Tracers *trace.Tracers `json:"tracers,omitemtpy"`

	// EigenkeyRaw 特征键提取器
	EigenkeyRaw map[string]json.RawMessage `json:"eigenkey,omitempty"`

	StoreRaw map[string]json.RawMessage `json:"store,omitempty"`

	// Mock 配置mock
	Mock *mock.Mock `json:"mock,omitempty"`

	// HTTP 配置http clients和handlers
	HTTP *http.HTTP `json:"http,omitempty"`

	// Pool 通用对象池
	Pool *pool.Pool `json:"pool,omitempty"`

	ExtensionRaw map[string]json.RawMessage `json:"ext,omitempty"`
	// contains filtered or unexported fields
}

Config 配置平台

func (Config) CaddyModule

func (c Config) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (Config) ID

func (Config) ID() string

ID module id string representation

func (*Config) Provision

func (c *Config) Provision(ctx caddy.Context) error

Provision sets up the app.

func (*Config) Start

func (c *Config) Start() error

Start runs the app

func (*Config) Stop

func (c *Config) Stop() error

Stop gracefully shuts down the HTTP server.

func (*Config) Validate

func (c *Config) Validate() error

Validate ensures the app's configuration is valid.

type InitHook

type InitHook struct {
	AppName string                     `json:"app_name"`
	Version string                     `json:"version"`
	Attrs   map[string]json.RawMessage `json:"attrs,omitempty"`
}

type Ready

type Ready interface {
	Ready() error
}

Ready 用于执行就绪检查,有些tproxy插件在Provision和Validate阶段无法做引用资源有效性检查

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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