server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Overview

Package server provides tools to create http servers and handlers wrapping the turbo router

Index

Constants

View Source
const (
	HeaderCompleteResponseValue   = "true"
	HeaderIncompleteResponseValue = "false"
)

Variables

View Source
var (
	CompleteResponseHeaderName = "X-Sonic-Completed"
	HeadersToSend              = []string{"Content-Type"}
	UserAgentHeaderValue       = []string{core.SonicUserAgent}
	ErrInternalError           = errors.New("internal server error")
	ErrPrivateKey              = errors.New("private key not defined")
	ErrPublicKey               = errors.New("public key not defined")
)

Functions

func DefaultToHTTPError

func DefaultToHTTPError(_ error) int

func InitHTTPDefaultTransport

func InitHTTPDefaultTransport(cfg config.ServiceConfig)

func NewServer

func NewServer(cfg config.ServiceConfig, handler http.Handler) *http.Server

func ParseTLSConfig

func ParseTLSConfig(cfg *config.TLS) *tls.Config

func RunServer

func RunServer(ctx context.Context, cfg config.ServiceConfig, handler http.Handler) error

Types

type ToHTTPError

type ToHTTPError func(error) int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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