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: 12 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ConsulServInstanceID string
	ConsulClient         *api.Client
)

Functions

func GetCassandraMillionSeconds

func GetCassandraMillionSeconds() int64

func QueryGeoInfo

func QueryGeoInfo(remoteIp string) (ISOCountry, CountryName string)

func RegisterToConsul

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

Types

type CassandraConfS

type CassandraConfS struct {
	ClusterHosts             []string `json:"ClusterHosts"`
	KeySpaces                []string `json:"KeySpaces"`
	WorkerRoutingCount       int      `json:"WorkerRoutingCount"`
	DisableInitialHostLookup int      `json:"DisableInitialHostLookup"`
	Consistency              uint16   `json:"Consistency"`
}

type ConfigMgr

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

func (*ConfigMgr) Init

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

func (*ConfigMgr) ParseConfig

func (configMgr *ConfigMgr) ParseConfig() error

type ConfigS

type ConfigS struct {
	CassandraConf CassandraConfS `json:"CassandraConf"`
	GeoIpConf     string         `json:"GeoIpMmdb"`
}

Jump to

Keyboard shortcuts

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