http package - github.com/go-ashe/gkit/transport/http - Go Packages

http

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

Types

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

Server is an HTTP server wrapper.

func NewServer

func NewServer(opts ...ServerOption) *Server

NewServer creates an HTTP server by options.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start the HTTP server.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop the HTTP server.

type ServerOption

type ServerOption func(*Server)

ServerOption is HTTP server option.

func Address

func Address(address string) ServerOption

Address with server address

func Handler

func Handler(handler http.Handler) ServerOption

Handler with http handler

func Network

func Network(network string) ServerOption

Network with server network

func Timeout

func Timeout(t time.Duration) ServerOption

Timeout with server timeout

Jump to

Keyboard shortcuts

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