server

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCServer

type GRPCServer interface {
	Run(ctx context.Context) error
	Stop(ctx context.Context)
}

type GinServer

type GinServer interface {
	Run(ctx context.Context) error
	Stop(ctx context.Context)
}

type HTTPServer

type HTTPServer interface {
	Run(ctx context.Context) error
	Stop(ctx context.Context)
}

type Option

type Option func(s *Server)

func WithGRPCServer

func WithGRPCServer(srv GRPCServer) Option

func WithHTTPServer

func WithHTTPServer(srv HTTPServer) Option

type Server

type Server struct {
	GRPCServer GRPCServer `inject:"grpc"`
	HTTPServer HTTPServer `inject:"http"`
	GinServer  GinServer
}

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)

func (*Server) Stop

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

Directories

Path Synopsis
build

Jump to

Keyboard shortcuts

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