instance

package
v1.0.0-cli.0...-2d063a8 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToTransport

func ToTransport(ins resource.Instance) *instancev1alpha1.Instance

ToTransport converts the domain object to a transport layer object

Types

type Repository

type Repository interface {
	CreateInstance(ctx context.Context, instance resource.Instance, nodeID string) (resource.Instance, error)
	ListInstances(ctx context.Context, pageSize int, afterID *string) ([]resource.Instance, error)
	GetInstanceByID(ctx context.Context, id string) (resource.Instance, error)
	GetInstancesByNodeID(ctx context.Context, id string) ([]resource.Instance, error)

	// ApplyStatusReports updates instances rows that are not in [instance.InstanceStateDeleted] state.
	// all other instances will be removed from the table.
	ApplyStatusReports(ctx context.Context, reports []resource.InstanceStatusReport) error
	CountInstancesByFlavorVersionID(ctx context.Context, flavorVersionID string) (uint, error)
}

type Service

type Service interface {
	GetInstance(ctx context.Context, id string) (resource.Instance, error)
	ListInstances(ctx context.Context, pageSize int, afterID *string) ([]resource.Instance, error)
	RunFlavorVersion(
		ctx context.Context,
		chunkID string,
		flavorVersionID string,
		ownerID string,
	) (resource.Instance, error)
	DiscoverInstances(ctx context.Context, nodeID string) ([]resource.Instance, error)
	ReceiveInstanceStatusReports(ctx context.Context, reports []resource.InstanceStatusReport) error
}

func NewService

func NewService(logger *slog.Logger, insRepo Repository, nodeRepo node.Repository, chunkService chunk.Service) Service

Jump to

Keyboard shortcuts

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