server

package
v1.6.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_SERVER_PORT     = 8080
	DEFAULT_SERVER_PORT_SSL = 8443
)

Variables

This section is empty.

Functions

func ReadUserIP

func ReadUserIP(req *http.Request) string

Types

type ErrorIncompleteSSlConfig

type ErrorIncompleteSSlConfig struct{}

func (ErrorIncompleteSSlConfig) Error

func (e ErrorIncompleteSSlConfig) Error() string

type SSLConfig

type SSLConfig struct {
	Enabled bool   `yaml:"enabled,omitempty"`
	Cert    string `yaml:"cert,omitempty"`
	Key     string `yaml:"key,omitempty"`
}

type Server

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

func NewServer

func NewServer(cfg *ServerConfig, groups lockmanager.Groups, storageCfg lockmanager.StorageConfig, k8s *k8s.Client) (*Server, error)

Create a new Server

func (*Server) Run

func (s *Server) Run() error

Starts the server and exits with error if that fails

type ServerConfig

type ServerConfig struct {
	Listen string    `yaml:"listen"`
	SSL    SSLConfig `yaml:"ssl,omitempty"`
}

func NewDefaultServerConfig

func NewDefaultServerConfig() *ServerConfig

Create a default server config with

func (*ServerConfig) Defaults

func (cfg *ServerConfig) Defaults()

Check if there are empty values that need to be replaced by default values

func (*ServerConfig) Validate

func (cfg *ServerConfig) Validate() error

Validate Server config and set default listen addr if needed

Jump to

Keyboard shortcuts

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