gin

package module
v0.0.0-...-0fe48a2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 17 Imported by: 0

README

gin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheckResp

type HealthCheckResp struct {
	Status ServingStatus `json:"status,omitempty"`
}

func (*HealthCheckResp) GetStatus

func (resp *HealthCheckResp) GetStatus() ServingStatus

type Option

type Option func(o *options)

func BaseContext

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

func ConnContext

func ConnContext(f func(ctx context.Context, c net.Conn) context.Context) Option

func ConnState

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

func ErrorLog

func ErrorLog(l *log.Logger) Option

func HealthCheck

func HealthCheck(path string, okStatus int, notOKStatus int) Option

func IdleTimeout

func IdleTimeout(timeout time.Duration) Option

func MaxHeaderBytes

func MaxHeaderBytes(size int) Option

func ReadHeaderTimeout

func ReadHeaderTimeout(timeout time.Duration) Option

func ReadTimeout

func ReadTimeout(timeout time.Duration) Option

func Registrar

func Registrar(reg registry.Registrar) Option

func TLS

func TLS(conf *tls.Config) Option

func TLSNextProto

func TLSNextProto(fs map[string]func(*http.Server, *tls.Conn, http.Handler)) Option

func WriteTimeout

func WriteTimeout(timeout time.Duration) Option

type Server

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

func NewServer

func NewServer(port int, engine *gin.Engine, opts ...Option) (*Server, error)

func (*Server) Engin

func (s *Server) Engin() *gin.Engine

func (*Server) HealthCheckPath

func (s *Server) HealthCheckPath() string

func (*Server) Host

func (s *Server) Host() string

func (*Server) Port

func (s *Server) Port() int

func (*Server) Scheme

func (s *Server) Scheme() string

func (*Server) SetServiceInfo

func (s *Server) SetServiceInfo(getter registry.ServiceInfoGetter)

func (*Server) Start

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

func (*Server) Stop

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

func (*Server) String

func (s *Server) String() string

type ServingStatus

type ServingStatus int32
const (
	UNKNOWN     ServingStatus = 0
	SERVING     ServingStatus = 1
	NOT_SERVING ServingStatus = 2
)

func (ServingStatus) String

func (ss ServingStatus) String() string

Jump to

Keyboard shortcuts

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