Documentation ¶
Index ¶
- Constants
- Variables
- func IndexSvrSync(indexSvrIPs []string, interfaceName string, req *base.ProtoRequestS)
- func LoadConfig(configFile, localAddr string) error
- func RegisterToConsul(listenIP string, listenPort int, consulServerIP string, healthCheckPort int) error
- func SendResponse(c *gin.Context, res *base.ProtoResponseS)
- func UnpackRequest(c *gin.Context) *base.ProtoRequestS
- type IndexSvrConfigS
- type RedisKeyS
Constants ¶
View Source
const ( ConsulServName string = "SailCraft-IndexSvr" ConsulHealthCheckUrlFmt string = "http://%s:%d/IndexSvr/healthCheck" )
View Source
const ( HTTP_METHOD_GET = 1 HTTP_METHOD_POST = 2 HTTP_METHOD_PUT = 4 )
View Source
const ( QUERYTYPE_LIKE = "like" QUERYTYPE_MATCH = "match" )
Variables ¶
View Source
var ( ConsulServInstanceID string ConsulClient *api.Client )
View Source
var ( GServName string GServListenIP string GServListenCtrlPort int )
Functions ¶
func IndexSvrSync ¶
func IndexSvrSync(indexSvrIPs []string, interfaceName string, req *base.ProtoRequestS)
func LoadConfig ¶
func RegisterToConsul ¶
func SendResponse ¶
func SendResponse(c *gin.Context, res *base.ProtoResponseS)
func UnpackRequest ¶
func UnpackRequest(c *gin.Context) *base.ProtoRequestS
Types ¶
type IndexSvrConfigS ¶
type IndexSvrConfigS struct { RedisAddressLst []string `json:"RedisAddressLst"` BucketCount int `json"BucketCount"` Auth string `json:"Auth"` GuildInfo RedisKeyS `json:"GuildInfo"` UserInfo RedisKeyS `json:"UserInfo"` IndexSvrCluster []string `json:"IndexSvrCluster"` DirtyWordFile string `json:"DirtyWordFile"` }
var (
GConfig *IndexSvrConfigS = nil
)
Click to show internal directories.
Click to hide internal directories.