server

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet exports for wire DI.

Functions

func NewConfig

func NewConfig(configPath string) (*viper.Viper, error)

NewConfig returns viper config.

Types

type BoreServer

type BoreServer struct {
	UI http.Handler
	// contains filtered or unexported fields
}

BoreServer defines main struct for bore server and includes HTTP and SSH server instances.

func NewBoreServer

func NewBoreServer(opts *Options, logger *zap.Logger) *BoreServer

NewBoreServer returns new instance of BoreServer.

func (*BoreServer) Run

func (s *BoreServer) Run() error

Run starts the bore server.

type HTTPServer

type HTTPServer struct {
	*http.Server
	// contains filtered or unexported fields
}

HTTPServer extends net/http Server with graceful shutdowns.

func NewHTTPServer

func NewHTTPServer(logger *zap.SugaredLogger) *HTTPServer

NewHTTPServer creates a new HTTPServer instance.

func (*HTTPServer) Close

func (h *HTTPServer) Close() error

Close closes the HTTPServer instance

func (*HTTPServer) Run

func (h *HTTPServer) Run(addr string, handler http.Handler) error

Run starts HTTPServer instance and listens on specified addr.

func (*HTTPServer) Wait

func (h *HTTPServer) Wait() error

Wait waits for server to be stopped

type Options

type Options struct {
	Domain     string
	PrivateKey string
	PublicKey  string
	SSHAddr    string
	HTTPAddr   string
	Logger     *logger.Options
}

Options are global config for bore server.

func NewOptions

func NewOptions(v *viper.Viper) (*Options, error)

NewOptions returns server config.

type SSHServer

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

SSHServer defines SSH server instance.

func NewSSHServer

func NewSSHServer(opts *Options, logger *zap.SugaredLogger) *SSHServer

NewSSHServer returns new instance of SSHServer.

func (*SSHServer) Close

func (s *SSHServer) Close() error

Close closes and stops the SSH server.

func (*SSHServer) Run

func (s *SSHServer) Run() error

Run starts the SSH server.

func (*SSHServer) Wait

func (s *SSHServer) Wait() error

Wait waits for server to be stopped

Jump to

Keyboard shortcuts

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