server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUTH              = "auth"
	UNAUTH            = "unauth"
	DefaultNetwork    = "tcp"
	DefaultAuthPort   = 80
	DefaultUnauthPort = 8081
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HTTPRouter             *http.ServeMux
	HTTPListenPort         int
	HTTPListenAddr         string
	HTTPMiddleware         []middleware.Interface
	HTTPServerReadTimeout  time.Duration
	HTTPServerWriteTimeout time.Duration
	HTTPServerIdleTimeout  time.Duration

	UnAuthorizedHTTPRouter             *http.ServeMux
	UnAuthorizedHTTPListenAddr         string
	UnAuthorizedHTTPListenPort         int
	UnAuthorizedHTTPMiddleware         []middleware.Interface
	UnAuthorizedHTTPServerReadTimeout  time.Duration
	UnAuthorizedHTTPServerWriteTimeout time.Duration
	UnAuthorizedHTTPServerIdleTimeout  time.Duration

	ServerGracefulShutdownTimeout time.Duration
}

type Server

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

func New

func New(cfg Config) (*Server, error)

func (*Server) GetHTTPHandlers

func (s *Server) GetHTTPHandlers() (http.Handler, http.Handler)

func (*Server) RegisterTo

func (s *Server) RegisterTo(pattern string, handler http.Handler, where string)

func (*Server) Run

func (s *Server) Run() error

func (*Server) Shutdown

func (s *Server) Shutdown()

Jump to

Keyboard shortcuts

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