index

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthIndex = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowIndex   = fmt.Errorf("proto: integer overflow")
)
View Source
var Op_name = map[int32]string{
	0: "APPEND",
	1: "OVERWRITE",
	2: "DELETE",
}
View Source
var Op_value = map[string]int32{
	"APPEND":    0,
	"OVERWRITE": 1,
	"DELETE":    2,
}

Functions

func Generate

func Generate(s string) []string

Generate generates the permutations of the passed in string and returns them sorted.

func Perm

func Perm(a []rune, f func([]rune))

Perm calls f with each permutation of a.

Types

type DataOp

type DataOp struct {
	DataRefs             []*chunk.DataRef `protobuf:"bytes,1,rep,name=data_refs,json=dataRefs,proto3" json:"data_refs,omitempty"`
	Op                   Op               `protobuf:"varint,2,opt,name=op,proto3,enum=index.Op" json:"op,omitempty"`
	Tags                 []*Tag           `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

DataOp is a sequence of data references and an operation associated with the referenced data. Tags map identifiers to data in the resulting byte stream.

func (*DataOp) Descriptor

func (*DataOp) Descriptor() ([]byte, []int)

func (*DataOp) GetDataRefs

func (m *DataOp) GetDataRefs() []*chunk.DataRef

func (*DataOp) GetOp

func (m *DataOp) GetOp() Op

func (*DataOp) GetTags

func (m *DataOp) GetTags() []*Tag

func (*DataOp) Marshal

func (m *DataOp) Marshal() (dAtA []byte, err error)

func (*DataOp) MarshalTo

func (m *DataOp) MarshalTo(dAtA []byte) (int, error)

func (*DataOp) ProtoMessage

func (*DataOp) ProtoMessage()

func (*DataOp) Reset

func (m *DataOp) Reset()

func (*DataOp) Size

func (m *DataOp) Size() (n int)

func (*DataOp) String

func (m *DataOp) String() string

func (*DataOp) Unmarshal

func (m *DataOp) Unmarshal(dAtA []byte) error

func (*DataOp) XXX_DiscardUnknown

func (m *DataOp) XXX_DiscardUnknown()

func (*DataOp) XXX_Marshal

func (m *DataOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DataOp) XXX_Merge

func (m *DataOp) XXX_Merge(src proto.Message)

func (*DataOp) XXX_Size

func (m *DataOp) XXX_Size() int

func (*DataOp) XXX_Unmarshal

func (m *DataOp) XXX_Unmarshal(b []byte) error
type Header struct {
	Hdr *tar.Header
	Idx *Index
}

Header is a wrapper for a tar header and index.

type Index

type Index struct {
	Range                *Range   `protobuf:"bytes,1,opt,name=range,proto3" json:"range,omitempty"`
	DataOp               *DataOp  `protobuf:"bytes,2,opt,name=data_op,json=dataOp,proto3" json:"data_op,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Index stores an index to and metadata about a tar stream.

func (*Index) Descriptor

func (*Index) Descriptor() ([]byte, []int)

func (*Index) GetDataOp

func (m *Index) GetDataOp() *DataOp

func (*Index) GetRange

func (m *Index) GetRange() *Range

func (*Index) Marshal

func (m *Index) Marshal() (dAtA []byte, err error)

func (*Index) MarshalTo

func (m *Index) MarshalTo(dAtA []byte) (int, error)

func (*Index) ProtoMessage

func (*Index) ProtoMessage()

func (*Index) Reset

func (m *Index) Reset()

func (*Index) Size

func (m *Index) Size() (n int)

func (*Index) String

func (m *Index) String() string

func (*Index) Unmarshal

func (m *Index) Unmarshal(dAtA []byte) error

func (*Index) XXX_DiscardUnknown

func (m *Index) XXX_DiscardUnknown()

func (*Index) XXX_Marshal

func (m *Index) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Index) XXX_Merge

func (m *Index) XXX_Merge(src proto.Message)

func (*Index) XXX_Size

func (m *Index) XXX_Size() int

func (*Index) XXX_Unmarshal

func (m *Index) XXX_Unmarshal(b []byte) error

type Op

type Op int32

Op is the set of operations that can be associated with data.

const (
	Op_APPEND    Op = 0
	Op_OVERWRITE Op = 1
	Op_DELETE    Op = 2
)

func (Op) EnumDescriptor

func (Op) EnumDescriptor() ([]byte, []int)

func (Op) String

func (x Op) String() string

type Range

type Range struct {
	LastPath             string   `protobuf:"bytes,1,opt,name=last_path,json=lastPath,proto3" json:"last_path,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Range) Descriptor

func (*Range) Descriptor() ([]byte, []int)

func (*Range) GetLastPath

func (m *Range) GetLastPath() string

func (*Range) Marshal

func (m *Range) Marshal() (dAtA []byte, err error)

func (*Range) MarshalTo

func (m *Range) MarshalTo(dAtA []byte) (int, error)

func (*Range) ProtoMessage

func (*Range) ProtoMessage()

func (*Range) Reset

func (m *Range) Reset()

func (*Range) Size

func (m *Range) Size() (n int)

func (*Range) String

func (m *Range) String() string

func (*Range) Unmarshal

func (m *Range) Unmarshal(dAtA []byte) error

func (*Range) XXX_DiscardUnknown

func (m *Range) XXX_DiscardUnknown()

func (*Range) XXX_Marshal

func (m *Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Range) XXX_Merge

func (m *Range) XXX_Merge(src proto.Message)

func (*Range) XXX_Size

func (m *Range) XXX_Size() int

func (*Range) XXX_Unmarshal

func (m *Range) XXX_Unmarshal(b []byte) error

type Reader

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

Reader is used for reading a multi-level index.

func NewReader

func NewReader(ctx context.Context, objC obj.Client, chunks *chunk.Storage, path, prefix string) *Reader

NewReader create a new Reader.

func (*Reader) Close

func (r *Reader) Close() error

Close closes the reader.

func (*Reader) Next

func (r *Reader) Next() (*Header, error)

Next gets the next header in the index.

type Tag

type Tag struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	SizeBytes            int64    `protobuf:"varint,2,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Tag) Descriptor

func (*Tag) Descriptor() ([]byte, []int)

func (*Tag) GetId

func (m *Tag) GetId() int64

func (*Tag) GetSizeBytes

func (m *Tag) GetSizeBytes() int64

func (*Tag) Marshal

func (m *Tag) Marshal() (dAtA []byte, err error)

func (*Tag) MarshalTo

func (m *Tag) MarshalTo(dAtA []byte) (int, error)

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) Reset

func (m *Tag) Reset()

func (*Tag) Size

func (m *Tag) Size() (n int)

func (*Tag) String

func (m *Tag) String() string

func (*Tag) Unmarshal

func (m *Tag) Unmarshal(dAtA []byte) error

func (*Tag) XXX_DiscardUnknown

func (m *Tag) XXX_DiscardUnknown()

func (*Tag) XXX_Marshal

func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Tag) XXX_Merge

func (m *Tag) XXX_Merge(src proto.Message)

func (*Tag) XXX_Size

func (m *Tag) XXX_Size() int

func (*Tag) XXX_Unmarshal

func (m *Tag) XXX_Unmarshal(b []byte) error

type Writer

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

Writer is used for creating a multi-level index into a serialized FileSet. Each index level consists of compressed tar stream chunks. Each index tar entry has the full index in the content section.

func NewWriter

func NewWriter(ctx context.Context, objC obj.Client, chunks *chunk.Storage, path string, rangeSize ...int64) *Writer

NewWriter create a new Writer. rangeSize should not be used except for testing purposes, the defaultRangeSize will be used in a real deployment.

func (*Writer) Close

func (w *Writer) Close() error

Close finishes the index, and returns the serialized top level index.

func (*Writer) WriteHeader

func (w *Writer) WriteHeader(hdr *Header) error

WriteHeader writes a Header to the index.

Jump to

Keyboard shortcuts

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