provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Traefik = "traefik"
	Socat   = "socat"
	Native  = "native"
)

Variables

This section is empty.

Functions

func New

func New(name string, env Env) (any, error)

func RunServer

func RunServer(env Env) error

RunServer は純 Go の reverse proxy サーバーを起動してブロックする。 HTTP/1.1 と h2c (gRPC) の両方を受け付け、Env.GetActive() が示す バックエンドポートへ動的に転送する。

Types

type Env

type Env struct {
	BindHost         string // バインドするホスト (例: "0.0.0.0", "127.0.0.1")
	ListenPort       string
	LogFilePath      string
	PIDFilePath      string
	DynConfigPath    string
	StaticConfigPath string
	Executable       string
	GetActive        func() int
	SetActive        func(int)
	EnsureTmpDir     func() error
	PIDAlive         func(int) bool
	WarnErr          func(action string, err error)
}

Env はプロバイダーが必要とする状態・関数を保持する。

type StartOptions

type StartOptions struct {
	Daemon bool
}

type StartResult

type StartResult struct {
	PID     int
	LogPath string
}

Jump to

Keyboard shortcuts

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