lazy

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BUILD_TIME = ""
	GO_VERSION = ""
	AUTHOR     = ""
)
View Source
var ConfigManager *cfgmgr.ConfigManager
View Source
var GrpcClient *rpc1.ClientManager
View Source
var GrpcServer *rpc1.Server
View Source
var ServiceDiscovery discovery.Discovery
View Source
var ServiceName string
View Source
var ServiceRegister discovery.Register

Functions

func GetAddr

func GetAddr(sv string) string

获取地址

func GetPortMust

func GetPortMust(sv string) int

func GrpcHttpHandleFunc

func GrpcHttpHandleFunc(grpcServer any) http.HandlerFunc

func HttpReturn

func HttpReturn(w http.ResponseWriter, value interface{})

func Init

func Init(serviceName string)

初始化

func MakeMsg

func MakeMsg(value any, override map[string]any) []byte

func MakeRouteMsg

func MakeRouteMsg(value any, route any) []byte

func NewGrpcClient

func NewGrpcClient[T any](name string, fn func(cc grpc.ClientConnInterface) T) (ret T)

创建并连接Grpc服务

func Serve

func Serve()

启动服务

func ServeFn

func ServeFn(fn func())

func SetClientCodec

func SetClientCodec(name string, codec grpc.DialOption)

func StartGrpcTestHttpServer

func StartGrpcTestHttpServer(addr string, grpcServer any)

func WrapMsg

func WrapMsg(value any) map[string]any

Types

type HttpContext

type HttpContext struct {
	context.Context
	Request *http.Request
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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