Documentation
¶
Index ¶
- Constants
- func CyberIP() string
- func GetFileName(p string) string
- func GetProtoFromFile(p string, m proto.Message) error
- func Hash(key []byte) uint64
- func MurmurHash64A(key []byte, seed uint64) (hash uint64)
- func WorkRoot() string
- func Zero[T any]() T
- func ZeroByType(typ reflect.Type) reflect.Value
- type GlobalData
- func (d *GlobalData) Config() *pb.CyberConfig
- func (d *GlobalData) DisableSimulationMode()
- func (d *GlobalData) EnableSimulationMode()
- func (d *GlobalData) GenerateHashID(name string) uint64
- func (d *GlobalData) GetChannelByID(id uint64) string
- func (d *GlobalData) GetNodeByID(id uint64) string
- func (d *GlobalData) GetServiceByID(id uint64) string
- func (d *GlobalData) GetTaskNameByID(id uint64) string
- func (d *GlobalData) HostIP() string
- func (d *GlobalData) HostName() string
- func (d *GlobalData) IsMockTimeMode() bool
- func (d *GlobalData) IsRealityMode() bool
- func (d *GlobalData) ProcessID() int
- func (d *GlobalData) RegisterChannel(channel string) uint64
- func (d *GlobalData) RegisterNode(nodeName string) uint64
- func (d *GlobalData) RegisterService(service string) uint64
- func (d *GlobalData) RegisterTaskName(taskName string) uint64
Constants ¶
View Source
const ( SRV_CHANNEL_REQ_SUFFIX = "__SRV__REQUEST" SRV_CHANNEL_RES_SUFFIX = "__SRV__RESPONSE" )
Variables ¶
This section is empty.
Functions ¶
func GetFileName ¶
func MurmurHash64A ¶
MurmurHash64A 是从 github.com/rryqszq4/go-murmurhash 复制而来 目前测试下来与 cyber std::hash 中的结果一致 二者使用的都是 murmur2
Types ¶
type GlobalData ¶
type GlobalData struct { ProcessGroup string ComponentNums int SchedName string // contains filtered or unexported fields }
var GlobalDataInstance *GlobalData = NewGlobalData()
func NewGlobalData ¶
func NewGlobalData() *GlobalData
func NewNewGlobalDataE ¶
func NewNewGlobalDataE() (*GlobalData, error)
func (*GlobalData) Config ¶
func (d *GlobalData) Config() *pb.CyberConfig
func (*GlobalData) DisableSimulationMode ¶
func (d *GlobalData) DisableSimulationMode()
func (*GlobalData) EnableSimulationMode ¶
func (d *GlobalData) EnableSimulationMode()
func (*GlobalData) GenerateHashID ¶
func (d *GlobalData) GenerateHashID(name string) uint64
func (*GlobalData) GetChannelByID ¶
func (d *GlobalData) GetChannelByID(id uint64) string
func (*GlobalData) GetNodeByID ¶
func (d *GlobalData) GetNodeByID(id uint64) string
func (*GlobalData) GetServiceByID ¶
func (d *GlobalData) GetServiceByID(id uint64) string
func (*GlobalData) GetTaskNameByID ¶
func (d *GlobalData) GetTaskNameByID(id uint64) string
func (*GlobalData) HostIP ¶
func (d *GlobalData) HostIP() string
func (*GlobalData) HostName ¶
func (d *GlobalData) HostName() string
func (*GlobalData) IsMockTimeMode ¶
func (d *GlobalData) IsMockTimeMode() bool
func (*GlobalData) IsRealityMode ¶
func (d *GlobalData) IsRealityMode() bool
func (*GlobalData) ProcessID ¶
func (d *GlobalData) ProcessID() int
func (*GlobalData) RegisterChannel ¶
func (d *GlobalData) RegisterChannel(channel string) uint64
func (*GlobalData) RegisterNode ¶
func (d *GlobalData) RegisterNode(nodeName string) uint64
func (*GlobalData) RegisterService ¶
func (d *GlobalData) RegisterService(service string) uint64
func (*GlobalData) RegisterTaskName ¶
func (d *GlobalData) RegisterTaskName(taskName string) uint64
Click to show internal directories.
Click to hide internal directories.