route

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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)

func SetEngine

func SetEngine(e core.Engine)

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
}

Jump to

Keyboard shortcuts

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