Versions in this module Expand all Collapse all v1 v1.1.0 Jul 9, 2026 Changes in this version + var ErrDeploymentConflict = fmt.Errorf("conflict") + var ErrDeploymentExists = fmt.Errorf("exists") + var ErrDeploymentNotExists = fmt.Errorf("deployment does not exist") + var ErrDeploymentUpgradeValidationError = fmt.Errorf("upgrade validation error") + var ErrInvalidVersion = fmt.Errorf("invalid version") + var ErrNoActionNeeded = fmt.Errorf("no action needed") + var ErrWorkloadExists = fmt.Errorf("exists") + var ErrWorkloadNotExist = fmt.Errorf("workload does not exist") + var ResourceUnitsCRU = ResourceUnits("CRU") + var ResourceUnitsHRU = ResourceUnits("HRU") + var ResourceUnitsMRU = ResourceUnits("MRU") + var ResourceUnitsSRU = ResourceUnits("SRU") + func GetContract(ctx context.Context) substrate.NodeContract + func GetDeployment(ctx context.Context) (gridtypes.Deployment, error) + func GetDeploymentID(ctx context.Context) (twin uint32, deployment uint64) + func GetWorkload(ctx context.Context, name gridtypes.Name) (gridtypes.WorkloadWithID, error) + func IsRentedNode(ctx context.Context) bool + type Callback func(twin uint32, contract uint64, delete bool) + type DescriptionField struct + Description string + type Engine interface + Admins func() Twins + Deprovision func(ctx context.Context, twin uint32, id uint64, reason string) error + Pause func(ctx context.Context, twin uint32, id uint64) error + Provision func(ctx context.Context, wl gridtypes.Deployment) error + Resume func(ctx context.Context, twin uint32, id uint64) error + Storage func() Storage + Twins func() Twins + Update func(ctx context.Context, update gridtypes.Deployment) error + func GetEngine(ctx context.Context) Engine + type EngineOption interface + func WithAPIGateway(node uint32, substrateGateway *stubs.SubstrateGatewayStub) EngineOption + func WithAdmins(g Twins) EngineOption + func WithCallback(cb Callback) EngineOption + func WithRerunAll(t bool) EngineOption + func WithStartupOrder(t ...gridtypes.WorkloadType) EngineOption + func WithTwins(g Twins) EngineOption + type Exclude = func(dl *gridtypes.Deployment, wl *gridtypes.Workload) bool + type Field interface + type Initializer interface + Initialize func(ctx context.Context) error + type Janitor interface + Cleanup func(ctx context.Context) error + type Manager interface + Deprovision func(ctx context.Context, wl *gridtypes.WorkloadWithID) error + Provision func(ctx context.Context, wl *gridtypes.WorkloadWithID) (interface{}, error) + type MetadataField struct + Metadata string + type NativeEngine struct + func New(storage Storage, provisioner Provisioner, root string, opts ...EngineOption) (*NativeEngine, error) + func (e *NativeEngine) Admins() Twins + func (e *NativeEngine) DecommissionCached(id string, reason string) error + func (e *NativeEngine) Deprovision(ctx context.Context, twin uint32, id uint64, reason string) error + func (e *NativeEngine) GetWorkloadStatus(id string) (gridtypes.ResultState, bool, error) + func (e *NativeEngine) Pause(ctx context.Context, twin uint32, id uint64) error + func (e *NativeEngine) Provision(ctx context.Context, deployment gridtypes.Deployment) error + func (e *NativeEngine) Resume(ctx context.Context, twin uint32, id uint64) error + func (e *NativeEngine) Run(root context.Context) error + func (e *NativeEngine) Storage() Storage + func (e *NativeEngine) Twins() Twins + func (e *NativeEngine) Update(ctx context.Context, update gridtypes.Deployment) error + func (n *NativeEngine) Changes(twin uint32, contractID uint64) ([]gridtypes.Workload, error) + func (n *NativeEngine) CreateOrUpdate(twin uint32, deployment gridtypes.Deployment, update bool) error + func (n *NativeEngine) Get(twin uint32, contractID uint64) (gridtypes.Deployment, error) + func (n *NativeEngine) List(twin uint32) ([]gridtypes.Deployment, error) + func (n *NativeEngine) ListPrivateIPs(twin uint32, network gridtypes.Name) ([]string, error) + func (n *NativeEngine) ListPublicIPs() ([]string, error) + func (n *NativeEngine) ListTwins() ([]uint32, error) + type Pauser interface + Pause func(ctx context.Context, wl *gridtypes.WorkloadWithID) error + Resume func(ctx context.Context, wl *gridtypes.WorkloadWithID) error + type Provisioner interface + CanUpdate func(ctx context.Context, typ gridtypes.WorkloadType) bool + Deprovision func(ctx context.Context, wl *gridtypes.WorkloadWithID) error + Initialize func(ctx context.Context) error + Pause func(ctx context.Context, wl *gridtypes.WorkloadWithID) (gridtypes.Result, error) + Provision func(ctx context.Context, wl *gridtypes.WorkloadWithID) (gridtypes.Result, error) + Resume func(ctx context.Context, wl *gridtypes.WorkloadWithID) (gridtypes.Result, error) + Update func(ctx context.Context, wl *gridtypes.WorkloadWithID) (gridtypes.Result, error) + func NewMapProvisioner(managers map[gridtypes.WorkloadType]Manager) Provisioner + type ResourceUnits string + type Response interface + func Ok() Response + func Paused() Response + func UnChanged(cause error) Response + type SignatureRequirementField struct + SignatureRequirement gridtypes.SignatureRequirement + type Storage interface + Add func(twin uint32, deployment uint64, workload gridtypes.Workload) error + ByTwin func(twin uint32) ([]uint64, error) + Capacity func(exclude ...Exclude) (StorageCapacity, error) + Changes func(twin uint32, deployment uint64) (changes []gridtypes.Workload, err error) + Create func(deployment gridtypes.Deployment) error + Current func(twin uint32, deployment uint64, name gridtypes.Name) (gridtypes.Workload, error) + Delete func(twin uint32, deployment uint64) error + Error func(twin uint32, deployment uint64, err error) error + Get func(twin uint32, deployment uint64) (gridtypes.Deployment, error) + Remove func(twin uint32, deployment uint64, name gridtypes.Name) error + Transaction func(twin uint32, deployment uint64, workload gridtypes.Workload) error + Twins func() ([]uint32, error) + Update func(twin uint32, deployment uint64, fields ...Field) error + type StorageCapacity struct + Cap gridtypes.Capacity + Deployments []gridtypes.Deployment + LastDeploymentTimestamp gridtypes.Timestamp + Workloads int + type Twins interface + GetKey func(id uint32) ([]byte, error) + func NewSubstrateAdmins(substrateGateway *stubs.SubstrateGatewayStub, farmID uint32) (Twins, error) + func NewSubstrateTwins(substrateGateway *stubs.SubstrateGatewayStub) (Twins, error) + type Updater interface + Update func(ctx context.Context, wl *gridtypes.WorkloadWithID) (interface{}, error) + type VersionField struct + Version uint32