Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface { // Add adds new resource metadata. Add(syncData *action.SyncData) // Delete deletes target resource metadata. Delete(syncData *action.SyncData) // Update updates target resource metadata. Update(syncData *action.SyncData) }
Action handles the metadata in ADD/DEL/UPDATE methods.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is resource handler, consumes metadata distributed from Writer, and handles data with the action.
func NewHandler ¶
NewHandler creates a new resource Handler instance with the action.
func (*Handler) HandleWithTimeout ¶
HandleWithTimeout sends the metadata into handler queue with timeout.
type Writer ¶
type Writer struct { // settled handlers. Handlers map[string]*Handler // contains filtered or unexported fields }
Writer writes the metadata to target storage service. There are queues for normal data and alarm message data, every metadata in queues would be distributed to settled handler.
func NewWriter ¶
func NewWriter(clusterID string, storageService *bcs.InnerService, alertor *action.Alertor) (*Writer, error)
NewWriter creates a new Writer instance which base on bcs-storage service and alarm sender.
func (*Writer) Run ¶
Run runs the Writer instance with target stop channel, and starts all handlers. There is a groutine which keep consuming metadata in queues and distributes data to settled handler until stop channel is activated.
func (*Writer) SyncAlarmEvent ¶
SyncAlarmEvent syncs alarm message data by sending into alarm queue.