mirrorrepository

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	*repository.RepoHandler
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(logger *slog.Logger, repoHandler *repository.RepoHandler) *Handler

func (*Handler) CreateRepository

func (h *Handler) CreateRepository(ctx context.Context, properties *apiv1.RepositoryProperties) (err error)

func (*Handler) DeleteRepository

func (h *Handler) DeleteRepository(ctx context.Context, deleteFiles bool) (err error)

func (*Handler) DeleteRepositoryFile added in v0.0.32

func (h *Handler) DeleteRepositoryFile(ctx context.Context, file string) (err error)

func (*Handler) DeleteRepositoryFilesByMode added in v0.0.35

func (h *Handler) DeleteRepositoryFilesByMode(ctx context.Context, mode uint32) (err error)

func (*Handler) GenerateIndexes

func (h *Handler) GenerateIndexes() error

func (*Handler) GenerateRepository added in v0.0.32

func (h *Handler) GenerateRepository(_ context.Context) (err error)

func (*Handler) GetRepository

func (h *Handler) GetRepository(ctx context.Context) (properties *apiv1.RepositoryProperties, err error)

func (*Handler) GetRepositoryFile

func (h *Handler) GetRepositoryFile(ctx context.Context, name string) (repositoryFile *apiv1.RepositoryFile, err error)

func (*Handler) GetRepositoryFileByReference added in v0.0.32

func (h *Handler) GetRepositoryFileByReference(ctx context.Context, reference string) (repositoryFile *apiv1.RepositoryFile, err error)

func (*Handler) GetRepositoryFileByReferenceRaw added in v0.0.32

func (h *Handler) GetRepositoryFileByReferenceRaw(ctx context.Context, reference string) (repositoryFile *mirrordb.RepositoryFile, err error)

func (*Handler) GetRepositoryFileCount added in v0.0.32

func (h *Handler) GetRepositoryFileCount(ctx context.Context) (count int, err error)

func (*Handler) GetRepositoryFileRaw added in v0.0.36

func (h *Handler) GetRepositoryFileRaw(ctx context.Context, name string) (repositoryFile *mirrordb.RepositoryFile, err error)

func (*Handler) GetRepositorySyncPlan added in v0.0.32

func (h *Handler) GetRepositorySyncPlan(_ context.Context) (syncPlan *apiv1.RepositorySyncPlan, err error)

func (*Handler) GetRepositorySyncStatus

func (h *Handler) GetRepositorySyncStatus(context.Context) (syncStatus *apiv1.SyncStatus, err error)

func (*Handler) ListRepositoryFiles

func (h *Handler) ListRepositoryFiles(ctx context.Context, _ *apiv1.Page) (repositoryFiles []*apiv1.RepositoryFile, err error)

func (*Handler) ListRepositoryLogs

func (h *Handler) ListRepositoryLogs(ctx context.Context, _ *apiv1.Page) (logs []apiv1.RepositoryLog, err error)
func (h *Handler) ListRepositorySymlinks(ctx context.Context, _ *apiv1.Page) (repositoryFiles []*apiv1.RepositoryFile, err error)

func (*Handler) QueueEvent

func (h *Handler) QueueEvent(event *eventv1.EventPayload, store bool) error

func (*Handler) Start

func (h *Handler) Start(ctx context.Context)

func (*Handler) SyncRepository

func (h *Handler) SyncRepository(_ context.Context, wait bool) (err error)

func (*Handler) SyncRepositoryWithConfig added in v0.0.34

func (h *Handler) SyncRepositoryWithConfig(_ context.Context, mirrorConfigs []apiv1.MirrorConfig, webConfig *apiv1.WebConfig, wait bool) (err error)

func (*Handler) UpdateRepository

func (h *Handler) UpdateRepository(ctx context.Context, properties *apiv1.RepositoryProperties) (err error)

type MirrorSyncer added in v0.0.34

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

func NewMirrorSyncer added in v0.0.34

func NewMirrorSyncer(h *Handler, config mirrorConfig, configID uint64, parallelism int) (*MirrorSyncer, error)

func (*MirrorSyncer) ListRepositoryFiles added in v0.0.34

func (s *MirrorSyncer) ListRepositoryFiles() ([]*apiv1.RepositoryFile, error)

Custom list method since generated client doesn't supply user credentials in the URL.

func (*MirrorSyncer) Plan added in v0.0.34

func (s *MirrorSyncer) Plan() (*MirrorSyncerPlan, error)

func (*MirrorSyncer) Sync added in v0.0.34

func (s *MirrorSyncer) Sync() error

type MirrorSyncerPlan added in v0.0.34

type MirrorSyncerPlan struct {
	AddRemoteFiles   []*mirrordb.RepositoryFile
	DeleteLocalFiles []*mirrordb.RepositoryFile
}

type PlanSyncer added in v0.0.32

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

func NewPlanSyncer added in v0.0.32

func NewPlanSyncer(h *Handler, config mirrorConfig, configID uint64, parallelism int, plan *rsync.SyncPlan) *PlanSyncer

func (*PlanSyncer) Sync added in v0.0.32

func (s *PlanSyncer) Sync() error

type Storage added in v0.0.32

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

func NewStorage added in v0.0.32

func NewStorage(h *Handler, config mirrorConfig, configID uint64) *Storage

func (*Storage) Close added in v0.0.32

func (s *Storage) Close()

func (*Storage) Delete added in v0.0.32

func (s *Storage) Delete(filePath string, _ rsync.FileMode) error

func (*Storage) List added in v0.0.32

func (s *Storage) List() (rsync.FileList, error)

func (*Storage) Put added in v0.0.32

func (s *Storage) Put(filePath string, content io.Reader, fileSize int64, metadata rsync.FileMetadata) (written int64, err error)

Jump to

Keyboard shortcuts

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