inservice

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Types

type Config

type Config struct {
	Server ConfigServer `toml:"server"`

	Limit ConfigLimit `toml:"limit"`

	Zone *ConfigZone `toml:"zone,omitempty"`

	Modules []*ConfigModule `toml:"modules"`

	Domains []*inapi2.GatewayService_DomainDeploy `toml:"domains"`
	// contains filtered or unexported fields
}

func (*Config) Domain

func (it *Config) Domain(name string) *DomainEntry

func (*Config) Module

func (it *Config) Module(domain string) *ConfigModule

type ConfigLimit

type ConfigLimit struct {
	Rate           int64 `toml:"rate"`            // 每秒限制字节数 (如 102400 表示 100KB/s)
	Burst          int64 `toml:"burst"`           // 允许的突发字节数
	IpExpireAfter  int64 `toml:"ip_expire_after"` // IP 钝化过期时间 (秒)
	CleanupSeconds int64 `toml:"cleanup_seconds"` // 清理检查频率 (秒)
}

type ConfigModule

type ConfigModule struct {
	Module  string            `toml:"module"`
	Domains []string          `toml:"domains"`
	Options map[string]string `toml:"options,omitempty"`
	// contains filtered or unexported fields
}

type ConfigServer

type ConfigServer struct {
	HttpPort  int `toml:"http_port"`
	HttpsPort int `toml:"https_port"`

	ReadTimeout  int64 `toml:"read_timeout"`
	WriteTimeout int64 `toml:"write_timeout"`
	MaxBodySize  int64 `toml:"max_body_size"`

	DebugPprofEnable bool `toml:"debug_pprof_enable,omitempty"`
}

type ConfigZone

type ConfigZone struct {
	Id     string               `toml:"id"`
	Client lynkapi.ClientConfig `toml:"client"`
}

type DomainEntry

type DomainEntry struct {
	Domain *inapi2.GatewayService_DomainDeploy `json:"domain"`
	Routes []*DomainEntryRoute                 `json:"routes"`
	// contains filtered or unexported fields
}

type DomainEntryRoute

type DomainEntryRoute struct {
	Type string     `json:"type"`
	Path string     `json:"path"`
	Urls []*url.URL `json:"urls"`
	// contains filtered or unexported fields
}

type ModuleHandler

type ModuleHandler func(ctx *ServiceContext, w http.ResponseWriter, r *http.Request)

type ServiceContext

type ServiceContext struct {
	Options map[string]string
}

func (*ServiceContext) Option

func (it *ServiceContext) Option(name string) string

Jump to

Keyboard shortcuts

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