Documentation
¶
Index ¶
Constants ¶
const ( // HandlerAckDone is set when handler has been acknowledged of snapshotter termination. HandlerAckDone uint32 = 0 // HandlerAckWaiting is set when handler starts waiting of snapshotter termination. HandlerAckWaiting uint32 = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackupRestoreComponentConfig ¶ added in v0.29.0
type BackupRestoreComponentConfig struct {
EtcdConnectionConfig *brtypes.EtcdConnectionConfig `json:"etcdConnectionConfig,omitempty"`
ServerConfig *HTTPServerConfig `json:"serverConfig,omitempty"`
SnapshotterConfig *brtypes.SnapshotterConfig `json:"snapshotterConfig,omitempty"`
SnapstoreConfig *brtypes.SnapstoreConfig `json:"snapstoreConfig,omitempty"`
SecondarySnapstoreConfig *brtypes.SecondarySnapstoreConfig `json:"secondarySnapstoreConfig,omitempty"`
CompressionConfig *compressor.CompressionConfig `json:"compressionConfig,omitempty"`
RestorationConfig *brtypes.RestorationConfig `json:"restorationConfig,omitempty"`
HealthConfig *brtypes.HealthConfig `json:"healthConfig,omitempty"`
LeaderElectionConfig *brtypes.Config `json:"leaderElectionConfig,omitempty"`
ExponentialBackoffConfig *brtypes.ExponentialBackoffConfig `json:"exponentialBackoffConfig,omitempty"`
DefragmentationSchedule string `json:"defragmentationSchedule"`
UseEtcdWrapper bool `json:"useEtcdWrapper,omitempty"`
}
BackupRestoreComponentConfig holds the component configuration.
func NewBackupRestoreComponentConfig ¶ added in v0.29.0
func NewBackupRestoreComponentConfig() *BackupRestoreComponentConfig
NewBackupRestoreComponentConfig returns the backup-restore component config.
func (*BackupRestoreComponentConfig) AddFlags ¶ added in v0.29.0
func (c *BackupRestoreComponentConfig) AddFlags(fs *flag.FlagSet)
AddFlags adds the flags to flagset.
func (*BackupRestoreComponentConfig) Complete ¶ added in v0.29.0
func (c *BackupRestoreComponentConfig) Complete()
Complete completes the config.
func (*BackupRestoreComponentConfig) Validate ¶ added in v0.29.0
func (c *BackupRestoreComponentConfig) Validate() error
Validate validates the config.
type BackupRestoreServer ¶ added in v0.29.0
type BackupRestoreServer struct {
// contains filtered or unexported fields
}
BackupRestoreServer holds the details for backup-restore server.
func NewBackupRestoreServer ¶ added in v0.29.0
func NewBackupRestoreServer(logger *logrus.Logger, config *BackupRestoreComponentConfig) (*BackupRestoreServer, error)
NewBackupRestoreServer return new backup restore server.
type HTTPHandler ¶
type HTTPHandler struct {
Initializer initializer.Initializer
Snapshotter *snapshotter.Snapshotter
EtcdConnectionConfig *brtypes.EtcdConnectionConfig
AckCh chan struct{}
SnapstoreConfig *brtypes.SnapstoreConfig
Logger *logrus.Entry
HTTPHandlerMutex *sync.Mutex
ReqCh chan struct{}
StopCh chan struct{}
StorageProvider string
ServerTLSCertFile string
ServerTLSKeyFile string
Port uint
AckState uint32
EnableTLS bool
EnableProfiling bool
// contains filtered or unexported fields
}
HTTPHandler is implementation to handle HTTP API exposed by server
func (*HTTPHandler) GetStatus ¶ added in v0.7.0
func (h *HTTPHandler) GetStatus() int
GetStatus returns the current status in the HTTPHandler
func (*HTTPHandler) RegisterHandler ¶
func (h *HTTPHandler) RegisterHandler()
RegisterHandler registers the handler for different requests
func (*HTTPHandler) SetSnapshotter ¶ added in v0.29.0
func (h *HTTPHandler) SetSnapshotter(ssr *snapshotter.Snapshotter)
SetSnapshotter sets the current HTTPHandler.Snapshotter in the HTTPHandler.
func (*HTTPHandler) SetSnapshotterToNil ¶ added in v0.29.0
func (h *HTTPHandler) SetSnapshotterToNil()
SetSnapshotterToNil sets the current HTTPHandler.Snapshotter to Nil in the HTTPHandler.
func (*HTTPHandler) SetStatus ¶ added in v0.7.0
func (h *HTTPHandler) SetStatus(status int)
SetStatus sets the current status in the HTTPHandler
func (*HTTPHandler) Start ¶
func (h *HTTPHandler) Start()
Start starts the http server to listen for request
type HTTPServerConfig ¶ added in v0.29.0
type HTTPServerConfig struct {
TLSCertFile string `json:"server-cert,omitempty"`
TLSKeyFile string `json:"server-key,omitempty"`
Port uint `json:"port,omitempty"`
EnableProfiling bool `json:"enableProfiling,omitempty"`
}
HTTPServerConfig holds the server config.
func NewHTTPServerConfig ¶ added in v0.29.0
func NewHTTPServerConfig() *HTTPServerConfig
NewHTTPServerConfig returns the config for http server
func (*HTTPServerConfig) AddFlags ¶ added in v0.29.0
func (c *HTTPServerConfig) AddFlags(fs *flag.FlagSet)
AddFlags adds the flags to flagset.
func (*HTTPServerConfig) Validate ¶ added in v0.29.0
func (c *HTTPServerConfig) Validate() error
Validate validates the config.E
type HandlerAckState ¶
type HandlerAckState int32
HandlerAckState denotes the state the handler would be in after sending a stop request to the snapshotter.
type HandlerRequest ¶
type HandlerRequest int
HandlerRequest represents the type of request handler makes to the snapshotter.
const ( // HandlerSsrAbort is the HandlerRequest to the snapshotter to terminate the snapshot process. HandlerSsrAbort HandlerRequest = 0 )