ostreerepository

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 21 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) AddRemote

func (h *Handler) AddRemote(ctx context.Context, remote *apiv1.OSTreeRemoteProperties) (err error)

func (*Handler) BeginLocalRepoTransaction

func (h *Handler) BeginLocalRepoTransaction(ctx context.Context, tFn TransactionFn, opts ...TransactionOption) error

BeginLocalRepoTransaction executes a transaction against the local ostree repository. The transaction is executed in a temporary directory in which the following steps are performed: 1. The local ostree repository is opened. 2. The beskar remote is added to the local ostree repository. 3. The beskar version of the repo is pulled into the local ostree repository. 4. The transactorFn is executed. 5. If the transactorFn returns true, the local ostree repository is pushed to beskar. If false, all local changes are discarded. 6. The temporary directory is removed.

func (*Handler) CreateRepository

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

func (*Handler) DeleteRemote added in v0.0.22

func (h *Handler) DeleteRemote(ctx context.Context, remoteName string) (err error)

func (*Handler) DeleteRepository

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

DeleteRepository deletes the repository from beskar and the local filesystem.

This could lead to an invalid _state if the repository fails to completely deleting from beskar.

func (*Handler) GetRepositorySyncStatus

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

func (*Handler) ListRepositoryRefs added in v0.0.25

func (h *Handler) ListRepositoryRefs(ctx context.Context) (refs []apiv1.OSTreeRef, err error)

func (*Handler) QueueEvent

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

func (*Handler) Start

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

func (*Handler) SyncRepository

func (h *Handler) SyncRepository(_ context.Context, properties *apiv1.OSTreeRepositorySyncRequest) (err error)

func (*Handler) UpdateRemote added in v0.0.22

func (h *Handler) UpdateRemote(ctx context.Context, remoteName string, remote *apiv1.OSTreeRemoteProperties) (err error)

type RepoSync

type RepoSync struct {
	Syncing    bool
	StartTime  int64
	EndTime    int64
	SyncError  string
	SyncedRefs []libostree.Ref
}

type State

type State int32
const (
	// StateStopped - The repository _state is unknown.
	StateStopped State = iota
	// StateReady - The repository is ready.
	StateReady
	// StateProvisioning - The repository is being provisioned.
	StateProvisioning
	// StateSyncing - The repository is being synced.
	StateSyncing
	// StateDeleting - The repository is being deleted.
	StateDeleting
)

func (State) String

func (s State) String() string

type TransactionFn

type TransactionFn func(ctx context.Context, repo *libostree.Repo) (commit bool, err error)

type TransactionOption

type TransactionOption func(*TransactionOptions)

func SkipPull

func SkipPull() TransactionOption

type TransactionOptions

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

Jump to

Keyboard shortcuts

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