github.com/bartle-stripe/trillian@v1.2.1/storage/storagepb/storage.proto (about) 1 // Copyright 2016 Google Inc. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 package storagepb; 18 19 // This file contains protos used only by storage. They are not exported via any of 20 // our public APIs. 21 22 // NodeIDProto is the serialized form of NodeID. It's used only for persistence in storage. 23 // As this is long-term we prefer not to use a Go specific format. 24 message NodeIDProto { 25 bytes path = 1; 26 int32 prefix_len_bits = 2; 27 } 28 29 // SubtreeProto contains nodes of a subtree. 30 message SubtreeProto { 31 // subtree's prefix (must be a multiple of 8 bits) 32 bytes prefix = 1; 33 // subtree's depth 34 int32 depth = 2; 35 36 bytes root_hash = 3; 37 38 // map of suffix (within subtree) to subtree-leaf node hash 39 map<string, bytes> leaves = 4; 40 41 // Map of suffix (within subtree) to subtree-internal node hash. 42 // This structure is usually used in RAM as a cache, the internal nodes of 43 // the subtree are not generally stored. However internal nodes are stored for 44 // partially filled log subtrees. 45 map<string, bytes> internal_nodes = 5; 46 // Used as a crosscheck on the internal node map by recording its expected size after 47 // loading and repopulation. 48 uint32 internal_node_count = 6; 49 }