devserver

package
v0.12.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGetFreePort

func MustGetFreePort() int

Types

type PortProvider

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

func NewPortProvider

func NewPortProvider() *PortProvider

func (*PortProvider) Close

func (p *PortProvider) Close() error

func (*PortProvider) GetFreePort

func (p *PortProvider) GetFreePort() (int, error)

GetFreePort asks the kernel for a free open port that is ready to use.

func (*PortProvider) MustGetFreePort

func (p *PortProvider) MustGetFreePort() int

type Server

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

func Start

func Start(options StartOptions) (*Server, error)

func (*Server) Stop

func (s *Server) Stop()

type StartOptions

type StartOptions struct {
	// Required fields
	FrontendIP             string
	FrontendPort           int
	Namespaces             []string
	ClusterID              string
	MasterClusterName      string
	CurrentClusterName     string
	InitialFailoverVersion int
	Logger                 *slog.Logger
	LogLevel               slog.Level

	// Optional fields
	UIIP                  string // Empty means no UI
	UIPort                int    // Required if UIIP is non-empty
	UIAssetPath           string
	UICodecEndpoint       string
	DatabaseFile          string
	MetricsPort           int
	PProfPort             int
	SqlitePragmas         map[string]string
	FrontendHTTPPort      int
	EnableGlobalNamespace bool
	DynamicConfigValues   map[string]any
	LogConfig             func([]byte)
	GRPCInterceptors      []grpc.UnaryServerInterceptor
}

Jump to

Keyboard shortcuts

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