Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRateLimitngQueue ¶
func NewRateLimitngQueue(numWorkers int, stop <-chan struct{}) (inChan chan<- Resource, outChan <-chan Resource)
NewRateLimitngQueue returns new rate limiting resource event queue
func NewUniqueQueue ¶
func NewUniqueQueue(stop <-chan struct{}, size ...int) (inChan chan<- Resource, outChan <-chan Resource)
NewUniqueQueue returns a queue for events which ensures that events in the queue are unique it takes optional arguments ioSize and bufSize ioSize is the size of in and out buffered channels bufSize is the size of internal buffer in the queue
Types ¶
type Handler ¶
type Handler interface {
OnChange(r Resource)
}
Handler is the interface for notifying resource changes
type HandlerFuncs ¶
HandlerFuncs is a utility for creating event handler with functions
func (HandlerFuncs) OnChange ¶
func (f HandlerFuncs) OnChange(r Resource)
OnChange is the callback for notifying when resource is changed
type Resource ¶
type Resource struct { PartnerID string `json:"pa,omitempty"` OrganizationID string `json:"or,omitempty"` ProjectID string `json:"pr,omitempty"` ID string `json:"id,omitempty"` Name string `json:"n,omitempty"` EventType ResourceEventType `json:"t,omitempty"` }
Resource represents an event generated when resource changes it should be looked as an parameter to the event handler callback
type ResourceEventType ¶
type ResourceEventType int
ResourceEventType is type of resource event
const ( EventTypeNotSet ResourceEventType = iota ResourceCreate ResourceUpdate ResourceDelete ResourceUpdateStatus )
Resource event types