cubes

package
v0.0.0-...-3e0e934 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: Apache-2.0, BSD-2-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CubeboxEventTypeUpdate = "UPDATE"
)

Variables

This section is empty.

Functions

func IsNotFoundContainerError

func IsNotFoundContainerError(err error) bool

func RecoverPod

func RecoverPod(ctx context.Context, client *containerd.Client, cb *cubeboxstore.CubeBox) (err error)

func WithNoEvent

func WithNoEvent(o *CubeboxSaveOptions)

Types

type ContainerdClientSetter

type ContainerdClientSetter interface {
	SetContainerdClient(client *containerd.Client)
}

type CubeboxAPI

type CubeboxAPI interface {
	Init(ctx context.Context) error

	Get(ctx context.Context, id string) (*cubeboxstore.CubeBox, error)
	FindContainerOfCubebox(ctx context.Context, ID string) (*cubeboxstore.Container, *cubeboxstore.CubeBox, error)
	List() []*cubeboxstore.CubeBox
	IsImageInUse(imageID string) (bool, error)

	Save(ctx context.Context, info *cubeboxstore.CubeBox, opts ...UpdateCubeboxOpt) error
	SyncByID(ctx context.Context, id string, opts ...UpdateCubeboxOpt) error

	Delete(ctx context.Context, opt *DeleteOption) error
}

type CubeboxEvent

type CubeboxEvent struct {
	EventType string
	Cubebox   *cubeboxstore.CubeBox
}

type CubeboxEventListener

type CubeboxEventListener interface {
	OnCubeboxEvent(ctx context.Context, event *CubeboxEvent) error
}

type CubeboxEventListenerRegistry

type CubeboxEventListenerRegistry interface {
	Register(listener CubeboxEventListener)
}

type CubeboxSaveOptions

type CubeboxSaveOptions struct {
	NoEvent bool
}

type DeleteOption

type DeleteOption struct {
	CubeboxID           string
	ContainerID         string
	SkipDeleteFlagCheck bool
}

type RocoverCubebox

type RocoverCubebox interface {
	RecoverAllCubebox(ctx context.Context, afterRecover func(ctx context.Context, cb *cubeboxstore.CubeBox) error) error
}

type UpdateCubeboxOpt

type UpdateCubeboxOpt func(*CubeboxSaveOptions)

Jump to

Keyboard shortcuts

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