starter

package
v15.11.13 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TCP is the prefix for tcp
	TCP string = "tcp"
	// TLS is the prefix for tls
	TLS string = "tls"
	// Unix is the prefix for unix
	Unix string = "unix"
)

Variables

View Source
var (
	// ErrEmptySchema signals that the address has no schema in it.
	ErrEmptySchema = errors.New("empty schema can't be used")
)

Functions

func ComposeEndpoint

func ComposeEndpoint(schema, address string) (string, error)

ComposeEndpoint returns address string composed from provided schema and schema-less address.

func New

func New(cfg Config, server Server) bootstrap.Starter

New creates a new bootstrap.Starter from a config and a GracefulStoppableServer

Types

type Config

type Config struct {
	Name, Addr string
	// HandoverOnUpgrade indicates whether the socket should be handed over to the new
	// process during an upgrade. If the socket is not handed over, it should be be unique
	// to avoid colliding with the old process' socket. If the socket is a Unix socket, a
	// possible existing file at the path is removed.
	HandoverOnUpgrade bool
}

Config represents a network type, and address

func ParseEndpoint

func ParseEndpoint(endpoint string) (Config, error)

ParseEndpoint returns Config based on the passed in address string. Returns error only if provided endpoint has no schema or address defined.

func (*Config) Endpoint

func (c *Config) Endpoint() (string, error)

Endpoint returns fully qualified address.

func (*Config) IsSecure

func (c *Config) IsSecure() bool

IsSecure returns true if network is secured.

type Server

type Server interface {
	// Serve accepts requests from the listener and handles them properly.
	Serve(lis net.Listener) error
}

Server able to serve requests.

Jump to

Keyboard shortcuts

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