package storagepb

import "github.com/google/trillian/storage/storagepb"

Package storagepb contains protobuf definitions used by various storage implementations.

TODO(pavelkalinnikov, v2): SubtreeProto is used as:

a) database storage unit in multiple storage implementations;
b) data exchange format between storage and application layers;
c) nodes index data structure.

We should change it so that:

a) individual storage implementations define their own formats;
b) data structures are defined in the application layer.

Index

Types

type NodeIDProto

type NodeIDProto struct {
	Path                 []byte   `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	PrefixLenBits        int32    `protobuf:"varint,2,opt,name=prefix_len_bits,json=prefixLenBits,proto3" json:"prefix_len_bits,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

NodeIDProto is the serialized form of NodeID. It's used only for persistence in storage. As this is long-term we prefer not to use a Go specific format.

func (*NodeIDProto) Descriptor

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

func (*NodeIDProto) GetPath

func (m *NodeIDProto) GetPath() []byte

func (*NodeIDProto) GetPrefixLenBits

func (m *NodeIDProto) GetPrefixLenBits() int32

func (*NodeIDProto) ProtoMessage

func (*NodeIDProto) ProtoMessage()

func (*NodeIDProto) Reset

func (m *NodeIDProto) Reset()

func (*NodeIDProto) String

func (m *NodeIDProto) String() string

func (*NodeIDProto) XXX_DiscardUnknown

func (m *NodeIDProto) XXX_DiscardUnknown()

func (*NodeIDProto) XXX_Marshal

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

func (*NodeIDProto) XXX_Merge

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

func (*NodeIDProto) XXX_Size

func (m *NodeIDProto) XXX_Size() int

func (*NodeIDProto) XXX_Unmarshal

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

type SubtreeProto

type SubtreeProto struct {
	// subtree's prefix (must be a multiple of 8 bits)
	Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// subtree's depth
	Depth    int32  `protobuf:"varint,2,opt,name=depth,proto3" json:"depth,omitempty"`
	RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"`
	// map of suffix (within subtree) to subtree-leaf node hash
	Leaves map[string][]byte `protobuf:"bytes,4,rep,name=leaves,proto3" json:"leaves,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	// Map of suffix (within subtree) to subtree-internal node hash.
	// This structure is usually used in RAM as a cache, the internal nodes of
	// the subtree are not generally stored. However internal nodes are stored for
	// partially filled log subtrees.
	InternalNodes map[string][]byte `protobuf:"bytes,5,rep,name=internal_nodes,json=internalNodes,proto3" json:"internal_nodes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	// Used as a crosscheck on the internal node map by recording its expected
	// size after loading and repopulation.
	InternalNodeCount    uint32   `protobuf:"varint,6,opt,name=internal_node_count,json=internalNodeCount,proto3" json:"internal_node_count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

SubtreeProto contains nodes of a subtree.

func (*SubtreeProto) Descriptor

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

func (*SubtreeProto) GetDepth

func (m *SubtreeProto) GetDepth() int32

func (*SubtreeProto) GetInternalNodeCount

func (m *SubtreeProto) GetInternalNodeCount() uint32

func (*SubtreeProto) GetInternalNodes

func (m *SubtreeProto) GetInternalNodes() map[string][]byte

func (*SubtreeProto) GetLeaves

func (m *SubtreeProto) GetLeaves() map[string][]byte

func (*SubtreeProto) GetPrefix

func (m *SubtreeProto) GetPrefix() []byte

func (*SubtreeProto) GetRootHash

func (m *SubtreeProto) GetRootHash() []byte

func (*SubtreeProto) ProtoMessage

func (*SubtreeProto) ProtoMessage()

func (*SubtreeProto) Reset

func (m *SubtreeProto) Reset()

func (*SubtreeProto) String

func (m *SubtreeProto) String() string

func (*SubtreeProto) XXX_DiscardUnknown

func (m *SubtreeProto) XXX_DiscardUnknown()

func (*SubtreeProto) XXX_Marshal

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

func (*SubtreeProto) XXX_Merge

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

func (*SubtreeProto) XXX_Size

func (m *SubtreeProto) XXX_Size() int

func (*SubtreeProto) XXX_Unmarshal

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

Source Files

gen.go storage.pb.go

Directories

PathSynopsis
storage/storagepb/convertPackage convert contains helpers used by storage implementations.
Version
v1.3.5
Published
Nov 23, 2019
Platform
js/wasm
Imports
3 packages
Last checked
6 hours ago

Tools for package owners.