base

package
v0.0.0-...-3d3caa2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONFIG_FILE_NAME = "config.myl"
View Source
const Default_Config_Name = "config.yml"

Variables

This section is empty.

Functions

func RegisterToConsul

func RegisterToConsul()

func RegisterToConsul2

func RegisterToConsul2()

Types

type BaseConfig

type BaseConfig struct {
	Name       string `yaml:"name"`
	Ip         string `yaml:"ip"`
	Port       uint16 `yaml:"port"`
	InstanceId uint32 `yaml:"instance_id"`
	ServerId   uint32 `yaml:"server_id"`
}

type BaseService

type BaseService struct {
	// contains filtered or unexported fields
}

func (*BaseService) DeregisterService

func (b *BaseService) DeregisterService()

func (*BaseService) IP

func (b *BaseService) IP() string

func (*BaseService) Init

func (b *BaseService) Init() error

func (*BaseService) IsSecure

func (b *BaseService) IsSecure() bool

func (*BaseService) Name

func (b *BaseService) Name() string

func (*BaseService) Ping

func (b *BaseService) Ping() uint8

func (*BaseService) Port

func (b *BaseService) Port() uint16

func (*BaseService) ProcessRPCRequest

func (b *BaseService) ProcessRPCRequest(msg *message.ReqMsg) []byte

func (*BaseService) RegisterService

func (b *BaseService) RegisterService() error

func (*BaseService) RequestService

func (b *BaseService) RequestService(ctx context.Context, in *message.GatewayMsg) (*message.ResMsg, error)

func (*BaseService) SID

func (b *BaseService) SID() uint32

func (*BaseService) ServeCallback

func (b *BaseService) ServeCallback() error

func (*BaseService) Shutdown

func (b *BaseService) Shutdown() error

func (*BaseService) Start

func (b *BaseService) Start() error

func (*BaseService) StartRPCServer

func (b *BaseService) StartRPCServer() error

func (*BaseService) Version

func (b *BaseService) Version() string

type Config

type Config struct {
	BaseConfig   BaseConfig         `yaml:"base_config"`
	MysqlConfig  model.MysqlConfig  `yaml:"mysql_config"`
	RedisConfig  model.RedisConfig  `yaml:"redis_config"`
	MongoConfig  model.MongoConfig  `yaml:"mongo_config"`
	ConsulConfig model.ConsulConfig `yaml:"consul_config"`
}

type MService

type MService interface {
	Name() string
	SID() uint32
	IP() string
	Port() uint16
	Init() error
	RegisterService() error
	DeregisterService()
	ServeCallback() error
	Start() error
	Shutdown() error
	Ping() uint8
	IsSecure() bool
	Version() string
	StartRPCServer() error
	ProcessRPCRequest(msg *message.ReqMsg) []byte
}

Jump to

Keyboard shortcuts

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