Documentation
¶
Index ¶
- Constants
- Variables
- func AckMessageKeyFunc(obj interface{}) (string, error)
- func ConstructConnectMessage(info *model.HubInfo, isConnected bool) *beehivemodel.Message
- func DeepCopy(msg *beehivemodel.Message) *beehivemodel.Message
- func GetMessageDeletionTimestamp(msg *beehivemodel.Message) (*v1.Time, error)
- func GetMessageUID(msg beehivemodel.Message) (string, error)
- func IsVolumeResource(resource string) bool
- func NoAckMessageKeyFunc(obj interface{}) (string, error)
- func NotifyEventQueueError(conn conn.Connection, nodeID string)
- func TrimMessage(msg *beehivemodel.Message)
- type NodeMessagePool
Constants ¶
const (
VolumePattern = `^\w[-\w.+]*/` + constants.CSIResourceTypeVolume + `/\w[-\w.+]*`
)
VolumePattern constants for error message
Variables ¶
var VolumeRegExp = regexp.MustCompile(VolumePattern)
VolumeRegExp is used to validate the volume resource
Functions ¶
func AckMessageKeyFunc ¶
func ConstructConnectMessage ¶
func ConstructConnectMessage(info *model.HubInfo, isConnected bool) *beehivemodel.Message
func DeepCopy ¶
func DeepCopy(msg *beehivemodel.Message) *beehivemodel.Message
func GetMessageDeletionTimestamp ¶
func GetMessageDeletionTimestamp(msg *beehivemodel.Message) (*v1.Time, error)
GetMessageDeletionTimestamp returns the deletionTimestamp of the object in message
func GetMessageUID ¶
func GetMessageUID(msg beehivemodel.Message) (string, error)
GetMessageUID returns the UID of the object in message
func IsVolumeResource ¶
func NoAckMessageKeyFunc ¶
func NotifyEventQueueError ¶
func NotifyEventQueueError(conn conn.Connection, nodeID string)
func TrimMessage ¶
func TrimMessage(msg *beehivemodel.Message)
TrimMessage trims resource field in message before: node/{nodename}/{namespace}/pod/{podname} after: {namespace}/pod/{podname}
Types ¶
type NodeMessagePool ¶
type NodeMessagePool struct { // AckMessageStore store message that will send to edge node // and require acknowledgement from edge node. AckMessageStore cache.Store // AckMessageQueue store message key that will send to edge node // and require acknowledgement from edge node. AckMessageQueue workqueue.RateLimitingInterface // NoAckMessageStore store message that will send to edge node // and do not require acknowledgement from edge node. NoAckMessageStore cache.Store // NoAckMessageQueue store message key that will send to edge node // and do not require acknowledgement from edge node. NoAckMessageQueue workqueue.RateLimitingInterface }
NodeMessagePool is a collection of all downstream messages sent to an edge node. There are two types of messages, one that requires an ack and one that does not. For each type of message, we use the `queue` to mark the order of sending, and use the `store` to store specific messages
func InitNodeMessagePool ¶
func InitNodeMessagePool(nodeID string) *NodeMessagePool
InitNodeMessagePool init node message pool for node
func (*NodeMessagePool) GetAckMessage ¶
func (nsp *NodeMessagePool) GetAckMessage(key string) (*beehivemodel.Message, error)
GetAckMessage get message that requires ack with the key
func (*NodeMessagePool) GetNoAckMessage ¶
func (nsp *NodeMessagePool) GetNoAckMessage(key string) (*beehivemodel.Message, error)
GetNoAckMessage get message that does not require ack with the key
func (*NodeMessagePool) ShutDown ¶
func (nsp *NodeMessagePool) ShutDown()
ShutDown will close all the message queue in the message pool