buckets

package
v0.44.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GraveyardParser = NewPrefixBucketParser(Graveyard, records.GraveyardRecordParser, Resolvers{
		cidResolver: LenientResolver,
		oidResolver: LenientResolver,
	})

	GarbageParser = NewPrefixBucketParser(Garbage, records.GarbageRecordParser, Resolvers{
		cidResolver: LenientResolver,
		oidResolver: LenientResolver,
	})

	ContainerVolumeParser = NewPrefixBucketParser(ContainerVolume, records.ContainerVolumeRecordParser, Resolvers{
		cidResolver: LenientResolver,
		oidResolver: StrictResolver,
	})

	LockedParser = NewPrefixBucketParser(
		Locked,
		NewContainerBucketParser(
			records.LockedRecordParser,
			Resolvers{
				cidResolver: StrictResolver,
				oidResolver: LenientResolver,
			},
		),
		Resolvers{
			cidResolver: LenientResolver,
			oidResolver: LenientResolver,
		},
	)

	ShardInfoParser = NewPrefixBucketParser(ShardInfo, records.ShardInfoRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: StrictResolver,
	})

	PrimaryParser = NewPrefixContainerBucketParser(Primary, records.ObjectRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: LenientResolver,
	})

	LockersParser = NewPrefixContainerBucketParser(Lockers, records.ObjectRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: LenientResolver,
	})

	TombstoneParser = NewPrefixContainerBucketParser(Tombstone, records.ObjectRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: LenientResolver,
	})

	SmallParser = NewPrefixContainerBucketParser(Small, records.SmallRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: LenientResolver,
	})

	RootParser = NewPrefixContainerBucketParser(Root, records.RootRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: LenientResolver,
	})

	OwnerParser = NewPrefixContainerBucketParser(
		Owner,
		NewUserBucketParser(
			records.OwnerRecordParser,
			Resolvers{
				cidResolver: StrictResolver,
				oidResolver: LenientResolver,
			},
		),
		Resolvers{
			cidResolver: StrictResolver,
			oidResolver: LenientResolver,
		},
	)

	UserAttributeParser = NewUserAttributeKeyBucketParser(
		NewUserAttributeValueBucketParser(records.UserAttributeRecordParser),
	)

	PayloadHashParser = NewPrefixContainerBucketParser(PayloadHash, records.PayloadHashRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: StrictResolver,
	})

	ParentParser = NewPrefixContainerBucketParser(Parent, records.ParentRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: LenientResolver,
	})

	SplitParser = NewPrefixContainerBucketParser(Split, records.SplitRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: StrictResolver,
	})

	ContainerCountersParser = NewPrefixBucketParser(ContainerCounters, records.ContainerCountersRecordParser, Resolvers{
		cidResolver: LenientResolver,
		oidResolver: StrictResolver,
	})

	ECInfoParser = NewPrefixContainerBucketParser(ECInfo, records.ECInfoRecordParser, Resolvers{
		cidResolver: StrictResolver,
		oidResolver: LenientResolver,
	})
)
View Source
var (
	StrictResolver  = func(x bool) common.FilterResult { return common.IfThenElse(x, common.Yes, common.No) }
	LenientResolver = func(x bool) common.FilterResult { return common.IfThenElse(x, common.Yes, common.Maybe) }
)
View Source
var (
	ErrNotBucket          = errors.New("not a bucket")
	ErrInvalidKeyLength   = errors.New("invalid key length")
	ErrInvalidValueLength = errors.New("invalid value length")
	ErrInvalidPrefix      = errors.New("invalid prefix")
)

Functions

func NewContainerBucketParser

func NewContainerBucketParser(next common.Parser, resolvers Resolvers) common.Parser

func NewPrefixBucketParser

func NewPrefixBucketParser(prefix Prefix, next common.Parser, resolvers Resolvers) common.Parser

func NewPrefixContainerBucketParser

func NewPrefixContainerBucketParser(prefix Prefix, next common.Parser, resolvers Resolvers) common.Parser

func NewUserAttributeKeyBucketParser

func NewUserAttributeKeyBucketParser(next common.Parser) common.Parser

func NewUserAttributeValueBucketParser

func NewUserAttributeValueBucketParser(next common.Parser) common.Parser

func NewUserBucketParser

func NewUserBucketParser(next common.Parser, resolvers Resolvers) common.Parser

Types

type ContainerBucket

type ContainerBucket struct {
	// contains filtered or unexported fields
}

func (*ContainerBucket) DetailedString

func (b *ContainerBucket) DetailedString() string

func (*ContainerBucket) Filter

func (b *ContainerBucket) Filter(typ string, val any) common.FilterResult

func (*ContainerBucket) String

func (b *ContainerBucket) String() string

type FilterResolver

type FilterResolver = func(result bool) common.FilterResult

type Prefix

type Prefix byte
const (
	Graveyard Prefix = iota
	Garbage
	ToMoveIt
	ContainerVolume
	Locked
	ShardInfo
	Primary
	Lockers

	Tombstone
	Small
	Root
	Owner
	UserAttribute
	PayloadHash
	Parent
	Split
	ContainerCounters
	ECInfo
)

func (Prefix) String

func (p Prefix) String() string

type PrefixBucket

type PrefixBucket struct {
	// contains filtered or unexported fields
}

func (*PrefixBucket) DetailedString

func (b *PrefixBucket) DetailedString() string

func (*PrefixBucket) Filter

func (b *PrefixBucket) Filter(typ string, _ any) common.FilterResult

func (*PrefixBucket) String

func (b *PrefixBucket) String() string

type PrefixContainerBucket

type PrefixContainerBucket struct {
	// contains filtered or unexported fields
}

func (*PrefixContainerBucket) DetailedString

func (b *PrefixContainerBucket) DetailedString() string

func (*PrefixContainerBucket) Filter

func (b *PrefixContainerBucket) Filter(typ string, val any) common.FilterResult

func (*PrefixContainerBucket) String

func (b *PrefixContainerBucket) String() string

type Resolvers

type Resolvers struct {
	// contains filtered or unexported fields
}

type UserAttributeKeyBucket

type UserAttributeKeyBucket struct {
	// contains filtered or unexported fields
}

func (*UserAttributeKeyBucket) DetailedString

func (b *UserAttributeKeyBucket) DetailedString() string

func (*UserAttributeKeyBucket) Filter

func (b *UserAttributeKeyBucket) Filter(typ string, val any) common.FilterResult

func (*UserAttributeKeyBucket) String

func (b *UserAttributeKeyBucket) String() string

type UserAttributeValueBucket

type UserAttributeValueBucket struct {
	// contains filtered or unexported fields
}

func (*UserAttributeValueBucket) DetailedString

func (b *UserAttributeValueBucket) DetailedString() string

func (*UserAttributeValueBucket) Filter

func (*UserAttributeValueBucket) String

func (b *UserAttributeValueBucket) String() string

type UserBucket

type UserBucket struct {
	// contains filtered or unexported fields
}

func (*UserBucket) DetailedString

func (b *UserBucket) DetailedString() string

func (*UserBucket) Filter

func (b *UserBucket) Filter(typ string, _ any) common.FilterResult

func (*UserBucket) String

func (b *UserBucket) String() string

Jump to

Keyboard shortcuts

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