containerresource

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequest      = errors.New("container resource request is invalid")
	ErrPreflightStale      = errors.New("container resource preflight is stale")
	ErrIdempotencyConflict = errors.New("container resource idempotency conflict")
	ErrOperationNotFound   = errors.New("container resource operation was not found")
	ErrOperationTerminal   = errors.New("container resource operation is already terminal")
	ErrManagedByWebService = errors.New("container resource is managed by Web Services")
)
View Source
var ErrComposeProjectDefinitionNotFound = errors.New("saved Compose project was not found")

Functions

This section is empty.

Types

type ComposeProjectDefinition

type ComposeProjectDefinition struct {
	ProjectID       string                     `json:"project_id"`
	Engine          containerengine.Engine     `json:"engine"`
	EndpointID      containerengine.EndpointID `json:"endpoint_id"`
	Name            string                     `json:"name"`
	ConfigPaths     []string                   `json:"config_paths"`
	EnvFilePath     string                     `json:"env_file_path,omitempty"`
	Profiles        []string                   `json:"profiles,omitempty"`
	CreatedAtUnixMs int64                      `json:"created_at_unix_ms"`
	UpdatedAtUnixMs int64                      `json:"updated_at_unix_ms"`
}

type ComposeProjectDefinitionInput

type ComposeProjectDefinitionInput struct {
	Engine      containerengine.Engine     `json:"engine"`
	EndpointID  containerengine.EndpointID `json:"endpoint_id"`
	Name        string                     `json:"name"`
	ConfigPaths []string                   `json:"config_paths"`
	EnvFilePath string                     `json:"env_file_path,omitempty"`
	Profiles    []string                   `json:"profiles,omitempty"`
}

type ComposeProjectItem

type ComposeProjectItem struct {
	containerengine.ComposeProject
	Management Management `json:"management"`
	Saved      bool       `json:"saved"`
	Source     string     `json:"source,omitempty"`
}

type ContainerDetails

type ContainerDetails struct {
	containerengine.ContainerInspect
	Management Management `json:"management"`
}

type ContainerItem

type ContainerItem struct {
	containerengine.ContainerSummary
	Management Management `json:"management"`
}

type ContainerServiceConfigurationState

type ContainerServiceConfigurationState struct {
	ServiceID             string
	SourceID              containerengine.ContainerServiceConfigurationSourceID
	ConfigurationRevision string
	RestartRequired       bool
	ServiceGeneration     string
	UpdatedAtUnixMs       int64
}

type ContainerServiceItem

type ContainerServiceItem struct {
	containerengine.ContainerService
}

type CreateOperationRequest

type CreateOperationRequest struct {
	RequestID   string                 `json:"request_id"`
	Method      containerengine.Method `json:"method"`
	Request     json.RawMessage        `json:"request"`
	RequestHash string                 `json:"request_hash"`
	PlanHash    string                 `json:"plan_hash"`
}

type Event

type Event struct {
	Sequence        int64           `json:"sequence"`
	OperationID     string          `json:"operation_id"`
	Type            string          `json:"type"`
	State           OperationState  `json:"state"`
	Payload         json.RawMessage `json:"payload,omitempty"`
	CreatedAtUnixMs int64           `json:"created_at_unix_ms"`
}

type IdempotencyConflictError

type IdempotencyConflictError struct {
	RequestID string
}

func (*IdempotencyConflictError) Error

func (e *IdempotencyConflictError) Error() string

func (*IdempotencyConflictError) Is

func (e *IdempotencyConflictError) Is(target error) bool

type ListOperationsRequest

type ListOperationsRequest struct {
	AfterSequence int64
	Limit         int
}

type ManagedOwner

type ManagedOwner struct {
	Kind      string `json:"kind"`
	ServiceID string `json:"service_id"`
	Name      string `json:"name"`
}

type ManagedResourceError

type ManagedResourceError struct {
	Owner ManagedOwner
}

func (*ManagedResourceError) Error

func (e *ManagedResourceError) Error() string

func (*ManagedResourceError) Is

func (e *ManagedResourceError) Is(target error) bool

type Management

type Management struct {
	Managed bool          `json:"managed"`
	Owner   *ManagedOwner `json:"owner,omitempty"`
}

type Operation

type Operation struct {
	OperationID      string                     `json:"operation_id"`
	RequestID        string                     `json:"request_id"`
	RequestHash      string                     `json:"request_hash"`
	PlanHash         string                     `json:"plan_hash"`
	Method           containerengine.Method     `json:"method"`
	Engine           containerengine.Engine     `json:"engine"`
	EndpointID       containerengine.EndpointID `json:"endpoint_id,omitempty"`
	ResourceKind     ResourceKind               `json:"resource_kind"`
	ResourceIdentity string                     `json:"resource_identity"`
	State            OperationState             `json:"state"`
	CancelRequested  bool                       `json:"cancel_requested"`
	ErrorCode        string                     `json:"error_code,omitempty"`
	ErrorMessage     string                     `json:"error_message,omitempty"`
	Reconciliation   json.RawMessage            `json:"reconciliation,omitempty"`
	CreatedAtUnixMs  int64                      `json:"created_at_unix_ms"`
	StartedAtUnixMs  int64                      `json:"started_at_unix_ms,omitempty"`
	FinishedAtUnixMs int64                      `json:"finished_at_unix_ms,omitempty"`
	UpdatedAtUnixMs  int64                      `json:"updated_at_unix_ms"`
}

type OperationProgress

type OperationProgress struct {
	Phase           string `json:"phase"`
	DownloadedBytes int64  `json:"downloaded_bytes,omitempty"`
	TotalBytes      int64  `json:"total_bytes,omitempty"`
	CompletedLayers int64  `json:"completed_layers,omitempty"`
	TotalLayers     int64  `json:"total_layers,omitempty"`
}

type OperationState

type OperationState string
const (
	OperationQueued      OperationState = "queued"
	OperationRunning     OperationState = "running"
	OperationSucceeded   OperationState = "succeeded"
	OperationFailed      OperationState = "failed"
	OperationCanceling   OperationState = "canceling"
	OperationCanceled    OperationState = "canceled"
	OperationInterrupted OperationState = "interrupted"
)

func (OperationState) Terminal

func (s OperationState) Terminal() bool

type Options

type Options struct {
	DatabasePath        string
	Engine              *containerengine.Adapter
	ResolveManagedOwner ManagedOwnerResolver
}

type Preflight

type Preflight struct {
	Method           containerengine.Method       `json:"method"`
	Engine           containerengine.Engine       `json:"engine"`
	EndpointID       containerengine.EndpointID   `json:"endpoint_id,omitempty"`
	ResourceKind     ResourceKind                 `json:"resource_kind"`
	ResourceIdentity string                       `json:"resource_identity"`
	RequestHash      string                       `json:"request_hash"`
	PlanHash         string                       `json:"plan_hash"`
	Plan             containerengine.ResourcePlan `json:"plan"`
	Management       Management                   `json:"management"`
}

type PreflightRequest

type PreflightRequest struct {
	Method  containerengine.Method `json:"method"`
	Request json.RawMessage        `json:"request"`
}

type ResourceKind

type ResourceKind string
const (
	ResourceContainer        ResourceKind = "container"
	ResourceImage            ResourceKind = "image"
	ResourceVolume           ResourceKind = "volume"
	ResourceComposeProject   ResourceKind = "compose_project"
	ResourcePod              ResourceKind = "pod"
	ResourceContainerService ResourceKind = "container_service"
)

type Service

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

func Open

func Open(options Options) (*Service, error)

func (*Service) CancelOperation

func (s *Service) CancelOperation(ctx context.Context, operationID string) (Operation, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) ComposeProjectDefinition

func (s *Service) ComposeProjectDefinition(ctx context.Context, projectID string) (ComposeProjectDefinition, error)

func (*Service) ContainerServiceConfiguration

func (s *Service) ContainerServiceConfiguration(ctx context.Context, serviceID string) (containerengine.ContainerServiceConfiguration, error)

func (*Service) ContainerServices

func (*Service) Containers

func (*Service) CreateComposeProjectDefinition

func (s *Service) CreateComposeProjectDefinition(ctx context.Context, input ComposeProjectDefinitionInput) (ComposeProjectDefinition, error)

func (*Service) CreateOperation

func (s *Service) CreateOperation(ctx context.Context, req CreateOperationRequest) (Operation, error)

func (*Service) DeleteComposeProjectDefinition

func (s *Service) DeleteComposeProjectDefinition(ctx context.Context, projectID string) error

func (*Service) Events

func (s *Service) Events(ctx context.Context, operationID string, afterSequence int64) ([]Event, error)

func (*Service) FollowLogs

func (*Service) Operation

func (s *Service) Operation(ctx context.Context, operationID string) (Operation, error)

func (*Service) Operations

func (s *Service) Operations(ctx context.Context, limit int) ([]Operation, error)

func (*Service) Pod

func (*Service) Pods

func (*Service) Preflight

func (s *Service) Preflight(ctx context.Context, req PreflightRequest) (Preflight, error)

func (*Service) RawContainerInspect

func (s *Service) RawContainerInspect(ctx context.Context, req containerengine.ContainerInspectRequest) (json.RawMessage, error)

func (*Service) Runtimes

func (*Service) Subscribe

func (s *Service) Subscribe(ctx context.Context, operationID string, afterSequence int64) ([]Event, <-chan Event, error)

func (*Service) UpdateComposeProjectDefinition

func (s *Service) UpdateComposeProjectDefinition(ctx context.Context, projectID string, input ComposeProjectDefinitionInput) (ComposeProjectDefinition, error)

func (*Service) Volume

func (*Service) Volumes

type VolumeItem

type VolumeItem struct {
	containerengine.VolumeRecord
	Management         Management `json:"management"`
	ReferencesComplete bool       `json:"references_complete"`
}

Jump to

Keyboard shortcuts

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