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

bstore

package
v0.57.13 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlockStoreParticipantRole_name = map[int32]string{
		0: "BlockStoreParticipantRole_UNKNOWN",
		1: "BlockStoreParticipantRole_READER",
		2: "BlockStoreParticipantRole_WRITER",
		3: "BlockStoreParticipantRole_OWNER",
	}
	BlockStoreParticipantRole_value = map[string]int32{
		"BlockStoreParticipantRole_UNKNOWN": 0,
		"BlockStoreParticipantRole_READER":  1,
		"BlockStoreParticipantRole_WRITER":  2,
		"BlockStoreParticipantRole_OWNER":   3,
	}
)

Enum value maps for BlockStoreParticipantRole.

View Source
var (
	// ErrInvalidBlockStoreParticipantRole is returned if the block store participant role is invalid.
	ErrInvalidBlockStoreParticipantRole = errors.New("invalid block store participant role")

	// ErrEmptyBlockStoreID is returned if the block store id was empty.
	ErrEmptyBlockStoreID = errors.New("block store id cannot be empty")

	// ErrBlockStoreExists is returned if the block store already exists.
	ErrBlockStoreExists = errors.New("block store with that id already exists")
)

Functions

func ValidateBlockStoreParticipantRole

func ValidateBlockStoreParticipantRole(role BlockStoreParticipantRole, allowUnknown bool) error

ValidateBlockStoreParticipantRole ensures the enum value is within the expected set. If allowUnknown is true, it will allow BlockStoreParticipantRole_UNKNOWN as a valid role.

Types

type BlockStore

type BlockStore interface {
	// Store is the block store interface.
	block_store.Store
	// GetDecodedBlockCache returns the lifecycle-owned decoded-block cache.
	GetDecodedBlockCache() *block.DecodedBlockCache
}

BlockStore is the block store handle interface.

func ExMountBlockStore

func ExMountBlockStore(
	ctx context.Context,
	b bus.Bus,
	ref *BlockStoreRef,
	returnIfIdle bool,
	valDisposeCb func(),
) (BlockStore, directive.Reference, error)

ExMountBlockStore executes a lookup for a single provider on the bus.

If returnIfIdle is set, returns when the directive becomes idle.

type BlockStoreParticipantRole

type BlockStoreParticipantRole int32

BlockStoreParticipantRole defines the general role of a shared object participant. In order of least permissive to most permissive.

const (
	// BlockStoreParticipantRole_UNKNOWN is the zero / invalid / unknown type.
	BlockStoreParticipantRole_BlockStoreParticipantRole_UNKNOWN BlockStoreParticipantRole = 0
	// BlockStoreParticipantRole_READER can read values from the block store only.
	BlockStoreParticipantRole_BlockStoreParticipantRole_READER BlockStoreParticipantRole = 1
	// BlockStoreParticipantRole_WRITER can read and write but not delete values.
	BlockStoreParticipantRole_BlockStoreParticipantRole_WRITER BlockStoreParticipantRole = 2
	// BlockStoreParticipantRole_OWNER can read and write and delete values.
	BlockStoreParticipantRole_BlockStoreParticipantRole_OWNER BlockStoreParticipantRole = 3
)

func (BlockStoreParticipantRole) Enum

func (BlockStoreParticipantRole) MarshalJSON

func (x BlockStoreParticipantRole) MarshalJSON() ([]byte, error)

MarshalJSON marshals the BlockStoreParticipantRole to JSON.

func (BlockStoreParticipantRole) MarshalProtoJSON

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

MarshalProtoJSON marshals the BlockStoreParticipantRole to JSON.

func (BlockStoreParticipantRole) MarshalProtoText

func (x BlockStoreParticipantRole) MarshalProtoText() string

func (BlockStoreParticipantRole) MarshalText

func (x BlockStoreParticipantRole) MarshalText() ([]byte, error)

MarshalText marshals the BlockStoreParticipantRole to text.

func (BlockStoreParticipantRole) String

func (x BlockStoreParticipantRole) String() string

func (*BlockStoreParticipantRole) UnmarshalJSON

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

UnmarshalJSON unmarshals the BlockStoreParticipantRole from JSON.

func (*BlockStoreParticipantRole) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the BlockStoreParticipantRole from JSON.

func (*BlockStoreParticipantRole) UnmarshalText

func (x *BlockStoreParticipantRole) UnmarshalText(b []byte) error

UnmarshalText unmarshals the BlockStoreParticipantRole from text.

type BlockStoreProvider

type BlockStoreProvider interface {
	provider.ProviderAccountFeature

	// CreateBlockStore creates a new block store with the given details.
	CreateBlockStore(ctx context.Context, id string) (*BlockStoreRef, error)

	// MountBlockStore attempts to mount a BlockStore returning the object handle and a release function.
	//
	// note: use the MountBlockStore directive to call this.
	// usually called by the provider controller
	MountBlockStore(ctx context.Context, ref *BlockStoreRef, released func()) (BlockStore, func(), error)
}

BlockStoreProvider implements ProviderFeature_BLOCK_STORE.

func GetBlockStoreProviderAccountFeature

func GetBlockStoreProviderAccountFeature(ctx context.Context, provAcc provider.ProviderAccount) (BlockStoreProvider, error)

GetBlockStoreProviderAccountFeature returns the BlockStoreProvider for a ProviderAccount.

type BlockStoreRef

type BlockStoreRef struct {

	// ProviderResourceRef is the reference to the resource on the provider.
	ProviderResourceRef *provider.ProviderResourceRef `protobuf:"bytes,1,opt,name=provider_resource_ref,json=providerResourceRef,proto3" json:"providerResourceRef,omitempty"`
	// contains filtered or unexported fields
}

BlockStoreRef is a reference to a shared object stored on a provider.

func (*BlockStoreRef) CloneMessageVT

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

func (*BlockStoreRef) CloneVT

func (m *BlockStoreRef) CloneVT() *BlockStoreRef

func (*BlockStoreRef) EqualMessageVT

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

func (*BlockStoreRef) EqualVT

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

func (*BlockStoreRef) GetLogger

func (r *BlockStoreRef) GetLogger(le *logrus.Entry) *logrus.Entry

GetLogger adds debug values to the logger.

func (*BlockStoreRef) GetProviderResourceRef

func (x *BlockStoreRef) GetProviderResourceRef() *provider.ProviderResourceRef

func (*BlockStoreRef) MarshalJSON

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

MarshalJSON marshals the BlockStoreRef to JSON.

func (*BlockStoreRef) MarshalProtoJSON

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

MarshalProtoJSON marshals the BlockStoreRef message to JSON.

func (*BlockStoreRef) MarshalProtoText

func (x *BlockStoreRef) MarshalProtoText() string

func (*BlockStoreRef) MarshalToSizedBufferVT

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

func (*BlockStoreRef) MarshalToVT

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

func (*BlockStoreRef) MarshalVT

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

func (*BlockStoreRef) ProtoMessage

func (*BlockStoreRef) ProtoMessage()

func (*BlockStoreRef) Reset

func (x *BlockStoreRef) Reset()

func (*BlockStoreRef) SizeVT

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

func (*BlockStoreRef) String

func (x *BlockStoreRef) String() string

func (*BlockStoreRef) UnmarshalJSON

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

UnmarshalJSON unmarshals the BlockStoreRef from JSON.

func (*BlockStoreRef) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the BlockStoreRef message from JSON.

func (*BlockStoreRef) UnmarshalVT

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

func (*BlockStoreRef) Validate

func (r *BlockStoreRef) Validate() error

Validate validates the block store ref.

type MountBlockStore

type MountBlockStore interface {
	// Directive indicates MountBlockStore is a directive.
	directive.Directive

	// MountBlockStoreRef returns the block store ref to mount.
	MountBlockStoreRef() *BlockStoreRef
}

MountBlockStore is a directive to mount a block store with a provider account.

func NewMountBlockStore

func NewMountBlockStore(ref *BlockStoreRef) MountBlockStore

NewMountBlockStore constructs a new MountBlockStore directive.

type MountBlockStoreValue

type MountBlockStoreValue = BlockStore

MountBlockStoreValue is the result type for MountBlockStore.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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