server

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BACKUP_FAILED_PATH = "backup_failed"
)
View Source
const (
	PERCENT_PROCESS = 0.2
)

Variables

View Source
var Version = "dev"

Functions

func WalkerDir added in v1.0.0

func WalkerDir(dir string, index *cache.Index, p *progress.Progress, logger *zap.Logger) (progress.Stat, int64, error)

func WalkerItem added in v1.0.0

func WalkerItem(index *cache.Index, p *progress.Progress, logger *zap.Logger) (progress.Stat, error)

Types

type Option

type Option func(s *Server) error

func WithAddr

func WithAddr(addr string) Option

WithAddr returns an Option which set the server listening address.

func WithBackupClient

func WithBackupClient(c *backupapi.Client) Option

WithBackupClient returns an Option which set the backup client for Server.

func WithBroker

func WithBroker(b broker.Broker) Option

WithBroker returns an Option which set the server broker for async messaging.

func WithLogger added in v1.0.16

func WithLogger(logger *zap.Logger) Option

WithLogger returns an Option which set the logger for Server.

func WithNumGoroutine added in v1.0.19

func WithNumGoroutine(num int) Option

WithLogger returns an Option which set the logger for Server.

func WithPublishTopics added in v1.0.0

func WithPublishTopics(topics ...string) Option

WithPublishTopics returns an Option which set the server topic that server broker will publish message.

func WithSubscribeTopics

func WithSubscribeTopics(topics ...string) Option

WithSubscribeTopics returns an Option which set the subscribeTopics that server broker will subscribe to.

type Server

type Server struct {
	Addr string
	// contains filtered or unexported fields
}

Server defines parameters for running BizFly Backup HTTP server.

func New

func New(opts ...Option) (*Server, error)

New creates new server instance.

func (*Server) DeleteRecoveryPoints added in v1.0.20

func (s *Server) DeleteRecoveryPoints(w http.ResponseWriter, r *http.Request)

func (*Server) ListAction added in v1.0.18

func (s *Server) ListAction(w http.ResponseWriter, r *http.Request)

func (*Server) ListBackup

func (s *Server) ListBackup(w http.ResponseWriter, r *http.Request)

func (*Server) ListRecoveryPoints

func (s *Server) ListRecoveryPoints(w http.ResponseWriter, r *http.Request)

func (*Server) NewStorageVault added in v1.0.4

func (s *Server) NewStorageVault(storageVault backupapi.StorageVault, actionID string, limitUpload, limitDownload int) (storage_vault.StorageVault, error)

func (*Server) RequestBackup

func (s *Server) RequestBackup(w http.ResponseWriter, r *http.Request)

func (*Server) RequestRestore

func (s *Server) RequestRestore(w http.ResponseWriter, r *http.Request)

func (*Server) Run

func (s *Server) Run() error

func (*Server) StopAction added in v1.0.18

func (s *Server) StopAction(w http.ResponseWriter, r *http.Request)

func (*Server) SyncConfig

func (s *Server) SyncConfig(w http.ResponseWriter, r *http.Request)

func (*Server) UpgradeAgent

func (s *Server) UpgradeAgent(w http.ResponseWriter, r *http.Request)

func (*Server) Version added in v0.0.11

func (s *Server) Version(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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