server

package
v0.0.0-...-61578eb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GRPC ServerListen `yaml:"grpc" mapstructure:"grpc"`
	HTTP ServerListen `yaml:"http" mapstructure:"http"`
}

Config hold http/grpc server config

func DefaultConfig

func DefaultConfig() Config

DefaultConfig return a default server config

func NewConfig

func NewConfig(grpcPort, httpPort int) Config

NewConfig return a optional config with grpc port and http port.

type Server

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

Server is server struct which contains both grpc and http server.

func NewServer

func NewServer(cfg Config, isRunningDevelopment bool, opt ...grpc.ServerOption) *Server

func (*Server) Register

func (s *Server) Register(grpcServer ...interface{}) error

func (*Server) Serve

func (s *Server) Serve() error

Serve server listen for HTTP and GRPC

type ServerListen

type ServerListen struct {
	Host string `yaml:"host" mapstructure:"host"`
	Port int    `yaml:"port" mapstructure:"port"`
}

ServerListen config for host/port socket listener nolint:revive

func (ServerListen) String

func (l ServerListen) String() string

String return socket listen DSN

Jump to

Keyboard shortcuts

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