action

package
v1.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SyncDataActionAdd is add action on SyncData.
	SyncDataActionAdd = "Add"

	// SyncDataActionDelete is delete action on SyncData.
	SyncDataActionDelete = "Delete"

	// SyncDataActionUpdate is update action on SyncData.
	SyncDataActionUpdate = "Update"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alertor

type Alertor struct {
	ClusterID string
	Module    string
	ModuleIP  string
}

func NewAlertor

func NewAlertor(clusterID, moduleIP string, zkHosts string, tls options.TLS) (*Alertor, error)

func (*Alertor) DoAlarm

func (alertor *Alertor) DoAlarm(syncData *SyncData)

type LogAction

type LogAction struct {
	Name      string
	ClusterID string
}

func (*LogAction) Add

func (logAction *LogAction) Add(syncData *SyncData)

func (*LogAction) Delete

func (logAction *LogAction) Delete(syncData *SyncData)

func (*LogAction) Update

func (logAction *LogAction) Update(syncData *SyncData)

type StorageAction

type StorageAction struct {
	// contains filtered or unexported fields
}

StorageAction is http action of storage service.

func NewStorageAction

func NewStorageAction(clusterID, name string, storageService *bcs.InnerService) *StorageAction

NewStorageAction creates a new StorageAction instance.

func (*StorageAction) Add

func (act *StorageAction) Add(syncData *SyncData)

Add adds new resource data by http PUT.

func (*StorageAction) Delete

func (act *StorageAction) Delete(syncData *SyncData)

Delete deletes target resource data by http DELETE.

func (*StorageAction) Update

func (act *StorageAction) Update(syncData *SyncData)

Update updates old resource data by http PUT.

type SyncData

type SyncData struct {
	// Kind is resource kind.
	Kind string
	// Namespace is k8s resource namespace.
	Namespace string
	// Name is resource name.
	Name string
	// Action is SyncDataAction Add/Delete/Update.
	Action string

	// Data is resource metadata.
	Data interface{}

	// OwnerUID is resource owner id.
	OwnerUID string
}

SyncData is metadata would be synced to storage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL