server

package
v1.4.8-alpha-1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package server provides an API gateway server which handles inbound requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *Options)

func CORSConfig added in v1.3.4

func CORSConfig(c *cors.Config) Option

func EnableCORS

func EnableCORS(b bool) Option

func EnableTLS

func EnableTLS(b bool) Option

func Resolver

func Resolver(r resolver.Resolver) Option

func TLSConfig

func TLSConfig(t *tls.Config) Option

func WrapHandler

func WrapHandler(w Wrapper) Option

type Options

type Options struct {
	EnableCORS bool
	CORSConfig *cors.Config
	EnableTLS  bool
	TLSConfig  *tls.Config
	Resolver   resolver.Resolver
	Wrappers   []Wrapper
}

type Server

type Server interface {
	Address() string
	Init(opts ...Option) error
	Handle(path string, handler http.Handler)
	Start() error
	Stop() error
}

Server serves api requests

type Wrapper

type Wrapper func(handler http.Handler) http.Handler

Directories

Path Synopsis
Package http provides a http server with features; acme, cors, etc
Package http provides a http server with features; acme, cors, etc

Jump to

Keyboard shortcuts

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