httpserv

package
v0.11.9 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorJson

func NewErrorJson(errcode int, msg string) *jsonResult

func NewJson

func NewJson(data interface{}, errcode int, msg string) *jsonResult

Types

type HTTPServ

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

HTTPServ Http server

func NewHTTPServ

func NewHTTPServ() *HTTPServ

func (*HTTPServ) Route

func (hs *HTTPServ) Route(url string, h funcHandler)

func (*HTTPServ) SetHeaders

func (hs *HTTPServ) SetHeaders(h map[string]string)

func (*HTTPServ) SetPort

func (hs *HTTPServ) SetPort(p int)

func (*HTTPServ) SetTimeout

func (hs *HTTPServ) SetTimeout(t time.Duration)

func (*HTTPServ) Start

func (hs *HTTPServ) Start()

type MyHTTPServ

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

func MyNewHTTPServ

func MyNewHTTPServ(port string) *MyHTTPServ

func (*MyHTTPServ) MyRoute

func (hs *MyHTTPServ) MyRoute(url string, h funcMyHandler)

func (*MyHTTPServ) MyStart

func (hs *MyHTTPServ) MyStart(ctx context.Context)

Jump to

Keyboard shortcuts

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