GorraAPI

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSrvConnection

func GetSrvConnection(wait uint, config BaseConfig, srvName string) (*grpc.ClientConn, error)

func InitRedis added in v1.0.3

func InitRedis(host string, port int, db int, password string) *redis.Client

func InitTracer added in v1.0.3

func InitTracer(name string, host string, port int) (opentracing.Tracer, io.Closer)

func KeepAliveRouters

func KeepAliveRouters(version string, groups ...RouterGroup) *gin.Engine

func RawContextWithSpan added in v1.0.3

func RawContextWithSpan(c *gin.Context) context.Context

func RunRouter

func RunRouter(router *gin.Engine, config BaseConfig) error

Types

type BaseConfig

type BaseConfig interface {
	GetRegistryInfo() RegistryInfo
}

func InitConfig

func InitConfig(YamlPath string, configStruct BaseConfig) (BaseConfig, error)

type ConsulConfig

type ConsulConfig struct {
	Host string `mapstructure:"host" json:"host"`
	Port int    `mapstructure:"port" json:"port"`
}

type NacosConfig

type NacosConfig struct {
	Host      string `mapstruct:"host"`
	Port      uint64 `mapstruct:"port"`
	Namespace string `mapstruct:"namespace"`
	DataId    string `mapstruct:"dataId"`
	Group     string `mapstruct:"group"`
}

type RegistryInfo

type RegistryInfo struct {
	Name    string       `mapstructure:"name" json:"name"`
	Address string       `mapstructure:"address" json:"address"`
	Port    int          `mapstructure:"port" json:"port"`
	Tags    []string     `mapstructure:"tags" json:"tags"`
	Consul  ConsulConfig `mapstructure:"consul" json:"consul"`
}

type RouterGroup

type RouterGroup func(*gin.RouterGroup)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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