object_metadata

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShaKeySelfMetadata                 = keys.ShaKeySelfMetadata
	ShaKeySelfMetadataWithouTai        = keys.ShaKeySelfMetadataWithouTai
	ShaKeySelfMetadataObjectIdParent   = keys.ShaKeySelfMetadataObjectIdParent
	ShaKeyParentMetadataObjectIdParent = keys.ShaKeyParentMetadataObjectIdParent
	ShaKeySelf                         = keys.ShaKeySelf
	ShaKeyParent                       = keys.ShaKeyParent
)

Variables

View Source
var (
	EqualerSansTai               equaler
	Equaler                      = equaler{/* contains filtered or unexported fields */}
	EqualerSansTaiIncludeVirtual = equaler{/* contains filtered or unexported fields */}
)
View Source
var Lessor lessor
View Source
var Resetter resetter
View Source
var ResetterCache resetterCache

Functions

func GetPool

func GetPool() interfaces.Pool[Metadata, *Metadata]

func MakeTextFormatterExcludeMetadata

func MakeTextFormatterExcludeMetadata(
	common Dependencies,
) textFormatter

func MakeTextFormatterMetadataBlobPath

func MakeTextFormatterMetadataBlobPath(
	common Dependencies,
) textFormatter

func MakeTextFormatterMetadataInlineBlob

func MakeTextFormatterMetadataInlineBlob(
	common Dependencies,
) textFormatter

func MakeTextFormatterMetadataOnly

func MakeTextFormatterMetadataOnly(
	common Dependencies,
) textFormatter

func StringSansTai

func StringSansTai(o *Metadata) (str string)

Types

type Cache

type Cache struct {
	ParentTai    ids.Tai
	Dormant      values.Bool
	ExpandedTags ids.TagMutableSet // public for gob, but should be private
	ImplicitTags ids.TagMutableSet // public for gob, but should be private
	TagPaths     tag_paths.Tags
	QueryPath
}

func (*Cache) AddTagExpandedPtr

func (v *Cache) AddTagExpandedPtr(e *ids.Tag) (err error)

func (*Cache) AddTagsImplicitPtr

func (v *Cache) AddTagsImplicitPtr(e *ids.Tag) (err error)

func (*Cache) GetExpandedTags

func (v *Cache) GetExpandedTags() ids.TagSet

func (*Cache) GetExpandedTagsMutable

func (v *Cache) GetExpandedTagsMutable() ids.TagMutableSet

func (*Cache) GetImplicitTags

func (v *Cache) GetImplicitTags() ids.TagSet

func (*Cache) GetImplicitTagsMutable

func (v *Cache) GetImplicitTagsMutable() ids.TagMutableSet

func (*Cache) SetExpandedTags

func (v *Cache) SetExpandedTags(e ids.TagSet)

func (*Cache) SetImplicitTags

func (v *Cache) SetImplicitTags(e ids.TagSet)

type Dependencies

type Dependencies struct {
	EnvDir        env_dir.Env
	BlobStore     interfaces.BlobStore
	BlobFormatter script_config.RemoteScript
}

type ErrBlobFormatterFailed

type ErrBlobFormatterFailed struct {
	*exec.ExitError
}

func MakeErrBlobFormatterFailed

func MakeErrBlobFormatterFailed(
	err *exec.ExitError,
) ErrBlobFormatterFailed

func (ErrBlobFormatterFailed) Error

func (e ErrBlobFormatterFailed) Error() string

func (ErrBlobFormatterFailed) Is

func (e ErrBlobFormatterFailed) Is(target error) bool

func (ErrBlobFormatterFailed) ShouldShowStackTrace

func (e ErrBlobFormatterFailed) ShouldShowStackTrace() bool

type ErrHasInlineBlobAndFilePath

type ErrHasInlineBlobAndFilePath struct {
	BlobFD    fd.FD
	InlineSha sha.Sha
}

func MakeErrHasInlineBlobAndFilePath

func MakeErrHasInlineBlobAndFilePath(
	blobFD *fd.FD,
	sh *sha.Sha,
) (err *ErrHasInlineBlobAndFilePath)

func (*ErrHasInlineBlobAndFilePath) Error

type ErrHasInlineBlobAndMetadataSha

type ErrHasInlineBlobAndMetadataSha struct {
	InlineSha   sha.Sha
	MetadataSha sha.Sha
}

func MakeErrHasInlineBlobAndMetadataSha

func MakeErrHasInlineBlobAndMetadataSha(
	inline, object_metadata *sha.Sha,
) (err *ErrHasInlineBlobAndMetadataSha)

func (*ErrHasInlineBlobAndMetadataSha) Error

type Field

type FormatterDependencies

type FormatterDependencies struct{}

type Getter

type Getter interface {
	GetMetadata() *Metadata
}

type Heap

type Heap = heap.Heap[Metadata, *Metadata]

func MakeHeap

func MakeHeap() *Heap

type Metadata

type Metadata struct {
	Description descriptions.Description
	Tags        ids.TagMutableSet // public for gob, but should be private
	Type        ids.Type

	Shas
	Tai ids.Tai

	Comments []string
	Cache    Cache
	Fields   []Field
}

func (*Metadata) AddComment

func (mp *Metadata) AddComment(f string, vals ...interface{})

func (*Metadata) AddTagPtr

func (m *Metadata) AddTagPtr(e *ids.Tag) (err error)

func (*Metadata) AddTagPtrFast

func (m *Metadata) AddTagPtrFast(e *ids.Tag) (err error)

func (*Metadata) AddTagString

func (z *Metadata) AddTagString(es string) (err error)

func (*Metadata) Equals

func (pz *Metadata) Equals(z1 *Metadata) bool

TODO-P2 remove

func (*Metadata) EqualsSansTai

func (b *Metadata) EqualsSansTai(a *Metadata) bool

TODO-P2 remove

func (*Metadata) GenerateExpandedTags

func (m *Metadata) GenerateExpandedTags()

func (*Metadata) GetMetadata

func (m *Metadata) GetMetadata() *Metadata

func (*Metadata) GetTags

func (m *Metadata) GetTags() ids.TagSet

TODO fix issue with GetTags being nil sometimes

func (*Metadata) GetTai

func (z *Metadata) GetTai() ids.Tai

func (*Metadata) GetType

func (z *Metadata) GetType() ids.Type

func (*Metadata) GetTypePtr

func (z *Metadata) GetTypePtr() *ids.Type

func (*Metadata) IsEmpty

func (z *Metadata) IsEmpty() bool

func (*Metadata) Mutter

func (m *Metadata) Mutter() *sha.Sha

func (*Metadata) ResetTags

func (m *Metadata) ResetTags()

func (*Metadata) SetFlagSet

func (m *Metadata) SetFlagSet(f *flag.FlagSet)

TODO replace with command_components.ObjectMetadata

func (*Metadata) SetFlagSetDescription

func (m *Metadata) SetFlagSetDescription(f *flag.FlagSet, usage string)

func (*Metadata) SetFlagSetTags

func (m *Metadata) SetFlagSetTags(f *flag.FlagSet, usage string)

func (*Metadata) SetFlagSetType

func (m *Metadata) SetFlagSetType(f *flag.FlagSet, usage string)

func (*Metadata) SetMutter

func (selbst *Metadata) SetMutter(mg Getter) (err error)

func (*Metadata) SetTags

func (metadata *Metadata) SetTags(tags ids.TagSet)

func (*Metadata) Sha

func (m *Metadata) Sha() *sha.Sha

func (*Metadata) Subtract

func (a *Metadata) Subtract(
	b *Metadata,
)

func (*Metadata) UserInputIsEmpty

func (z *Metadata) UserInputIsEmpty() bool

type MetadataLike

type MetadataLike interface {
	Getter
}

type PersistentFormatterContext

type PersistentFormatterContext interface {
	Getter
}

type PersistentParserContext

type PersistentParserContext interface {
	Getter
}

type QueryPath

type QueryPath []qpItem

TODO remove this entirely in favor of ad hoc debugging of queries

func (*QueryPath) Len

func (qp *QueryPath) Len() int

func (*QueryPath) Pop

func (qp *QueryPath) Pop() any

func (*QueryPath) Reset

func (qp *QueryPath) Reset()

func (*QueryPath) String

func (qp *QueryPath) String() string

type Setter

type Setter interface {
	SetMetadata(*Metadata)
}

type Sha

type Sha struct {
	*sha.Sha
	// contains filtered or unexported fields
}

type Shas

type Shas struct {
	Blob                         sha.Sha
	SelfMetadata                 sha.Sha
	SelfMetadataWithoutTai       sha.Sha
	SelfMetadataObjectIdParent   sha.Sha
	ParentMetadataObjectIdParent sha.Sha
}

TODO make this a map

func (*Shas) Add

func (s *Shas) Add(k, v string) (err error)

func (*Shas) Reset

func (s *Shas) Reset()

func (*Shas) ResetWith

func (dst *Shas) ResetWith(src *Shas)

func (*Shas) String

func (s *Shas) String() string

type TextFormat

type TextFormat struct {
	TextFormatterFamily
	TextParser
}

func MakeTextFormat

func MakeTextFormat(
	common Dependencies,
) TextFormat

type TextFormatOutput

type TextFormatOutput struct {
	io.Writer
	// contains filtered or unexported fields
}

type TextFormatter

type TextFormatter interface {
	FormatMetadata(io.Writer, TextFormatterContext) (int64, error)
}

type TextFormatterContext

type TextFormatterContext struct {
	TextFormatterOptions
	PersistentFormatterContext
}

type TextFormatterFamily

type TextFormatterFamily struct {
	BlobPath     TextFormatter
	InlineBlob   TextFormatter
	MetadataOnly TextFormatter
	BlobOnly     TextFormatter
}

func MakeTextFormatterFamily

func MakeTextFormatterFamily(
	common Dependencies,
) TextFormatterFamily

type TextParser

type TextParser interface {
	ParseMetadata(io.Reader, TextParserContext) (int64, error)
}

func MakeTextParser

func MakeTextParser(
	dependencies Dependencies,
) TextParser

type TextParserContext

type TextParserContext interface {
	PersistentParserContext
	SetBlobSha(interfaces.Sha) error
}

Jump to

Keyboard shortcuts

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