Documentation ¶
Index ¶
- func NewDownloaderServer(downloader Downloader[GlobalReference]) object.DownloaderServer
- func NewUploaderServer(uploader Uploader[GlobalReference, []byte]) object.UploaderServer
- type Contents
- func (c *Contents) Flatten() *Contents
- func (c *Contents) GetDegree() int
- func (c *Contents) GetFullData() []byte
- func (c *Contents) GetOutgoingReference(i int) LocalReference
- func (c *Contents) GetOutgoingReferencesList() OutgoingReferencesList
- func (c *Contents) GetPayload() []byte
- func (c *Contents) GetReference() LocalReference
- func (c *Contents) ToProto() *object.Contents
- func (c *Contents) Unflatten(newReference LocalReference) (*Contents, error)
- type Downloader
- type DownloaderForTesting
- type GlobalReference
- func (r GlobalReference) CompareByHeight(other GlobalReference) int
- func (r GlobalReference) Flatten() GlobalReference
- func (r GlobalReference) GetNamespace() Namespace
- func (r *GlobalReference) SetLocalReference(localReference LocalReference)
- func (r GlobalReference) WithLocalReference(localReference LocalReference) GlobalReference
- type InstanceName
- type Limit
- func (l *Limit) AcquireObjectAndChildren(reference LocalReference) bool
- func (l *Limit) CanAcquireObjectAndChildren(reference LocalReference) bool
- func (l Limit) Min(other Limit) Limit
- func (l *Limit) ReleaseChildren(reference LocalReference)
- func (l *Limit) ReleaseObject(reference LocalReference)
- func (l Limit) ToProto() *object.Limit
- type LocalReference
- func (r LocalReference) CompareByHeight(other LocalReference) int
- func (r LocalReference) Flatten() (flatReference LocalReference)
- func (r LocalReference) GetDegree() int
- func (r LocalReference) GetHash() []byte
- func (r LocalReference) GetHeight() int
- func (r LocalReference) GetLocalReference() LocalReference
- func (r LocalReference) GetMaximumTotalParentsSizeBytes(includeSelf bool) int
- func (r LocalReference) GetRawReference() []byte
- func (LocalReference) GetReferenceFormat() ReferenceFormat
- func (r LocalReference) GetSizeBytes() int
- func (r LocalReference) String() string
- func (r LocalReference) WithLocalReference(localReference LocalReference) LocalReference
- type Namespace
- type OutgoingReferences
- type OutgoingReferencesList
- type ReferenceFormat
- func (ReferenceFormat) GetBogusReference() LocalReference
- func (ReferenceFormat) GetMaximumObjectSizeBytes() int
- func (ReferenceFormat) GetReferenceSizeBytes() int
- func (rf ReferenceFormat) NewContents(outgoingReferences []LocalReference, payload []byte) (*Contents, error)
- func (ReferenceFormat) NewLocalReference(rawReference []byte) (r LocalReference, err error)
- func (ReferenceFormat) ToProto() object.ReferenceFormat_Value
- type Store
- type StoreForTesting
- type UploadObjectComplete
- type UploadObjectIncomplete
- type UploadObjectMissing
- type UploadObjectResult
- type Uploader
- type UploaderForTesting
- type UploaderForTestingBytes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDownloaderServer ¶
func NewDownloaderServer(downloader Downloader[GlobalReference]) object.DownloaderServer
NewDownloaderServer creates a gRPC server object for exposing a Downloader. This can be used to make objects contained in an object store accessible via the network.
func NewUploaderServer ¶
func NewUploaderServer(uploader Uploader[GlobalReference, []byte]) object.UploaderServer
NewUploaderServer creates a gRPC server object for exposing an Uploader. This can be used to make objects contained in an object store accessible via the network.
Types ¶
type Contents ¶
type Contents struct {
// contains filtered or unexported fields
}
func MustNewContents ¶
func MustNewContents(referenceFormatValue object.ReferenceFormat_Value, references []LocalReference, payload []byte) *Contents
func NewContentsFromFullData ¶
func NewContentsFromFullData(reference LocalReference, data []byte) (*Contents, error)
func NewContentsFromProto ¶
func NewContentsFromProto(reference LocalReference, m *object.Contents) (*Contents, error)
func (*Contents) GetFullData ¶
func (*Contents) GetOutgoingReference ¶
func (c *Contents) GetOutgoingReference(i int) LocalReference
func (*Contents) GetOutgoingReferencesList ¶
func (c *Contents) GetOutgoingReferencesList() OutgoingReferencesList
func (*Contents) GetPayload ¶
func (*Contents) GetReference ¶
func (c *Contents) GetReference() LocalReference
type Downloader ¶
type DownloaderForTesting ¶
type DownloaderForTesting Downloader[GlobalReference]
type GlobalReference ¶
type GlobalReference struct { InstanceName LocalReference }
func (GlobalReference) CompareByHeight ¶
func (r GlobalReference) CompareByHeight(other GlobalReference) int
func (GlobalReference) Flatten ¶
func (r GlobalReference) Flatten() GlobalReference
func (GlobalReference) GetNamespace ¶
func (r GlobalReference) GetNamespace() Namespace
func (*GlobalReference) SetLocalReference ¶
func (r *GlobalReference) SetLocalReference(localReference LocalReference)
func (GlobalReference) WithLocalReference ¶
func (r GlobalReference) WithLocalReference(localReference LocalReference) GlobalReference
type InstanceName ¶
type InstanceName struct {
// contains filtered or unexported fields
}
func NewInstanceName ¶
func NewInstanceName(value string) InstanceName
func (InstanceName) WithLocalReference ¶
func (in InstanceName) WithLocalReference(localReference LocalReference) GlobalReference
type Limit ¶
type Limit struct {
// contains filtered or unexported fields
}
func (*Limit) AcquireObjectAndChildren ¶
func (l *Limit) AcquireObjectAndChildren(reference LocalReference) bool
func (*Limit) CanAcquireObjectAndChildren ¶
func (l *Limit) CanAcquireObjectAndChildren(reference LocalReference) bool
func (*Limit) ReleaseChildren ¶
func (l *Limit) ReleaseChildren(reference LocalReference)
func (*Limit) ReleaseObject ¶
func (l *Limit) ReleaseObject(reference LocalReference)
type LocalReference ¶
type LocalReference struct {
// contains filtered or unexported fields
}
func (LocalReference) CompareByHeight ¶
func (r LocalReference) CompareByHeight(other LocalReference) int
CompareByHeight returns -1 if the reference comes before another reference along a total order based on the references' height and maximum total parents size. Conversely, it returns 1 if the reference comes after another reference. 0 is returned if both references are equal.
This order can be used to perform bounded parallel traversal of DAGs in such a way that forward progress is guaranteed.
func (LocalReference) Flatten ¶
func (r LocalReference) Flatten() (flatReference LocalReference)
func (LocalReference) GetDegree ¶
func (r LocalReference) GetDegree() int
func (LocalReference) GetHash ¶
func (r LocalReference) GetHash() []byte
func (LocalReference) GetHeight ¶
func (r LocalReference) GetHeight() int
func (LocalReference) GetLocalReference ¶
func (r LocalReference) GetLocalReference() LocalReference
func (LocalReference) GetMaximumTotalParentsSizeBytes ¶
func (r LocalReference) GetMaximumTotalParentsSizeBytes(includeSelf bool) int
func (LocalReference) GetRawReference ¶
func (r LocalReference) GetRawReference() []byte
func (LocalReference) GetReferenceFormat ¶
func (LocalReference) GetReferenceFormat() ReferenceFormat
func (LocalReference) GetSizeBytes ¶
func (r LocalReference) GetSizeBytes() int
func (LocalReference) String ¶
func (r LocalReference) String() string
func (LocalReference) WithLocalReference ¶
func (r LocalReference) WithLocalReference(localReference LocalReference) LocalReference
type Namespace ¶
type Namespace struct { InstanceName ReferenceFormat }
func MustNewNamespace ¶
func (Namespace) NewGlobalReference ¶
func (ns Namespace) NewGlobalReference(rawReference []byte) (GlobalReference, error)
type OutgoingReferences ¶
type OutgoingReferences interface { GetDegree() int GetOutgoingReference(index int) LocalReference GetOutgoingReferencesList() OutgoingReferencesList }
OutgoingReferences is a list of outgoing references of an object. It may either be implemented by a simple slice, or it's possible to provide an implementation that reads references directly out of the object's contents.
type OutgoingReferencesList ¶
type OutgoingReferencesList []LocalReference
OutgoingReferencesList is a list of outgoing references of an object that is backed by a simple slice.
func (OutgoingReferencesList) GetDegree ¶
func (l OutgoingReferencesList) GetDegree() int
func (OutgoingReferencesList) GetOutgoingReference ¶
func (l OutgoingReferencesList) GetOutgoingReference(index int) LocalReference
func (OutgoingReferencesList) GetOutgoingReferencesList ¶
func (l OutgoingReferencesList) GetOutgoingReferencesList() OutgoingReferencesList
type ReferenceFormat ¶
type ReferenceFormat struct{}
func MustNewReferenceFormat ¶
func MustNewReferenceFormat(value object.ReferenceFormat_Value) ReferenceFormat
func NewReferenceFormat ¶
func NewReferenceFormat(value object.ReferenceFormat_Value) (ReferenceFormat, error)
func (ReferenceFormat) GetBogusReference ¶
func (ReferenceFormat) GetBogusReference() LocalReference
GetBogusReference returns a reference that is valid according to all of the range restrictions of the reference format, but for which it's impossible to ever construct valid object contents.
This function can be used to simulate the creation of messages, without actually computing their contents and references.
func (ReferenceFormat) GetMaximumObjectSizeBytes ¶
func (ReferenceFormat) GetMaximumObjectSizeBytes() int
func (ReferenceFormat) GetReferenceSizeBytes ¶
func (ReferenceFormat) GetReferenceSizeBytes() int
func (ReferenceFormat) NewContents ¶
func (rf ReferenceFormat) NewContents(outgoingReferences []LocalReference, payload []byte) (*Contents, error)
func (ReferenceFormat) NewLocalReference ¶
func (ReferenceFormat) NewLocalReference(rawReference []byte) (r LocalReference, err error)
func (ReferenceFormat) ToProto ¶
func (ReferenceFormat) ToProto() object.ReferenceFormat_Value
type Store ¶
type Store[TReference any, TLease any] interface { Downloader[TReference] Uploader[TReference, TLease] }
type StoreForTesting ¶
type StoreForTesting Store[GlobalReference, any]
type UploadObjectComplete ¶
type UploadObjectComplete[TLease any] struct { Lease TLease }
type UploadObjectIncomplete ¶
type UploadObjectMissing ¶
type UploadObjectMissing[TLease any] struct{}
type UploadObjectResult ¶
type UploadObjectResult[TLease any] interface { // contains filtered or unexported methods }
type UploaderForTesting ¶
type UploaderForTesting Uploader[GlobalReference, any]
type UploaderForTestingBytes ¶
type UploaderForTestingBytes Uploader[GlobalReference, []byte]