server

package
v0.0.0-...-a2bc238 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Register(router *mux.Router)
}

Controller is an interface that register handlers with a http router

var Healthz Controller = &healthz{}

Healthz controller example

type Option

type Option func(opts *options)

Option func for server

func APIPrefix

func APIPrefix(prefix string) Option

APIPrefix will set api prefix for the api server

func ListenAddr

func ListenAddr(addr string) Option

ListenAddr will set listen addr for the server

func PProf

func PProf(d bool) Option

PProf switch on/off the http pprof api

func WithNotFoundHandler

func WithNotFoundHandler(h http.Handler) Option

WithNotFoundHandler set NotFoundHandler for router

type Server

type Server interface {
	http.Handler
	Register(ctrl Controller)
	ListenAndServe() error
}

Server is the api server interface

func New

func New(ops ...Option) Server

New func for server creating

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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