Documentation ¶
Index ¶
- type Handler
- func (h *Handler) AddRemote(ctx context.Context, remote *apiv1.OSTreeRemoteProperties) (err error)
- func (h *Handler) BeginLocalRepoTransaction(ctx context.Context, tFn TransactionFn, opts ...TransactionOption) error
- func (h *Handler) CreateRepository(ctx context.Context, properties *apiv1.OSTreeRepositoryProperties) (err error)
- func (h *Handler) DeleteRemote(ctx context.Context, remoteName string) (err error)
- func (h *Handler) DeleteRepository(ctx context.Context) (err error)
- func (h *Handler) GetRepositorySyncStatus(_ context.Context) (syncStatus *apiv1.SyncStatus, err error)
- func (h *Handler) ListRepositoryRefs(ctx context.Context) (refs []apiv1.OSTreeRef, err error)
- func (h *Handler) QueueEvent(_ *eventv1.EventPayload, _ bool) error
- func (h *Handler) Start(ctx context.Context)
- func (h *Handler) SyncRepository(_ context.Context, properties *apiv1.OSTreeRepositorySyncRequest) (err error)
- func (h *Handler) UpdateRemote(ctx context.Context, remoteName string, remote *apiv1.OSTreeRemoteProperties) (err error)
- type RepoSync
- type State
- type TransactionFn
- type TransactionOption
- type TransactionOptions
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) 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 (*Handler) DeleteRemote ¶ added in v0.0.22
func (*Handler) DeleteRepository ¶
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 (*Handler) ListRepositoryRefs ¶ added in v0.0.25
func (*Handler) QueueEvent ¶
func (h *Handler) QueueEvent(_ *eventv1.EventPayload, _ bool) error
func (*Handler) SyncRepository ¶
func (*Handler) UpdateRemote ¶ added in v0.0.22
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 )
type TransactionFn ¶
type TransactionOption ¶
type TransactionOption func(*TransactionOptions)
func SkipPull ¶
func SkipPull() TransactionOption
type TransactionOptions ¶
type TransactionOptions struct {
// contains filtered or unexported fields
}