storage

package
v1.25.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppHandler

type AppHandler struct {
	ClusterID    string
	DoCheckDirty bool
	// contains filtered or unexported fields
}

AppHandler handle for Application

func (*AppHandler) Add

func (handler *AppHandler) Add(data interface{}) error

Add add event

func (*AppHandler) CheckDirty

func (handler *AppHandler) CheckDirty() error

CheckDirty clean remote dirty data

func (*AppHandler) Delete

func (handler *AppHandler) Delete(data interface{}) error

Delete delete info

func (*AppHandler) FormatConv

FormatConv convert format for status info

func (*AppHandler) GetType

func (handler *AppHandler) GetType() string

GetType get handler type

func (*AppHandler) Update

func (handler *AppHandler) Update(data interface{}) error

Update update in zookeeper

type CCListData

type CCListData struct {
	Apps          []map[string]*schedtypes.Application `json:"application,omitempty"`
	TaskGroup     []map[string]*schedtypes.TaskGroup   `json:"taskgroup,omitempty"`
	ExportService []map[string]*lbtypes.ExportService  `json:"exportservice,omitempty"`
}

CCListData hold all data

type CCResponse

type CCResponse struct {
	Result  bool   `json:"result"`
	Code    int    `json:"code"`
	Message string `json:"message,omitempty"`
	Data    string `json:"data,omitempty"`
}

CCResponse response struct from CC

type CCStorage

type CCStorage struct {
	ClusterID string //
	// contains filtered or unexported fields
}

CCStorage writing data to CC

func (*CCStorage) CreateDCNode

func (cc *CCStorage) CreateDCNode(node string, value interface{}, action string) error

CreateDCNode bcs-storage create operation

func (*CCStorage) DeleteDCNode

func (cc *CCStorage) DeleteDCNode(node, action string) error

DeleteDCNode storage delete operation

func (*CCStorage) DeleteDCNodes

func (cc *CCStorage) DeleteDCNodes(node string, value interface{}, action string) error

DeleteDCNodes bcs-storage delete operation

func (*CCStorage) GetDCAddress

func (cc *CCStorage) GetDCAddress() string

GetDCAddress get bcs-storage address

func (*CCStorage) Run

func (cc *CCStorage) Run(ctx context.Context) error

Run start point for StorageWriter

func (*CCStorage) SetDCAddress

func (cc *CCStorage) SetDCAddress(address []string)

SetDCAddress had better add rwlock

func (*CCStorage) Sync

func (cc *CCStorage) Sync(data *types.BcsSyncData) error

Sync sync data to storage queue

func (*CCStorage) SyncTimeout

func (cc *CCStorage) SyncTimeout(data *types.BcsSyncData, timeout time.Duration) error

SyncTimeout send data to CCStorage queue with timeout

func (*CCStorage) Worker

func (cc *CCStorage) Worker()

Worker storage writer worker goroutine

type ChannelProxy

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

ChannelProxy Proxy offer particular channel for handling data in private goroutine

func (*ChannelProxy) Handle

func (proxy *ChannelProxy) Handle(data *types.BcsSyncData)

Handle for handling data action like Add, Delete, Update

func (*ChannelProxy) HandleWithTimeOut

func (proxy *ChannelProxy) HandleWithTimeOut(data *types.BcsSyncData, timeout time.Duration)

HandleWithTimeOut send data to proxy.dataQueue with timeout

func (*ChannelProxy) Run

func (proxy *ChannelProxy) Run(ctx context.Context)

Run ChannelProxy running a dataType handler channel, stop Run() By external context

type ConfigMapHandler

type ConfigMapHandler struct {
	ClusterID string
	// contains filtered or unexported fields
}

ConfigMapHandler handler for configmap synchronize to bcs-storage

func (*ConfigMapHandler) Add

func (handler *ConfigMapHandler) Add(data interface{}) error

Add add new configmap to bcs-storage

func (*ConfigMapHandler) CheckDirty

func (handler *ConfigMapHandler) CheckDirty() error

CheckDirty clean remote storage dirty data

func (*ConfigMapHandler) Delete

func (handler *ConfigMapHandler) Delete(data interface{}) error

Delete delete configmap in storage

func (*ConfigMapHandler) GetType

func (handler *ConfigMapHandler) GetType() string

GetType get datatype

func (*ConfigMapHandler) Update

func (handler *ConfigMapHandler) Update(data interface{}) error

Update update configmap in storage

type DataOperator

type DataOperator interface {
	CreateDCNode(node string, value interface{}, action string) error
	DeleteDCNode(node, action string) error
	DeleteDCNodes(node string, value interface{}, action string) error
}

DataOperator is Interface to Operator data for storage

type DeploymentHandler

type DeploymentHandler struct {
	ClusterID    string
	DoCheckDirty bool
	// contains filtered or unexported fields
}

DeploymentHandler event handler for Deployment

func (*DeploymentHandler) Add

func (handler *DeploymentHandler) Add(data interface{}) error

Add data add event implementation

func (*DeploymentHandler) CheckDirty

func (handler *DeploymentHandler) CheckDirty() error

CheckDirty clean dirty data in remote bcs-storage

func (*DeploymentHandler) Delete

func (handler *DeploymentHandler) Delete(data interface{}) error

Delete data Delete event implementation

func (*DeploymentHandler) GetType

func (handler *DeploymentHandler) GetType() string

GetType implementation

func (*DeploymentHandler) Update

func (handler *DeploymentHandler) Update(data interface{}) error

Update handle data update event implementation

type EndpointHandler

type EndpointHandler struct {
	ClusterID string
	// contains filtered or unexported fields
}

EndpointHandler handler for Endpoint event

func (*EndpointHandler) Add

func (handler *EndpointHandler) Add(data interface{}) error

Add add event storage implementation

func (*EndpointHandler) CheckDirty

func (handler *EndpointHandler) CheckDirty() error

CheckDirty clean dirty data in remote bcs-storage

func (*EndpointHandler) Delete

func (handler *EndpointHandler) Delete(data interface{}) error

Delete delete event implementation

func (*EndpointHandler) GetType

func (handler *EndpointHandler) GetType() string

GetType implementation

func (*EndpointHandler) Update

func (handler *EndpointHandler) Update(data interface{}) error

Update update event implementation

type ExpServiceHandler

type ExpServiceHandler struct {
	ClusterID string
	// contains filtered or unexported fields
}

ExpServiceHandler handle for taskgroup

func (*ExpServiceHandler) Add

func (handler *ExpServiceHandler) Add(data interface{}) error

Add handler to add

func (*ExpServiceHandler) CheckDirty

func (handler *ExpServiceHandler) CheckDirty() error

CheckDirty clean dirty data implementation

func (*ExpServiceHandler) Delete

func (handler *ExpServiceHandler) Delete(data interface{}) error

Delete delete info

func (*ExpServiceHandler) GetType

func (handler *ExpServiceHandler) GetType() string

GetType implementation

func (*ExpServiceHandler) Update

func (handler *ExpServiceHandler) Update(data interface{}) error

Update update in zookeeper

type InfoHandler

type InfoHandler interface {
	//List(key interface{}) map[string]interface{}
	Add(data interface{}) error
	Update(data interface{}) error
	Delete(data interface{}) error
	GetType() string

	CheckDirty() error
}

InfoHandler is interface for handle detail data

type NetServiceHandler

type NetServiceHandler struct {
	ClusterID string
	// contains filtered or unexported fields
}

NetServiceHandler handle netservice resources for storage.

func (*NetServiceHandler) Add

func (h *NetServiceHandler) Add(data interface{}) error

Add handle add event for netservice resources.

func (*NetServiceHandler) CheckDirty

func (h *NetServiceHandler) CheckDirty() error

CheckDirty cleans dirty data in remote bcs-storage.

func (*NetServiceHandler) Delete

func (h *NetServiceHandler) Delete(data interface{}) error

Delete handle delete event for netservice resources.

func (*NetServiceHandler) GetType

func (h *NetServiceHandler) GetType() string

GetType returns data type.

func (*NetServiceHandler) Update

func (h *NetServiceHandler) Update(data interface{}) error

Delete handle delete event for netservice resources.

type SecretHandler

type SecretHandler struct {
	ClusterID string
	// contains filtered or unexported fields
}

SecretHandler handler secret event

func (*SecretHandler) Add

func (handler *SecretHandler) Add(data interface{}) error

Add event implementation

func (*SecretHandler) CheckDirty

func (handler *SecretHandler) CheckDirty() error

CheckDirty implementation

func (*SecretHandler) Delete

func (handler *SecretHandler) Delete(data interface{}) error

Delete event implementation

func (*SecretHandler) GetType

func (handler *SecretHandler) GetType() string

GetType implementation

func (*SecretHandler) Update

func (handler *SecretHandler) Update(data interface{}) error

Update event implementation

type ServiceHandler

type ServiceHandler struct {
	ClusterID string
	// contains filtered or unexported fields
}

ServiceHandler service event handler

func (*ServiceHandler) Add

func (handler *ServiceHandler) Add(data interface{}) error

Add event implementation

func (*ServiceHandler) CheckDirty

func (handler *ServiceHandler) CheckDirty() error

CheckDirty implementation

func (*ServiceHandler) Delete

func (handler *ServiceHandler) Delete(data interface{}) error

Delete event implementation

func (*ServiceHandler) GetType

func (handler *ServiceHandler) GetType() string

GetType implementation

func (*ServiceHandler) Update

func (handler *ServiceHandler) Update(data interface{}) error

Update event implementation

type Storage

type Storage interface {
	//DataLister                          //embed DataLister interface for requesting data from Storage
	DataOperator                        //CREATE, DELETE, LIST operation for storage
	Sync(data *types.BcsSyncData) error //sync data
	SyncTimeout(data *types.BcsSyncData, timeout time.Duration) error
	Run(cxt context.Context) error //start point for StorageWriter
	Worker()                       //storage writer worker goroutine
	SetDCAddress(address []string) //set storage server address
	GetDCAddress() string
}

Storage is writer interface for all database such as zookeeper, Mysql, redis, CC and etc.

func NewCCStorage

func NewCCStorage(config *types.CmdConfig) (Storage, error)

NewCCStorage create storage for cc

type TaskGroupHandler

type TaskGroupHandler struct {
	ClusterID string

	DoCheckDirty bool
	// contains filtered or unexported fields
}

TaskGroupHandler handle for taskgroup

func (*TaskGroupHandler) Add

func (handler *TaskGroupHandler) Add(data interface{}) error

Add handler to add

func (*TaskGroupHandler) CheckDirty

func (handler *TaskGroupHandler) CheckDirty() error

CheckDirty implementation

func (*TaskGroupHandler) Delete

func (handler *TaskGroupHandler) Delete(data interface{}) error

Delete delete info

func (*TaskGroupHandler) FormatConv

func (handler *TaskGroupHandler) FormatConv(taskgroup *schedtypes.TaskGroup) (*commtypes.BcsPodStatus, error)

FormatConv convert taskgroup to pod status for storage

func (*TaskGroupHandler) GetType

func (handler *TaskGroupHandler) GetType() string

GetType implementation

func (*TaskGroupHandler) Update

func (handler *TaskGroupHandler) Update(data interface{}) error

Update update in zookeeper

Jump to

Keyboard shortcuts

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