http

package
v0.0.0-...-540bb61 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimpleJSONResponse

func NewSimpleJSONResponse(obj interface{}) (http.Handler, error)

NewSimpleJSONResponse returns handler which server static json on GET request

func RequestInvoke

func RequestInvoke[T interface{}](invoker RequestInvoker, request *http.Request) (*T, int, error)

Types

type PlainServer

type PlainServer interface {
	Server
	WithSSL(key, cert string) (Server, error)
	WithKeyfile(keyfile string) (Server, error)
}

func NewServer

func NewServer(server *http.Server) PlainServer

type RequestInvoker

type RequestInvoker interface {
	Do(req *http.Request) (*http.Response, error)
}

type Server

type Server interface {
	Start() (ServerRunner, error)
}

type ServerRunner

type ServerRunner interface {
	Stop()
	Wait() error
}

Jump to

Keyboard shortcuts

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