http

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is a provider set for wire

Functions

func NewRouter

func NewRouter(o *Options, logger *zap.Logger, init InitHandlers) *gin.Engine

NewRouter serve caller to create *gin.Engine

Types

type InitHandlers

type InitHandlers func(r *gin.Engine)

InitHandlers define register handler

type Options

type Options struct {
	Host string
	Port int
	Mode string
}

Options declare http's configuration

func NewOptions

func NewOptions(v *viper.Viper) (*Options, error)

NewOptions serve caller to create Options

type Server

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

Server declare http server

func New

func New(o *Options, logger *zap.Logger, router *gin.Engine) (*Server, error)

New serve caller to create Server

func (*Server) Application

func (s *Server) Application(name string)

Application serve caller set server's name

func (*Server) Start

func (s *Server) Start() error

Start serve caller to start server

func (*Server) Stop

func (s *Server) Stop() error

Stop serve caller to stop server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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