gin

package
v0.0.0-...-b4d1fbb Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPort

func CheckPort(port int) bool

CheckPort checks if a port is available for binding

func FindAvailablePort

func FindAvailablePort(startPort int) int

FindAvailablePort finds an available port starting from the given port

func FindAvailablePorts

func FindAvailablePorts(proxyPort, appPort int) (int, int)

FindAvailablePorts finds two consecutive available ports

Types

type Builder

type Builder interface {
	Build() error
	Binary() string
	Errors() string
}

func NewBuilder

func NewBuilder(dir string, bin string, useGodep bool, wd string, buildArgs []string, preBuildCmd string) Builder

NewBuilder creates a new Builder. preBuildCmd is the command to run before building (empty means skip pre-build step).

type Config

type Config struct {
	Laddr    string `json:"laddr"`
	Port     int    `json:"port"`
	ProxyTo  string `json:"proxy_to"`
	KeyFile  string `json:"key_file"`
	CertFile string `json:"cert_file"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(builder Builder, runner Runner) *Proxy

func (*Proxy) Close

func (p *Proxy) Close() error

func (*Proxy) Run

func (p *Proxy) Run(config *Config) error

type Runner

type Runner interface {
	Run() (*exec.Cmd, error)
	Info() (os.FileInfo, error)
	SetWriter(io.Writer)
	Kill() error
}

func NewRunner

func NewRunner(bin string, args ...string) Runner

Directories

Path Synopsis
test_fixtures
build_success command

Jump to

Keyboard shortcuts

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