http

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client = NewClient(0)

Functions

func GRPCProxyWrapper

func GRPCProxyWrapper(h interface{}) echo.HandlerFunc

GRPCProxyWrapper from douyu.jupiter 把 go grpc 函数封装成 echo HandlerFunc

func NewClient

func NewClient(timeout time.Duration) *http.Client

接入apm的client

Types

type Config

type Config struct {
	// baseConfig ServiceName
	Name string
	Addr string `yaml:"http.address"`
	// Host Port build Addr
	Host string `yaml:"http.host"`
	Port string `yaml:"http.port"`
}

func (*Config) Address

func (c *Config) Address() string

type Server

type Server struct {
	*Config
	*echo.Echo
}

func NewServer

func NewServer(cf *Config, middlewareFunc ...echo.MiddlewareFunc) *Server

func (*Server) GracefulStop

func (s *Server) GracefulStop() error

GracefulStop 优雅退出

func (Server) Start

func (s Server) Start()

func (*Server) Stop

func (s *Server) Stop() error

Stop 直接退出

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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