server

package
v0.0.1-dev Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCategory = errors.New("invalid database category")

Functions

func Environment

func Environment() option.Environment

Environment returns the current environment that the server is running for

func Name

func Name() string

Name returns the name of this server

Types

type HRPC

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

func (HRPC) Run

func (h HRPC) Run() error

func (HRPC) Serve

func (h HRPC) Serve() error

func (HRPC) Server

func (h HRPC) Server() *grpc.Server

type Server

type Server interface {
	// Server returns the gRPC server for registration at PB
	Server() *grpc.Server
	// Serve makes connections to databases and starts to listen ports to serve
	// it will block the current thread
	Serve() error
	// Run same like Serve() but it does not register to consul and starts servers to block
	// It will make connections to databases
	Run() error
}

Server the server

func NewHRPC

func NewHRPC(opt *option.Options) (Server, error)

Jump to

Keyboard shortcuts

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