bucket

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBucketIDEmpty is returned if the bucket id was empty.
	ErrBucketIDEmpty = errors.New("bucket id cannot be empty")
	// ErrStoreIDEmpty is returned if the bucket store id was empty.
	ErrStoreIDEmpty = errors.New("bucket store id cannot be empty")
	// ErrRevEmpty is returned if the revision was empty.
	ErrRevEmpty = errors.New("bucket rev cannot be empty")
	// ErrBucketNotFound is returned when the bucket was not found.
	ErrBucketNotFound = errors.New("bucket not found")
)

Functions

func CheckApplyBucketConfigMatchesVolume

func CheckApplyBucketConfigMatchesVolume(dir ApplyBucketConfig, volID string, alias []string) bool

CheckApplyBucketConfigMatchesVolume checks if the directive matches the volume. volID is the primary volume ID. alias is a list of any alias volume IDs for volID.

func MarshalObjectRefJSON

func MarshalObjectRefJSON(ref *ObjectRef) ([]byte, error)

MarshalObjectRefJSON marshals an ObjectRef to JSON.

Returns "{}" if the ref is nil.

func NewObjectRefBlock

func NewObjectRefBlock() block.Block

NewObjectRefBlock constructs a new object ref block.

func NewObjectRefSubBlockCtor

func NewObjectRefSubBlockCtor(r **ObjectRef) block.SubBlockCtor

NewObjectRefSubBlock constructs a new object ref sub-block constructor.

Types

type AccessBucketFunc

type AccessBucketFunc = func(ctx context.Context, released func()) (BucketHandle, func(), error)

AccessBucketFunc is a function to access a BucketHandle. Optionally pass a released function that may be called when the handle was released. Returns a release function.

func NewAccessBucketViaBusFunc

func NewAccessBucketViaBusFunc(b bus.Bus, bucketID, bucketStoreID string, returnIfIdle bool) AccessBucketFunc

NewAccessBucketViaBusFunc builds a new func which accesses the Bucket on the given bus using the AccessBucket directive.

If returnIfIdle is set: ErrBucketNotFound is returned if not found.

type ApplyBucketConfig

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

	// ApplyBucketConfigBucketConf returns the desired bucket config.
	// The configuration with the highest rev will be applied.
	// Cannot be empty.
	ApplyBucketConfigBucketConf() *Config
	// ApplyBucketConfigVolumeIDRe returns the volume ID constraint.
	// Can be empty to select only volumes that already have the bucket.
	// Cannot be specified if VolumeIDList is set.
	ApplyBucketConfigVolumeIDRe() *regexp.Regexp
	// ApplyBucketConfigVolumeIDList returns a specific list of volumes to apply to.
	// If empty, uses the VolumeIDRe field instead.
	// Cannot be specified if VolumeIDRe is set.
	ApplyBucketConfigVolumeIDList() []string
}

ApplyBucketConfig is a directive to apply a bucket configuration.

func NewApplyBucketConfig

func NewApplyBucketConfig(
	bucketConf *Config,
	volumeIDRe *regexp.Regexp,
	volumeIDList []string,
) ApplyBucketConfig

NewApplyBucketConfig constructs an ApplyBucketConfig.

func NewApplyBucketConfigToVolume

func NewApplyBucketConfigToVolume(bucketConf *Config, volumeID string) ApplyBucketConfig

NewApplyBucketConfigToVolume constructs an ApplyBucketConfig with the volume id.

func NewApplyBucketConfigToVolumes

func NewApplyBucketConfigToVolumes(bucketConf *Config, volumeIDs []string) ApplyBucketConfig

NewApplyBucketConfigToVolumes constructs an ApplyBucketConfig with a list of volume ids.

type ApplyBucketConfigResult

type ApplyBucketConfigResult struct {

	// VolumeId is the volume ID for this apply event.
	VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volumeId,omitempty"`
	// BucketId returns the bucket ID for this apply event.
	BucketId string `protobuf:"bytes,2,opt,name=bucket_id,json=bucketId,proto3" json:"bucketId,omitempty"`
	// BucketConf returns the bucket configuration applied.
	BucketConf *Config `protobuf:"bytes,3,opt,name=bucket_conf,json=bucketConf,proto3" json:"bucketConf,omitempty"`
	// OldBucketConf returns the previous bucket configuration.
	OldBucketConf *Config `protobuf:"bytes,4,opt,name=old_bucket_conf,json=oldBucketConf,proto3" json:"oldBucketConf,omitempty"`
	// Timestamp returns the timestamp of the event.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Updated indicates if the value was updated.
	Updated bool `protobuf:"varint,6,opt,name=updated,proto3" json:"updated,omitempty"`
	// Error contains any error applying the value.
	// Note: all other values might be empty if this is set.
	Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

ApplyBucketConfigResult is the result of the ApplyBucketConfig directive.

func (*ApplyBucketConfigResult) CloneMessageVT

func (*ApplyBucketConfigResult) CloneVT

func (*ApplyBucketConfigResult) EqualMessageVT

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

func (*ApplyBucketConfigResult) EqualVT

func (*ApplyBucketConfigResult) GetBucketConf

func (x *ApplyBucketConfigResult) GetBucketConf() *Config

func (*ApplyBucketConfigResult) GetBucketId

func (x *ApplyBucketConfigResult) GetBucketId() string

func (*ApplyBucketConfigResult) GetError

func (x *ApplyBucketConfigResult) GetError() string

func (*ApplyBucketConfigResult) GetOldBucketConf

func (x *ApplyBucketConfigResult) GetOldBucketConf() *Config

func (*ApplyBucketConfigResult) GetTimestamp

func (x *ApplyBucketConfigResult) GetTimestamp() *timestamppb.Timestamp

func (*ApplyBucketConfigResult) GetUpdated

func (x *ApplyBucketConfigResult) GetUpdated() bool

func (*ApplyBucketConfigResult) GetVolumeId

func (x *ApplyBucketConfigResult) GetVolumeId() string

func (*ApplyBucketConfigResult) MarshalJSON

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

MarshalJSON marshals the ApplyBucketConfigResult to JSON.

func (*ApplyBucketConfigResult) MarshalProtoJSON

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

MarshalProtoJSON marshals the ApplyBucketConfigResult message to JSON.

func (*ApplyBucketConfigResult) MarshalProtoText

func (x *ApplyBucketConfigResult) MarshalProtoText() string

func (*ApplyBucketConfigResult) MarshalToSizedBufferVT

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

func (*ApplyBucketConfigResult) MarshalToVT

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

func (*ApplyBucketConfigResult) MarshalVT

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

func (*ApplyBucketConfigResult) ProtoMessage

func (*ApplyBucketConfigResult) ProtoMessage()

func (*ApplyBucketConfigResult) Reset

func (x *ApplyBucketConfigResult) Reset()

func (*ApplyBucketConfigResult) SizeVT

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

func (*ApplyBucketConfigResult) String

func (x *ApplyBucketConfigResult) String() string

func (*ApplyBucketConfigResult) UnmarshalJSON

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

UnmarshalJSON unmarshals the ApplyBucketConfigResult from JSON.

func (*ApplyBucketConfigResult) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the ApplyBucketConfigResult message from JSON.

func (*ApplyBucketConfigResult) UnmarshalVT

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

type ApplyBucketConfigValue

type ApplyBucketConfigValue = *ApplyBucketConfigResult

ApplyBucketConfigValue is the result type for ApplyBucketConfig.

func ExApplyBucketConfig

func ExApplyBucketConfig(ctx context.Context, b bus.Bus, apply ApplyBucketConfig) (ApplyBucketConfigValue, error)

ExApplyBucketConfig executes applying a bucket config directive.

type Bucket

type Bucket interface {
	// BucketOps indicates Bucket implements the bucket operations.
	BucketOps
	// GetBucketConfig returns a copy of the bucket configuration.
	GetBucketConfig() *Config
}

Bucket is a bucket API handle. All calls use the bucket handle context.

func NewBucketRW

func NewBucketRW(readHandle Bucket, writeHandle BucketOps) Bucket

NewBucketRW constructs a new Bucket handle using a read handle and an optional write handle. If the write handle is not nil, the write (put and delete) calls will go to it. Otherwise, all calls are sent to the read handle.

type BucketHandle

type BucketHandle interface {
	// GetID returns the bucket ID.
	GetID() string
	// GetExists returns if the bucket exists. If false, the bucket does not
	// exist in the store, and all block calls will not work.
	GetExists() bool
	// GetBucketConfig returns the bucket configuration in use.
	// May be nil if the bucket does not exist in the store.
	GetBucketConfig() *Config
	// GetBucket returns the bucket object.
	// May be nil if the bucket does not exist in the store.
	GetBucket() Bucket
}

BucketHandle is a bucket API handle. All calls use the bucket handle context.

func NewBucketHandle

func NewBucketHandle(bucketID string, bkt Bucket) BucketHandle

NewBucketHandle constructs a new bucket handle.

type BucketInfo

type BucketInfo struct {

	// Config contains the current latest bucket configuration.
	Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

BucketInfo is general information about a bucket.

func NewBucketInfo

func NewBucketInfo(conf *Config) *BucketInfo

NewBucketInfo constructs a new bucket info with required fields.

func (*BucketInfo) CloneMessageVT

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

func (*BucketInfo) CloneVT

func (m *BucketInfo) CloneVT() *BucketInfo

func (*BucketInfo) EqualMessageVT

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

func (*BucketInfo) EqualVT

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

func (*BucketInfo) GetConfig

func (x *BucketInfo) GetConfig() *Config

func (*BucketInfo) MarshalJSON

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

MarshalJSON marshals the BucketInfo to JSON.

func (*BucketInfo) MarshalProtoJSON

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

MarshalProtoJSON marshals the BucketInfo message to JSON.

func (*BucketInfo) MarshalProtoText

func (x *BucketInfo) MarshalProtoText() string

func (*BucketInfo) MarshalToSizedBufferVT

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

func (*BucketInfo) MarshalToVT

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

func (*BucketInfo) MarshalVT

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

func (*BucketInfo) ProtoMessage

func (*BucketInfo) ProtoMessage()

func (*BucketInfo) Reset

func (x *BucketInfo) Reset()

func (*BucketInfo) SizeVT

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

func (*BucketInfo) String

func (x *BucketInfo) String() string

func (*BucketInfo) UnmarshalJSON

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

UnmarshalJSON unmarshals the BucketInfo from JSON.

func (*BucketInfo) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the BucketInfo message from JSON.

func (*BucketInfo) UnmarshalVT

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

type BucketOpArgs

type BucketOpArgs struct {

	// BucketId is the bucket ID to operate on.
	BucketId string `protobuf:"bytes,1,opt,name=bucket_id,json=bucketId,proto3" json:"bucketId,omitempty"`
	// VolumeId is the volume ID to operate on.
	// If empty, will use the lookup controller.
	VolumeId string `protobuf:"bytes,2,opt,name=volume_id,json=volumeId,proto3" json:"volumeId,omitempty"`
	// contains filtered or unexported fields
}

BucketOpArgs are common arguments for a bucket operation.

func (*BucketOpArgs) CloneMessageVT

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

func (*BucketOpArgs) CloneVT

func (m *BucketOpArgs) CloneVT() *BucketOpArgs

func (*BucketOpArgs) EqualMessageVT

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

func (*BucketOpArgs) EqualVT

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

func (*BucketOpArgs) GetBucketId

func (x *BucketOpArgs) GetBucketId() string

func (*BucketOpArgs) GetVolumeId

func (x *BucketOpArgs) GetVolumeId() string

func (*BucketOpArgs) MarshalJSON

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

MarshalJSON marshals the BucketOpArgs to JSON.

func (*BucketOpArgs) MarshalProtoJSON

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

MarshalProtoJSON marshals the BucketOpArgs message to JSON.

func (*BucketOpArgs) MarshalProtoText

func (x *BucketOpArgs) MarshalProtoText() string

func (*BucketOpArgs) MarshalToSizedBufferVT

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

func (*BucketOpArgs) MarshalToVT

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

func (*BucketOpArgs) MarshalVT

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

func (*BucketOpArgs) ProtoMessage

func (*BucketOpArgs) ProtoMessage()

func (*BucketOpArgs) Reset

func (x *BucketOpArgs) Reset()

func (*BucketOpArgs) SizeVT

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

func (*BucketOpArgs) String

func (x *BucketOpArgs) String() string

func (*BucketOpArgs) UnmarshalJSON

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

UnmarshalJSON unmarshals the BucketOpArgs from JSON.

func (*BucketOpArgs) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the BucketOpArgs message from JSON.

func (*BucketOpArgs) UnmarshalVT

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

func (*BucketOpArgs) Validate

func (r *BucketOpArgs) Validate() error

Validate validates the op arguments.

type BucketOps

type BucketOps interface {
	// Store implements the block store.
	block.StoreOps
}

BucketOps are operations against a bucket API handle. All calls use the bucket handle context.

type BuildBucketAPI

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

	// BuildBucketAPIBucketID returns the bucket ID constraint.
	// Cannot be empty.
	BuildBucketAPIBucketID() string
	// BuildBucketAPIStoreID returns the store ID constraint.
	// The ID can be either a bucket store ID or a volume ID.
	// Cannot be empty.
	BuildBucketAPIStoreID() string
}

BuildBucketAPI is a directive to get an API handle for a storage bucket.

func NewBuildBucketAPI

func NewBuildBucketAPI(bucketID, storeID string) BuildBucketAPI

NewBuildBucketAPI constructs a new BuildBucketAPI directive.

type BuildBucketAPIValue

type BuildBucketAPIValue = BucketHandle

BuildBucketAPIValue is the result type for BuildBucketAPI. The value is removed and replaced when any values change.

func ExBuildBucketAPI

func ExBuildBucketAPI(
	ctx context.Context,
	b bus.Bus,
	returnIfIdle bool,
	bucketID, bucketStoreID string,
	valDisposeCb func(),
) (BuildBucketAPIValue, directive.Instance, directive.Reference, error)

ExBuildBucketAPI executes the BuildBucketAPI directive.

type Config

type Config struct {

	// Id is the bucket identifier.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Rev is the configuration rev.
	// increment by 1 on modification
	Rev uint32 `protobuf:"varint,2,opt,name=rev,proto3" json:"rev,omitempty"`
	// PutOpts are the default put options for the bucket.
	PutOpts *block.PutOpts `protobuf:"bytes,4,opt,name=put_opts,json=putOpts,proto3" json:"putOpts,omitempty"`
	// Lookup controls the lookup confiuration.
	Lookup *LookupConfig `protobuf:"bytes,5,opt,name=lookup,proto3" json:"lookup,omitempty"` // TODO: block size limit?
	// contains filtered or unexported fields
}

Config is a bucket configuration object.

func NewConfig

func NewConfig(
	id string,
	rev uint32,
	lkConfig *LookupConfig,
) (*Config, error)

NewConfig constructs a new bucket config.

func (*Config) CloneMessageVT

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

func (*Config) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

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

func (*Config) EqualVT

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

func (*Config) GetId

func (x *Config) GetId() string

func (*Config) GetLookup

func (x *Config) GetLookup() *LookupConfig

func (*Config) GetPutOpts

func (x *Config) GetPutOpts() *block.PutOpts

func (*Config) GetRev

func (x *Config) GetRev() uint32

func (*Config) MarshalJSON

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

MarshalJSON marshals the Config to JSON.

func (*Config) MarshalProtoJSON

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

MarshalProtoJSON marshals the Config message to JSON.

func (*Config) MarshalProtoText

func (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

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

func (*Config) MarshalToVT

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

func (*Config) MarshalVT

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

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

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

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalJSON

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

UnmarshalJSON unmarshals the Config from JSON.

func (*Config) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the Config message from JSON.

func (*Config) UnmarshalVT

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

func (*Config) Validate

func (c *Config) Validate() error

Validate does cursory validation of the config.

type LookupConfig

type LookupConfig struct {

	// Disble indicates we should not service cross-volume calls against this
	// bucket.
	Disable bool `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"`
	// Controller contains the lookup controller configuration.
	// If unset, will default to the node-default lookup controller.
	// If disabled, this field will be ignored.
	Controller *proto.ControllerConfig `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
	// contains filtered or unexported fields
}

LookupConfig configures the bucket behavior across multiple volumes.

func NewLookupConfig

func NewLookupConfig(conf configset.ControllerConfig) (*LookupConfig, error)

NewLookupConfig constructs a new LookupConfig with a config object.

If the config is nil sets Disable: true.

func (*LookupConfig) CloneMessageVT

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

func (*LookupConfig) CloneVT

func (m *LookupConfig) CloneVT() *LookupConfig

func (*LookupConfig) EqualMessageVT

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

func (*LookupConfig) EqualVT

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

func (*LookupConfig) GetController

func (x *LookupConfig) GetController() *proto.ControllerConfig

func (*LookupConfig) GetDisable

func (x *LookupConfig) GetDisable() bool

func (*LookupConfig) MarshalJSON

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

MarshalJSON marshals the LookupConfig to JSON.

func (*LookupConfig) MarshalProtoJSON

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

MarshalProtoJSON marshals the LookupConfig message to JSON.

func (*LookupConfig) MarshalProtoText

func (x *LookupConfig) MarshalProtoText() string

func (*LookupConfig) MarshalToSizedBufferVT

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

func (*LookupConfig) MarshalToVT

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

func (*LookupConfig) MarshalVT

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

func (*LookupConfig) ProtoMessage

func (*LookupConfig) ProtoMessage()

func (*LookupConfig) Reset

func (x *LookupConfig) Reset()

func (*LookupConfig) SizeVT

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

func (*LookupConfig) String

func (x *LookupConfig) String() string

func (*LookupConfig) UnmarshalJSON

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

UnmarshalJSON unmarshals the LookupConfig from JSON.

func (*LookupConfig) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the LookupConfig message from JSON.

func (*LookupConfig) UnmarshalVT

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

type ObjectRef

type ObjectRef struct {

	// RootRef is the root block ref.
	RootRef *block.BlockRef `protobuf:"bytes,1,opt,name=root_ref,json=rootRef,proto3" json:"rootRef,omitempty"`
	// BucketId is the bucket id, if switching buckets.
	// May be empty to indicate same bucket.
	BucketId string `protobuf:"bytes,2,opt,name=bucket_id,json=bucketId,proto3" json:"bucketId,omitempty"`
	// TransformConfRef is the transformation configuration block ref.
	// Must be encoded with the same transformation config as the parent.
	// May be empty to indicate same conf as parent.
	TransformConfRef *block.BlockRef `protobuf:"bytes,3,opt,name=transform_conf_ref,json=transformConfRef,proto3" json:"transformConfRef,omitempty"`
	// TransformConf is an in-line transform configuration.
	TransformConf *transform.Config `protobuf:"bytes,4,opt,name=transform_conf,json=transformConf,proto3" json:"transformConf,omitempty"`
	// contains filtered or unexported fields
}

ObjectRef is a reference that may contain a transformation config reference and/or a bucket ID change.

protobuf-go-lite:disable-json

func ParseObjectRef

func ParseObjectRef(ref string) (*ObjectRef, error)

ParseObjectRef parses an object ref string.

func UnmarshalObjectRef

func UnmarshalObjectRef(dat []byte) (*ObjectRef, error)

UnmarshalObjectRef attempts to unmarshal an ObjectRef from bytes.

func UnmarshalObjectRefJSON

func UnmarshalObjectRefJSON(data []byte) (*ObjectRef, error)

UnmarshalObjectRefJSON attempts to unmarshal an ObjectRef from JSON.

func (*ObjectRef) ApplyBlockRef

func (o *ObjectRef) ApplyBlockRef(id uint32, ptr *block.BlockRef) error

ApplyBlockRef applies a ref change with a field id. The reference may be nil if the child block is nil.

func (*ObjectRef) BlockAliasIdentity added in v0.52.0

func (o *ObjectRef) BlockAliasIdentity() *block.AliasIdentityToken

BlockAliasIdentity returns the in-memory alias token for ObjectRef.

func (*ObjectRef) Clone

func (o *ObjectRef) Clone() *ObjectRef

Clone makes a copy of the ref.

func (*ObjectRef) CloneMessageVT

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

func (*ObjectRef) CloneVT

func (m *ObjectRef) CloneVT() *ObjectRef

func (*ObjectRef) CopyFrom

func (o *ObjectRef) CopyFrom(ot *ObjectRef)

CopyFrom copies the contents of another ObjectRef.

func (*ObjectRef) EqualMessageVT

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

func (*ObjectRef) EqualVT

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

func (*ObjectRef) EqualsRef

func (o *ObjectRef) EqualsRef(ot *ObjectRef) bool

EqualsRef checks if the ref is equal to another ref.

func (*ObjectRef) EqualsRefIgnoreRootRef

func (o *ObjectRef) EqualsRefIgnoreRootRef(ot *ObjectRef) bool

EqualsRefIgnoreRootRef checks if two refs are equal except for RootRef.

func (*ObjectRef) GetBlockRefCtor

func (o *ObjectRef) GetBlockRefCtor(id uint32) block.Ctor

GetBlockRefCtor returns the constructor for the block at the ref id. Return nil to indicate invalid ref ID or unknown.

func (*ObjectRef) GetBlockRefs

func (o *ObjectRef) GetBlockRefs() (map[uint32]*block.BlockRef, error)

GetBlockRefs returns all block references by ID. May return nil, and values may also be nil. Note: this does not include pending references (in a cursor)

func (*ObjectRef) GetBucketId

func (x *ObjectRef) GetBucketId() string

func (*ObjectRef) GetEmpty

func (o *ObjectRef) GetEmpty() bool

GetEmpty returns if the ref and transform configs are empty.

NOTE: ignores if BucketId is empty.

func (*ObjectRef) GetRootRef

func (x *ObjectRef) GetRootRef() *block.BlockRef

func (*ObjectRef) GetTransformConf

func (x *ObjectRef) GetTransformConf() *transform.Config

func (*ObjectRef) GetTransformConfRef

func (x *ObjectRef) GetTransformConfRef() *block.BlockRef

func (*ObjectRef) IsNil

func (o *ObjectRef) IsNil() bool

IsNil returns if the object is nil.

func (*ObjectRef) MarshalB58

func (o *ObjectRef) MarshalB58() string

MarshalB58 marshals the reference to a base58 string form.

func (*ObjectRef) MarshalBlock

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

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

func (*ObjectRef) MarshalJSON

func (o *ObjectRef) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ObjectRef to JSON.

func (*ObjectRef) MarshalProtoJSON

func (o *ObjectRef) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ObjectRef message to JSON.

func (*ObjectRef) MarshalProtoText

func (x *ObjectRef) MarshalProtoText() string

func (*ObjectRef) MarshalString

func (o *ObjectRef) MarshalString() string

MarshalString marshals the reference to a string form.

func (*ObjectRef) MarshalToSizedBufferVT

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

func (*ObjectRef) MarshalToVT

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

func (*ObjectRef) MarshalVT

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

func (*ObjectRef) ParseFromB58

func (o *ObjectRef) ParseFromB58(ref string) error

ParseFromB58 parses the object ref from a base58 string.

func (*ObjectRef) ProtoMessage

func (*ObjectRef) ProtoMessage()

func (*ObjectRef) Reset

func (x *ObjectRef) Reset()

func (*ObjectRef) SizeVT

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

func (*ObjectRef) String

func (x *ObjectRef) String() string

func (*ObjectRef) UnmarshalB58

func (o *ObjectRef) UnmarshalB58(ref string) error

UnmarshalB58 unmarshals the reference from base58 string form.

func (*ObjectRef) UnmarshalBlock

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

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

func (*ObjectRef) UnmarshalJSON

func (o *ObjectRef) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ObjectRef from JSON.

func (*ObjectRef) UnmarshalProtoJSON

func (o *ObjectRef) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ObjectRef message from JSON.

func (*ObjectRef) UnmarshalVT

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

func (*ObjectRef) Validate

func (o *ObjectRef) Validate() error

Validate performs cursory validation of the object ref.

Directories

Path Synopsis
http
rpc

Jump to

Keyboard shortcuts

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