httpServer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRouter

func AddRouter(register Register)

Types

type Config

type Config struct {
	Name         string `yaml:"name"`
	Addr         string `yaml:"addr"`
	ReadTimeout  int    `yaml:"read_timeout"`
	WriteTimeout int    `yaml:"write_timeout"`
}

type Option

type Option func(c *Server)

func WithConfig

func WithConfig(c Config) Option

type Register

type Register func(engine *gin.Engine)

type Server

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

func NewServer

func NewServer(f func(*Server), opts ...Option) *Server

func (*Server) Shutdown

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

func (*Server) Start

func (s *Server) Start()

func (*Server) Use

func (s *Server) Use(middleware ...gin.HandlerFunc)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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