common

package
v0.0.0-...-b988991 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsulServName          string = "SailCraft-GuideSvr"
	ConsulHealthCheckUrlFmt string = "http://%s:%d/GuideSvr/healthCheck"
)

Variables

View Source
var (
	ConsulServInstanceID string
	ConsulClient         *api.Client
)
View Source
var (
	GRedisCluster *redistool.RedisCluster = nil
)

Functions

func InitRedisCluster

func InitRedisCluster(redisSvrAddrs []string) error

func RegisterToConsul

func RegisterToConsul(listenIP string, listenPort int, consulServerIP string, healthCheckPort int) error

Types

type ConfigMgr

type ConfigMgr struct {
	// contains filtered or unexported fields
}
var (
	GConfig *ConfigMgr
)

func (*ConfigMgr) GetGMKey

func (configMgr *ConfigMgr) GetGMKey() string

func (*ConfigMgr) GetNavigationConfig

func (configMgr *ConfigMgr) GetNavigationConfig() *NavigationConfigS

func (*ConfigMgr) GetSysConfPath

func (configMgr *ConfigMgr) GetSysConfPath() string

func (*ConfigMgr) GetToken

func (configMgr *ConfigMgr) GetToken() string

func (*ConfigMgr) GetVersionInfo

func (configMgr *ConfigMgr) GetVersionInfo(channelName string) *VersionInfoS

func (*ConfigMgr) Init

func (configMgr *ConfigMgr) Init(configFile string) error

func (*ConfigMgr) ParseConfig

func (configMgr *ConfigMgr) ParseConfig() error

func (*ConfigMgr) ReloadConfig

func (configMgr *ConfigMgr) ReloadConfig() string

type ConfigS

type ConfigS struct {
	Token            string            `json:"Token"`
	VersionConfig    VersionConfigS    `json:"VersionConfig"`
	NavigationConfig NavigationConfigS `json:"NavigationConfig"`
	SysConfPath      string            `json:"SysConfPath"`
	GMKey            string            `json:"GMKey"`
}
type NavigationConfigS struct {
	ProductEnv  NavigationEnvUrlS `json:"ProductEnv"`
	AuditEnv    NavigationEnvUrlS `json:"AuditEnv"`
	StageEnv    NavigationEnvUrlS `json:"StageEnv"`
	Test8885Env NavigationEnvUrlS `json:"8885Env"`
	Test8889Env NavigationEnvUrlS `json:"8889Env"`
	DomesticEnv NavigationEnvUrlS `json:"DomesticEnv"`
}
func (nc *NavigationConfigS) CheckVersion(clientVersion string) *NavigationEnvUrlS
type NavigationEnvUrlS struct {
	URLLoginCheck string   `json:"UrlLoginCheck"`
	URLProxySvr   string   `json:"UrlProxySvr"`
	URLSdkSvr     string   `json:"UrlSdkSvr"`
	VersionList   []string `json:"VersionList"`
}

type VersionConfigS

type VersionConfigS struct {
	VersionInfo []VersionInfoS `json:"VersionInfo"`
}

type VersionInfoS

type VersionInfoS struct {
	CurrVersions []string `json:"CurrVersions"`
	Channel      string   `json:"Channel"`
	UpdateUrl    string   `json:"UpdateUrl"`
	VersionSet   *hashset.Set
}

Jump to

Keyboard shortcuts

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