mirror

package
v1.22.5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 26 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPullMirrorToQueue added in v1.21.0

func AddPullMirrorToQueue(repoID int64)

AddPullMirrorToQueue adds repoID to mirror queue

func AddPushMirrorRemote added in v1.15.0

func AddPushMirrorRemote(ctx context.Context, m *repo_model.PushMirror, addr string) error

AddPushMirrorRemote registers the push mirror remote.

func AddPushMirrorToQueue added in v1.15.0

func AddPushMirrorToQueue(mirrorID int64)

AddPushMirrorToQueue adds the push mirror to the queue

func InitSyncMirrors

func InitSyncMirrors()

InitSyncMirrors initializes a go routine to sync the mirrors

func PushToQueue added in v1.21.0

func PushToQueue(mirrorType SyncType, referenceID int64) error

PushToQueue adds the sync request to the queue

func RemovePushMirrorRemote added in v1.15.0

func RemovePushMirrorRemote(ctx context.Context, m *repo_model.PushMirror) error

RemovePushMirrorRemote removes the push mirror remote.

func StartSyncMirrors added in v1.21.0

func StartSyncMirrors()

StartSyncMirrors starts a go routine to sync the mirrors

func SyncPullMirror added in v1.15.0

func SyncPullMirror(ctx context.Context, repoID int64) bool

SyncPullMirror starts the sync of the pull mirror and schedules the next run.

func SyncPushMirror added in v1.15.0

func SyncPushMirror(ctx context.Context, mirrorID int64) bool

SyncPushMirror starts the sync of the push mirror and schedules the next run.

func Update

func Update(ctx context.Context, pullLimit, pushLimit int) error

Update checks and updates mirror repositories.

func UpdateAddress added in v1.12.5

func UpdateAddress(ctx context.Context, m *repo_model.Mirror, addr string) error

UpdateAddress writes new address to Git repository and database

Types

type SyncRequest added in v1.16.0

type SyncRequest struct {
	Type        SyncType
	ReferenceID int64 // RepoID for pull mirror, MirrorID for push mirror
}

SyncRequest for the mirror queue

type SyncType added in v1.16.0

type SyncType int

SyncType type of sync request

const (
	// PullMirrorType for pull mirrors
	PullMirrorType SyncType = iota
	// PushMirrorType for push mirrors
	PushMirrorType
)

Jump to

Keyboard shortcuts

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