Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ReloadFunc func(path, payload string) error PatchFunc func(patch map[string]any) error GetConfigFunc func() *core.Config // Version is the build version, injected via ldflags: // -ldflags "-X github.com/CoreC-Dev/CoreC/hub/route.Version=1.0.0" // Default "dev" for local/test builds. Version = "dev" )
Functions ¶
func CloseServer ¶
func CloseServer() error
func ReCreateServer ¶
func ReCreateServer(cfg *Config)
Types ¶
type Config ¶
type Config struct {
Addr string
Secret string
// TLS support (M1). When both are set, the server uses HTTPS.
TLSCert string
TLSKey string
// AllowedOrigins restricts CORS to specific origins (M3).
// Empty means permissive default (Access-Control-Allow-Origin: *).
AllowedOrigins []string
// RateLimitPerSec limits requests per second per IP (M2).
// 0 means no limit.
RateLimitPerSec int
// HTTP server timeouts. Zero values fall back to defaults.
ReadHeaderTimeout time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
}
Click to show internal directories.
Click to hide internal directories.