Documentation ¶
Index ¶
- Constants
- Variables
- type ContextIndex
- type Dms
- type Entity
- type EntityKey
- func (e *EntityKey) AtoI(s string) *EntityKey
- func (e EntityKey) ContextIndex() ContextIndex
- func (e EntityKey) IsPublicEntityKey() bool
- func (e *EntityKey) ItoA() string
- func (e EntityKey) MapToTopic() string
- func (e *EntityKey) SetContextIndex(ctxIndex ContextIndex) *EntityKey
- func (e *EntityKey) SetToken(token Token) *EntityKey
- func (e *EntityKey) SetTokenIndex(tokenIndex TokenIndex) *EntityKey
- func (e *EntityKey) SetTokenType(tokenType TokenType) *EntityKey
- func (e EntityKey) Token() Token
- func (e EntityKey) TokenIndex() TokenIndex
- func (e EntityKey) TokenType() TokenType
- type ReceiveHandler
- type Token
- type TokenIndex
- type TokenType
Constants ¶
View Source
const ( TokenTypeSmf TokenType = 0x5000 TokenTypeSbim TokenType = 0x6000 TokenTypeUdm TokenType = 0x7000 TokenTypeChf TokenType = 0x8000 MinStartToken = 1 MaxEndToken = 100 DefaultStartToken = 1 DefaultEndToken = 10 )
View Source
const NullEntityKey = uint64(0)
Variables ¶
View Source
var ( DefaultSrcSmfEntity = NewEntity("smf", "smf1", TokenTypeSmf, DefaultStartToken, DefaultEndToken) DefaultSrcSbimEntity = NewEntity("sbim", "sbim1", TokenTypeSbim, DefaultStartToken, DefaultEndToken) DefaultSrcUdmEntity = NewEntity("udm", "udm1", TokenTypeUdm, DefaultStartToken, DefaultEndToken) DefaultSrcChfEntity = NewEntity("chf", "chf1", TokenTypeChf, DefaultStartToken, DefaultEndToken) DefaultDstSmfEntity = NewEntity("smf", "smf1", TokenTypeSmf, MinStartToken, MaxEndToken) DefaultDstSbimEntity = NewEntity("sbim", "sbim1", TokenTypeSbim, MinStartToken, MaxEndToken) DefaultDstUdmEntity = NewEntity("udm", "udm1", TokenTypeUdm, MinStartToken, MaxEndToken) DefaultDstChfEntity = NewEntity("chf", "chf1", TokenTypeChf, MinStartToken, MaxEndToken) )
Functions ¶
This section is empty.
Types ¶
type ContextIndex ¶
type ContextIndex uint64
type Dms ¶
type Dms struct {
// contains filtered or unexported fields
}
func NewKafkaDms ¶
func NewKafkaDms(brokers []string, handler ReceiveHandler, servedEntity *Entity) (*Dms, error)
func NewNatsDms ¶
func NewNatsDms(natsUrl, clusterId, clientId string, handler ReceiveHandler, servedEntity *Entity) (*Dms, error)
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func NewEntity ¶
func NewEntity(className string, objectName string, tokenType TokenType, startToken, endToken uint64) *Entity
NewEntity if the Entity is source of Dms, startToken and endToken is the instance where the entity is located, if the Entity is destination of Dms, startToken is min, endToken is max
func (Entity) NewEntityKey ¶
func (Entity) NewPublicEntityKey ¶
func (Entity) NewRandomEntityKey ¶
type EntityKey ¶
type EntityKey uint64
func NewEntityKey ¶
NewEntityKey tokenIndex can not be zero, otherwise it will bo assigned to zero
func NewPublicEntityKey ¶
NewPublicEntityKey so called publicEntityKey means tokenIndex and ContextIndex is zero PublicEntityKey means app isn't assigned a key, and the key will be randomly sent to an instance for processing
func (EntityKey) ContextIndex ¶
func (e EntityKey) ContextIndex() ContextIndex
func (EntityKey) IsPublicEntityKey ¶
func (EntityKey) MapToTopic ¶
func (*EntityKey) SetContextIndex ¶
func (e *EntityKey) SetContextIndex(ctxIndex ContextIndex) *EntityKey
func (*EntityKey) SetTokenIndex ¶
func (e *EntityKey) SetTokenIndex(tokenIndex TokenIndex) *EntityKey
func (*EntityKey) SetTokenType ¶
func (EntityKey) TokenIndex ¶
func (e EntityKey) TokenIndex() TokenIndex
type ReceiveHandler ¶
type TokenIndex ¶
type TokenIndex uint64
Click to show internal directories.
Click to hide internal directories.