web

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCALHOST = "localhost"
	PORT8080  = 8080
)

Variables

This section is empty.

Functions

func NewGin

func NewGin(options ...LierGinOption) executor.Service

Types

type LierGin

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

func (*LierGin) SetRouters

func (l *LierGin) SetRouters(routerFunc ...Router)

func (*LierGin) SetServer

func (l *LierGin) SetServer(c *Server)

func (*LierGin) Start

func (l *LierGin) Start() error

func (*LierGin) Stop

func (l *LierGin) Stop()

Stop http server stop

type LierGinOption added in v1.1.0

type LierGinOption func(*LierGin)

func WithEngine added in v1.1.0

func WithEngine(engine *gin.Engine) LierGinOption

WithEngine set server handler

func WithGinRouters added in v1.1.0

func WithGinRouters(routerFunc ...Router) LierGinOption

func WithGinServer added in v1.1.0

func WithGinServer(c *Server) LierGinOption

func WithLogger added in v1.1.0

func WithLogger(logger alog.Logger) LierGinOption

WithLogger set logger

func WithName added in v1.1.5

func WithName(name string) LierGinOption

WithName set service name

type Router added in v1.1.0

type Router func(router *gin.Engine, logger alog.Logger)

type Server added in v1.1.0

type Server struct {
	http.Server
}

func NewServer added in v1.1.0

func NewServer(options ...ServerOption) *Server

type ServerOption added in v1.1.0

type ServerOption func(server *Server)

func BaseContext added in v1.1.0

func BaseContext(f func(net.Listener) context.Context) ServerOption

BaseContext sets the server base context.

func ConnContext added in v1.1.0

func ConnContext(f func(context.Context, net.Conn) context.Context) ServerOption

ConnContext sets the server connection context.

func ConnState added in v1.1.0

func ConnState(f func(net.Conn, http.ConnState)) ServerOption

ConnState sets the server connection state.

func ErrorLog added in v1.1.0

func ErrorLog(logger *log.Logger) ServerOption

ErrorLog sets the server error log.

func WithServerAddr added in v1.1.0

func WithServerAddr(addr string) ServerOption

WithServerAddr sets the server address.

func WithServerIdleTimeout added in v1.1.0

func WithServerIdleTimeout(timeout time.Duration) ServerOption

WithServerIdleTimeout sets the server idle timeout.

func WithServerMaxHeaderBytes added in v1.1.0

func WithServerMaxHeaderBytes(size int) ServerOption

WithServerMaxHeaderBytes sets the server max header bytes.

func WithServerReadHeaderTimeout added in v1.1.0

func WithServerReadHeaderTimeout(timeout time.Duration) ServerOption

WithServerReadHeaderTimeout sets the server read header timeout.

func WithServerReadTimeout added in v1.1.0

func WithServerReadTimeout(timeout time.Duration) ServerOption

WithServerReadTimeout sets the server read timeout.

func WithServerTLSConfig added in v1.1.0

func WithServerTLSConfig(config *tls.Config) ServerOption

WithServerTLSConfig sets the server TLS config.

func WithServerTLSNextProto added in v1.1.0

func WithServerTLSNextProto(proto map[string]func(*http.Server, *tls.Conn, http.Handler)) ServerOption

WithServerTLSNextProto sets the server TLS next proto.

func WithServerWriteTimeout added in v1.1.0

func WithServerWriteTimeout(timeout time.Duration) ServerOption

WithServerWriteTimeout sets the server write timeout.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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