staticserver

package
v2.0.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort

func GetFreePort(host string) (int, error)

Types

type Manager

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

func NewManager

func NewManager(settings Settings) (*Manager, error)

func (*Manager) Bind

func (m *Manager) Bind(entry ServeEntry) error

func (*Manager) Endpoints

func (m *Manager) Endpoints() StaticEndpoints

func (*Manager) IsRunning

func (m *Manager) IsRunning() bool

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

type Node

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

func NewNode

func NewNode(settings NodeSettings) (*Node, error)

func (*Node) ID

func (n *Node) ID() int

func (*Node) IsRunning

func (n *Node) IsRunning() bool

func (*Node) Name

func (n *Node) Name() string

func (*Node) Port

func (n *Node) Port() int

func (*Node) Start

func (n *Node) Start(_ context.Context) error

func (*Node) Stop

func (n *Node) Stop(ctx context.Context) error

func (*Node) String

func (n *Node) String() string

type NodeSettings

type NodeSettings struct {
	Name          string
	Port          int
	Dir           string
	Prefix        string
	BindHost      string
	AdvertiseHost string
}

type ServeEntries

type ServeEntries []ServeEntry

func ParseServeEntries

func ParseServeEntries(bindings []string) (ServeEntries, error)

type ServeEntry

type ServeEntry struct {
	Alias string
	Path  string
	Port  int
}

func ParseServeEntry

func ParseServeEntry(binding string) (ServeEntry, error)

type Settings

type Settings struct {
	BindHost      string
	AdvertiseHost string
}

func ResolveSettings

func ResolveSettings(settings Settings) (Settings, error)

type StaticEndpoints

type StaticEndpoints map[string]string

Jump to

Keyboard shortcuts

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