common

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBERROR

func DBERROR(msg string, err error)

func Init

func Init()

func ParseConsole

func ParseConsole(cmd actor.IActor, command string)

func StartConsole

func StartConsole(cmd actor.IActor)

Types

type BaseDataRes

type BaseDataRes struct {
	DataMap map[interface{}]interface{}
}

func (*BaseDataRes) AddData

func (b *BaseDataRes) AddData(id int, pData interface{})

func (*BaseDataRes) Clear

func (b *BaseDataRes) Clear()

func (*BaseDataRes) Close

func (b *BaseDataRes) Close()

func (*BaseDataRes) GetBaseData

func (b *BaseDataRes) GetBaseData(id int) interface{}

func (*BaseDataRes) Init

func (b *BaseDataRes) Init()

func (*BaseDataRes) Read

func (b *BaseDataRes) Read() bool

type ClusterInfo

type ClusterInfo rpc.ClusterInfo

集群信息

func (*ClusterInfo) Id

func (c *ClusterInfo) Id() uint32

func (*ClusterInfo) IpString

func (c *ClusterInfo) IpString() string

func (*ClusterInfo) ServiceType

func (c *ClusterInfo) ServiceType() rpc.SERVICE

func (*ClusterInfo) String

func (c *ClusterInfo) String() string

type Db

type Db struct {
	Ip           string `yaml:"ip"`
	Name         string `yaml:"name"`
	User         string `yaml:"user"`
	Password     string `yaml:"password"`
	MaxIdleConns int    `yaml:"maxIdleConns"`
	MaxOpenConns int    `yaml:"maxOpenConns"`
}

type Etcd

type Etcd struct {
	Endpoints []string `yaml:"endpoints"`
}

type FileInfo

type FileInfo struct {
	Info os.FileInfo
	Call FileRead //call reload
}

type FileMonitor

type FileMonitor struct {
	actor.Actor
	// contains filtered or unexported fields
}

func (*FileMonitor) AddFile

func (f *FileMonitor) AddFile(fileName string, pFunc FileRead)

func (*FileMonitor) Addfile

func (f *FileMonitor) Addfile(ctx context.Context, fileName string, p *int64)

func (*FileMonitor) Delfile

func (f *FileMonitor) Delfile(ctx context.Context, fileName string)

func (*FileMonitor) Init

func (f *FileMonitor) Init()

type FileRead

type FileRead func() //reload

type Http

type Http struct {
	Listen string `yaml:"listen"`
}

type IBaseDataRes

type IBaseDataRes interface {
	Close()
	Clear()
	Init()
	AddData(int, interface{})
	GetBaseData(int) interface{}
	Read() bool
}

type IClusterInfo

type IClusterInfo interface {
	Id() uint32
	String() string
	ServiceType() rpc.SERVICE
	IpString() string
}

type IFileMonitor

type IFileMonitor interface {
	actor.IActor

	AddFile(string, FileRead)
	// contains filtered or unexported methods
}

type ISimpleTimer

type ISimpleTimer interface {
	SetInterval(int)
	CheckTimer() bool
	Start()
	Stop()
	GetTimerCount() int
	IsActived() bool
}

type IStateMachine

type IStateMachine interface {
	Init(int)
	SetStateHandle(state int, pState *State)
	SetState(int)
	GetState() int
	GetPreState() int
	Update()
}

状态机

type Nats

type Nats struct {
	Endpoints string `yaml:"endpoints"`
}

type Raft

type Raft struct {
	Endpoints []string `yaml:"endpoints"`
}

type Redis

type Redis struct {
	OpenFlag bool   `yaml:"open"`
	Ip       string `yaml:"ip"`
	Password string `yaml:"password"`
}

type Server

type Server struct {
	Ip   string `yaml:"ip"`
	Port int    `yaml:"port"`
}

type SimpleTimer

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

func NewSimpleTimer

func NewSimpleTimer(interval int) *SimpleTimer

func (*SimpleTimer) CheckTimer

func (s *SimpleTimer) CheckTimer() bool

func (*SimpleTimer) GetTimerCount

func (s *SimpleTimer) GetTimerCount() int

func (*SimpleTimer) IsActived

func (s *SimpleTimer) IsActived() bool

func (*SimpleTimer) SetInterval

func (s *SimpleTimer) SetInterval(interval int)

func (*SimpleTimer) Start

func (s *SimpleTimer) Start()

func (*SimpleTimer) Stop

func (s *SimpleTimer) Stop()

type SnowFlake

type SnowFlake struct {
	Endpoints []string `yaml:"endpoints"`
}

type State

type State struct {
	OnEnter TimerHandle
	OnExit  TimerHandle
	OnExec  TimerHandle
}

状态机

type StateMachine

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

状态机

func (*StateMachine) GetPreState

func (this *StateMachine) GetPreState() int

获取前面的一个状态

func (*StateMachine) GetState

func (this *StateMachine) GetState() int

func (*StateMachine) Init

func (this *StateMachine) Init(_maxState int)

func (*StateMachine) SetState

func (this *StateMachine) SetState(state int)

func (*StateMachine) SetStateHandle

func (this *StateMachine) SetStateHandle(state int, st *State)

func (*StateMachine) Update

func (this *StateMachine) Update()

type Stub

type Stub struct {
	StubCount map[string]int64 `yaml:"stub_count"`
	GmCount   int              `yaml:"gm_count"`
}

type StubMailBox

type StubMailBox struct {
	rpc.StubMailBox
}

func (*StubMailBox) Key

func (s *StubMailBox) Key() string

func (*StubMailBox) StubName

func (s *StubMailBox) StubName() string

type StubRoute

type StubRoute struct {
	STUB rpc.STUB `yaml:"stub"`
}

type TimerHandle

type TimerHandle func()

状态机

Directories

Path Synopsis
rpc

Jump to

Keyboard shortcuts

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