Help us shape the future of Go! Take the 2026 Go Developer Survey

bstore_world

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BlockStoreStatePrefix is the prefix applied to local bstore IDs.
	BlockStoreStatePrefix = "bstore/"

	// BlockStoreStateTypeID is the type identifier for a BlockStoreState.
	//
	// The object contents is a BlockStoreStateInfo message.
	BlockStoreStateTypeID = "bstore/state"
)

Variables

View Source
var UpdateBlockStoreStateOpId = BlockStoreStateTypeID + "/update"

UpdateBlockStoreStateOpId is the operation to update information about a block store.

Functions

func ListBlockStoreStates

func ListBlockStoreStates(ctx context.Context, w world.WorldState) ([]string, error)

ListBlockStoreStates returns all BlockStoreState objects in the world by object key. returns nil, nil if not found.

func NewBlockStoreStateBlock

func NewBlockStoreStateBlock() block.Block

NewBlockStoreStateBlock constructs a new BlockStoreState block.

func NewBlockStoreStateKey

func NewBlockStoreStateKey(providerID, providerAccID, bstoreID string) string

NewBlockStoreStateKey builds a key from a local bstore id.

Types

type BlockStoreState

type BlockStoreState struct {

	// Ref is the block store ref on the provider.
	Ref *bstore.BlockStoreRef `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
	// contains filtered or unexported fields
}

BlockStoreState contains a BlockStore reference.

func CollectBlockStoreStates

func CollectBlockStoreStates(ctx context.Context, w world.WorldState) ([]*BlockStoreState, []string, error)

CollectBlockStoreStates collects all local bstore objects in the world.

func LookupBlockStoreState

func LookupBlockStoreState(ctx context.Context, w world.WorldState, objKey string) (*BlockStoreState, world.ObjectState, error)

LookupBlockStoreState looks up a local bstore object with the given object key. returns nil, nil, ErrObjectNotFound if not found.

func UnmarshalBlockStoreState

func UnmarshalBlockStoreState(ctx context.Context, bcs *block.Cursor) (*BlockStoreState, error)

UnmarshalBlockStoreState unmarshals a BlockStoreState from a block cursor.

func (*BlockStoreState) CloneMessageVT

func (m *BlockStoreState) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*BlockStoreState) CloneVT

func (m *BlockStoreState) CloneVT() *BlockStoreState

func (*BlockStoreState) EqualMessageVT

func (this *BlockStoreState) EqualMessageVT(thatMsg any) bool

func (*BlockStoreState) EqualVT

func (this *BlockStoreState) EqualVT(that *BlockStoreState) bool

func (*BlockStoreState) GetRef

func (x *BlockStoreState) GetRef() *bstore.BlockStoreRef

func (*BlockStoreState) MarshalBlock

func (i *BlockStoreState) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*BlockStoreState) MarshalJSON

func (x *BlockStoreState) MarshalJSON() ([]byte, error)

MarshalJSON marshals the BlockStoreState to JSON.

func (*BlockStoreState) MarshalProtoJSON

func (x *BlockStoreState) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the BlockStoreState message to JSON.

func (*BlockStoreState) MarshalProtoText

func (x *BlockStoreState) MarshalProtoText() string

func (*BlockStoreState) MarshalToSizedBufferVT

func (m *BlockStoreState) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*BlockStoreState) MarshalToVT

func (m *BlockStoreState) MarshalToVT(dAtA []byte) (int, error)

func (*BlockStoreState) MarshalVT

func (m *BlockStoreState) MarshalVT() (dAtA []byte, err error)

func (*BlockStoreState) ProtoMessage

func (*BlockStoreState) ProtoMessage()

func (*BlockStoreState) Reset

func (x *BlockStoreState) Reset()

func (*BlockStoreState) SizeVT

func (m *BlockStoreState) SizeVT() (n int)

func (*BlockStoreState) String

func (x *BlockStoreState) String() string

func (*BlockStoreState) UnmarshalBlock

func (i *BlockStoreState) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*BlockStoreState) UnmarshalJSON

func (x *BlockStoreState) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the BlockStoreState from JSON.

func (*BlockStoreState) UnmarshalProtoJSON

func (x *BlockStoreState) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the BlockStoreState message from JSON.

func (*BlockStoreState) UnmarshalVT

func (m *BlockStoreState) UnmarshalVT(dAtA []byte) error

func (*BlockStoreState) Validate

func (i *BlockStoreState) Validate() error

Validate validates the BlockStoreState.

type UpdateBlockStoreStateOp

type UpdateBlockStoreStateOp struct {

	// UpdatedState is the updated local block store state.
	// The object key is derived from the block store ref.
	UpdatedState *BlockStoreState `protobuf:"bytes,1,opt,name=updated_state,json=updatedState,proto3" json:"updatedState,omitempty"`
	// IfNotExists prevents overwriting an existing state if it exists.
	IfNotExists bool `protobuf:"varint,2,opt,name=if_not_exists,json=ifNotExists,proto3" json:"ifNotExists,omitempty"`
	// contains filtered or unexported fields
}

UpdateBlockStoreStateOp is an world operation to update a BlockStoreState.

func NewUpdateBlockStoreStateOp

func NewUpdateBlockStoreStateOp(updatedState *BlockStoreState, ifNotExists bool) *UpdateBlockStoreStateOp

NewUpdateBlockStoreStateOp constructs a new UpdateBlockStoreStateOp block.

func (*UpdateBlockStoreStateOp) ApplyWorldObjectOp

func (o *UpdateBlockStoreStateOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*UpdateBlockStoreStateOp) ApplyWorldOp

func (o *UpdateBlockStoreStateOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*UpdateBlockStoreStateOp) CloneMessageVT

func (*UpdateBlockStoreStateOp) CloneVT

func (*UpdateBlockStoreStateOp) EqualMessageVT

func (this *UpdateBlockStoreStateOp) EqualMessageVT(thatMsg any) bool

func (*UpdateBlockStoreStateOp) EqualVT

func (*UpdateBlockStoreStateOp) GetIfNotExists

func (x *UpdateBlockStoreStateOp) GetIfNotExists() bool

func (*UpdateBlockStoreStateOp) GetOperationTypeId

func (o *UpdateBlockStoreStateOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*UpdateBlockStoreStateOp) GetUpdatedState

func (x *UpdateBlockStoreStateOp) GetUpdatedState() *BlockStoreState

func (*UpdateBlockStoreStateOp) MarshalBlock

func (o *UpdateBlockStoreStateOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*UpdateBlockStoreStateOp) MarshalJSON

func (x *UpdateBlockStoreStateOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the UpdateBlockStoreStateOp to JSON.

func (*UpdateBlockStoreStateOp) MarshalProtoJSON

func (x *UpdateBlockStoreStateOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the UpdateBlockStoreStateOp message to JSON.

func (*UpdateBlockStoreStateOp) MarshalProtoText

func (x *UpdateBlockStoreStateOp) MarshalProtoText() string

func (*UpdateBlockStoreStateOp) MarshalToSizedBufferVT

func (m *UpdateBlockStoreStateOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*UpdateBlockStoreStateOp) MarshalToVT

func (m *UpdateBlockStoreStateOp) MarshalToVT(dAtA []byte) (int, error)

func (*UpdateBlockStoreStateOp) MarshalVT

func (m *UpdateBlockStoreStateOp) MarshalVT() (dAtA []byte, err error)

func (*UpdateBlockStoreStateOp) ProtoMessage

func (*UpdateBlockStoreStateOp) ProtoMessage()

func (*UpdateBlockStoreStateOp) Reset

func (x *UpdateBlockStoreStateOp) Reset()

func (*UpdateBlockStoreStateOp) SizeVT

func (m *UpdateBlockStoreStateOp) SizeVT() (n int)

func (*UpdateBlockStoreStateOp) String

func (x *UpdateBlockStoreStateOp) String() string

func (*UpdateBlockStoreStateOp) UnmarshalBlock

func (o *UpdateBlockStoreStateOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*UpdateBlockStoreStateOp) UnmarshalJSON

func (x *UpdateBlockStoreStateOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the UpdateBlockStoreStateOp from JSON.

func (*UpdateBlockStoreStateOp) UnmarshalProtoJSON

func (x *UpdateBlockStoreStateOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the UpdateBlockStoreStateOp message from JSON.

func (*UpdateBlockStoreStateOp) UnmarshalVT

func (m *UpdateBlockStoreStateOp) UnmarshalVT(dAtA []byte) error

func (*UpdateBlockStoreStateOp) Validate

func (o *UpdateBlockStoreStateOp) Validate() error

Validate performs cursory validation of the operation. Should not block.

Jump to

Keyboard shortcuts

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