gin

package
v0.0.0-...-9c44629 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VersionHandler

func VersionHandler(ctx *gin.Context)

Types

type HandlerFunc

type HandlerFunc func(ctx context.Context, mux *runtime.ServeMux, address string, opts []grpc.DialOption) (err error)

type Option

type Option func(s *Server)

func WithAddress

func WithAddress(address string) Option

func WithHandlerFunc

func WithHandlerFunc(fs ...HandlerFunc) Option

func WithHttpHandlerFunc

func WithHttpHandlerFunc(path string, fs gin.HandlerFunc) Option

type Server

type Server struct {
	Mux              *runtime.ServeMux
	GRPCAddress      string
	DialOptions      []grpc.DialOption
	Address          string
	HTTPHandlerFuncs map[string]gin.HandlerFunc
	HandlerFuncs     []HandlerFunc

	HttpServer *http.Server
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

func (*Server) Run

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

func (*Server) Start

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

func (*Server) Stop

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

Jump to

Keyboard shortcuts

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