Documentation ¶
Overview ¶
Package api is a generated protocol buffer package.
It is generated from these files:
librarian/api/documents.proto librarian/api/librarian.proto
It has these top-level messages:
Document Envelope Entry EntryMetadata SchemaArtifact Page RequestMetadata ResponseMetadata IntroduceRequest IntroduceResponse FindRequest FindResponse VerifyRequest VerifyResponse PeerAddress StoreRequest StoreResponse GetRequest GetResponse PutRequest PutResponse SubscribeRequest SubscribeResponse Publication Subscription BloomFilter
Index ¶
- Constants
- Variables
- func GetAuthorPub(d *Document) []byte
- func GetEntryPageKeys(entryDoc *Document) ([]id.ID, error)
- func GetKey(value proto.Message) (id.ID, error)
- func RandBytes(rng *rand.Rand, length int) []byte
- func RegisterLibrarianServer(s *grpc.Server, srv LibrarianServer)
- func ValidateAESKey(value []byte) error
- func ValidateBytes(value []byte, expectedLen int, name string) error
- func ValidateDocument(d *Document) error
- func ValidateEntry(e *Entry) error
- func ValidateEntryMetadata(m *EntryMetadata) error
- func ValidateEnvelope(e *Envelope) error
- func ValidateHMAC256(value []byte) error
- func ValidateHMACKey(value []byte) error
- func ValidateMetadataIV(value []byte) error
- func ValidateNotEmpty(value []byte, name string) error
- func ValidatePage(p *Page) error
- func ValidatePageIVSeed(value []byte) error
- func ValidatePageKeys(pk [][]byte) error
- func ValidatePublicKey(value []byte) error
- func ValidatePublication(p *Publication) error
- func ValidateSubscription(s *Subscription) error
- type BloomFilter
- type CompressionCodec
- type Document
- func (*Document) Descriptor() ([]byte, []int)
- func (m *Document) GetContents() isDocument_Contents
- func (m *Document) GetEntry() *Entry
- func (m *Document) GetEnvelope() *Envelope
- func (m *Document) GetPage() *Page
- func (*Document) ProtoMessage()
- func (m *Document) Reset()
- func (m *Document) String() string
- func (*Document) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Document_Entry
- type Document_Envelope
- type Document_Page
- type Endpoint
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)
- func (m *Entry) GetAuthorPublicKey() []byte
- func (m *Entry) GetCreatedTime() uint32
- func (m *Entry) GetMetadataCiphertext() []byte
- func (m *Entry) GetMetadataCiphertextMac() []byte
- func (m *Entry) GetPage() *Page
- func (m *Entry) GetPageKeys() [][]byte
- func (*Entry) ProtoMessage()
- func (m *Entry) Reset()
- func (m *Entry) String() string
- type EntryMetadata
- func (*EntryMetadata) Descriptor() ([]byte, []int)
- func (m *EntryMetadata) GetCiphertextMac() []byte
- func (m *EntryMetadata) GetCiphertextSize() uint64
- func (m *EntryMetadata) GetCompressionCodec() CompressionCodec
- func (m *EntryMetadata) GetDataDictionary() *SchemaArtifact
- func (m *EntryMetadata) GetFilepath() string
- func (m *EntryMetadata) GetMediaType() string
- func (m *EntryMetadata) GetProperties() map[string][]byte
- func (m *EntryMetadata) GetSchema() *SchemaArtifact
- func (m *EntryMetadata) GetUncompressedMac() []byte
- func (m *EntryMetadata) GetUncompressedSize() uint64
- func (m *EntryMetadata) MarshalLogObject(oe zapcore.ObjectEncoder) error
- func (*EntryMetadata) ProtoMessage()
- func (m *EntryMetadata) Reset()
- func (m *EntryMetadata) String() string
- type Envelope
- func (*Envelope) Descriptor() ([]byte, []int)
- func (m *Envelope) GetAuthorPublicKey() []byte
- func (m *Envelope) GetEekCiphertext() []byte
- func (m *Envelope) GetEekCiphertextMac() []byte
- func (m *Envelope) GetEntryKey() []byte
- func (m *Envelope) GetReaderPublicKey() []byte
- func (*Envelope) ProtoMessage()
- func (m *Envelope) Reset()
- func (m *Envelope) String() string
- type FindRequest
- type FindResponse
- func (*FindResponse) Descriptor() ([]byte, []int)
- func (m *FindResponse) GetMetadata() *ResponseMetadata
- func (m *FindResponse) GetPeers() []*PeerAddress
- func (m *FindResponse) GetValue() *Document
- func (*FindResponse) ProtoMessage()
- func (m *FindResponse) Reset()
- func (m *FindResponse) String() string
- type Finder
- type GetRequest
- type GetResponse
- type Getter
- type IntroduceRequest
- func (*IntroduceRequest) Descriptor() ([]byte, []int)
- func (m *IntroduceRequest) GetMetadata() *RequestMetadata
- func (m *IntroduceRequest) GetNumPeers() uint32
- func (m *IntroduceRequest) GetSelf() *PeerAddress
- func (*IntroduceRequest) ProtoMessage()
- func (m *IntroduceRequest) Reset()
- func (m *IntroduceRequest) String() string
- type IntroduceResponse
- func (*IntroduceResponse) Descriptor() ([]byte, []int)
- func (m *IntroduceResponse) GetMetadata() *ResponseMetadata
- func (m *IntroduceResponse) GetPeers() []*PeerAddress
- func (m *IntroduceResponse) GetSelf() *PeerAddress
- func (*IntroduceResponse) ProtoMessage()
- func (m *IntroduceResponse) Reset()
- func (m *IntroduceResponse) String() string
- type Introducer
- type LibrarianClient
- type LibrarianServer
- type Librarian_SubscribeClient
- type Librarian_SubscribeServer
- type Page
- type PeerAddress
- func (*PeerAddress) Descriptor() ([]byte, []int)
- func (m *PeerAddress) GetIp() string
- func (m *PeerAddress) GetPeerId() []byte
- func (m *PeerAddress) GetPeerName() string
- func (m *PeerAddress) GetPort() uint32
- func (*PeerAddress) ProtoMessage()
- func (m *PeerAddress) Reset()
- func (m *PeerAddress) String() string
- type Publication
- func (*Publication) Descriptor() ([]byte, []int)
- func (m *Publication) GetAuthorPublicKey() []byte
- func (m *Publication) GetEntryKey() []byte
- func (m *Publication) GetEnvelopeKey() []byte
- func (m *Publication) GetReaderPublicKey() []byte
- func (*Publication) ProtoMessage()
- func (m *Publication) Reset()
- func (m *Publication) String() string
- type PutOperation
- type PutRequest
- type PutResponse
- type Putter
- type PutterGetter
- type RequestMetadata
- func (*RequestMetadata) Descriptor() ([]byte, []int)
- func (m *RequestMetadata) GetOrgPubKey() []byte
- func (m *RequestMetadata) GetPubKey() []byte
- func (m *RequestMetadata) GetRequestId() []byte
- func (*RequestMetadata) ProtoMessage()
- func (m *RequestMetadata) Reset()
- func (m *RequestMetadata) String() string
- type ResponseMetadata
- func (*ResponseMetadata) Descriptor() ([]byte, []int)
- func (m *ResponseMetadata) GetOrgPubKey() []byte
- func (m *ResponseMetadata) GetPubKey() []byte
- func (m *ResponseMetadata) GetRequestId() []byte
- func (*ResponseMetadata) ProtoMessage()
- func (m *ResponseMetadata) Reset()
- func (m *ResponseMetadata) String() string
- type SchemaArtifact
- func (*SchemaArtifact) Descriptor() ([]byte, []int)
- func (m *SchemaArtifact) GetGroup() string
- func (m *SchemaArtifact) GetName() string
- func (m *SchemaArtifact) GetPath() string
- func (m *SchemaArtifact) GetProject() string
- func (m *SchemaArtifact) GetVersion() string
- func (*SchemaArtifact) ProtoMessage()
- func (m *SchemaArtifact) Reset()
- func (m *SchemaArtifact) String() string
- type StoreRequest
- type StoreResponse
- type Storer
- type SubscribeRequest
- type SubscribeResponse
- func (*SubscribeResponse) Descriptor() ([]byte, []int)
- func (m *SubscribeResponse) GetKey() []byte
- func (m *SubscribeResponse) GetMetadata() *ResponseMetadata
- func (m *SubscribeResponse) GetValue() *Publication
- func (*SubscribeResponse) ProtoMessage()
- func (m *SubscribeResponse) Reset()
- func (m *SubscribeResponse) String() string
- type Subscriber
- type Subscription
- type Verifier
- type VerifyRequest
- func (*VerifyRequest) Descriptor() ([]byte, []int)
- func (m *VerifyRequest) GetKey() []byte
- func (m *VerifyRequest) GetMacKey() []byte
- func (m *VerifyRequest) GetMetadata() *RequestMetadata
- func (m *VerifyRequest) GetNumPeers() uint32
- func (*VerifyRequest) ProtoMessage()
- func (m *VerifyRequest) Reset()
- func (m *VerifyRequest) String() string
- type VerifyResponse
- func (*VerifyResponse) Descriptor() ([]byte, []int)
- func (m *VerifyResponse) GetMac() []byte
- func (m *VerifyResponse) GetMetadata() *ResponseMetadata
- func (m *VerifyResponse) GetPeers() []*PeerAddress
- func (*VerifyResponse) ProtoMessage()
- func (m *VerifyResponse) Reset()
- func (m *VerifyResponse) String() string
Constants ¶
const ( // ECPubKeyLength is the length of a 256-bit ECDSA public key point serialized // (compressed) to a byte string. ECPubKeyLength = 33 // DocumentKeyLength is the byte length a document's key. DocumentKeyLength = id.Length // AESKeyLength is the byte length of an AES-256 encryption key. AESKeyLength = 32 // PageIVSeedLength is the byte length of the Page block cipher initialization vector (IV) // seed. PageIVSeedLength = 32 // HMACKeyLength is the byte length of the Page HMAC-256 key. HMACKeyLength = 32 // BlockCipherIVLength is the byte length of a block cipher initialization vector. BlockCipherIVLength = 12 // KEKLength is the total byte length of the key encryption keys. KEKLength = AESKeyLength + BlockCipherIVLength + HMACKeyLength // EEKLength is the total byte length of the entry encryption keys. EEKLength = AESKeyLength + PageIVSeedLength + HMACKeyLength + BlockCipherIVLength // EEKCiphertextLength is the length of the EEK ciphertext, which includes 16 bytes of // encryption info. EEKCiphertextLength = EEKLength + 16 // HMAC256Length is the byte length of an HMAC-256. HMAC256Length = sha256.Size )
field lengths
Variables ¶
var ( // ErrUnexpectedDocumentType indicates when a document type is not expected (e.g., a Page // when expecting an Entry). ErrUnexpectedDocumentType = errors.New("unexpected document type") // ErrUnknownDocumentType indicates when a document type is not known (usually, this // error should never actually be thrown). ErrUnknownDocumentType = errors.New("unknown document type") // ErrUnexpectedKey indicates when a key does not match the expected key (from GetKey) // for a given value. ErrUnexpectedKey = errors.New("unexpected key for value") // ErrMissingDocument indicates when a document is unexpectedly missing. ErrMissingDocument = errors.New("missing document") // ErrMissingEnvelope indicates when an envelope is unexpectedly missing. ErrMissingEnvelope = errors.New("missing envelope") // ErrMissingEntry indicates when an entry is unexpectedly missing. ErrMissingEntry = errors.New("missing entry") // ErrMissingPage indicates when a page is unexpectedly missing. ErrMissingPage = errors.New("missing page") // ErrZeroCreatedTime indicates when an entry's CreatedTime field is zero. ErrZeroCreatedTime = errors.New("created time is zero") // ErrDiffAuthorPubs indicates when the author public keys of an entry and its page differ. ErrDiffAuthorPubs = errors.New("page and entry have different author public keys") // ErrMissingPageKeys indicates when the PageKeys of an entry are unexpectedly missing. ErrMissingPageKeys = errors.New("missing page keys") // ErrEmptyPageKeys indicates when the PageKeys of an entry are unexpectedly zero-length. ErrEmptyPageKeys = errors.New("empty page keys") )
var ( // ErrMissingMediaType indicates when metadata has zero-valued MediaType. ErrMissingMediaType = errors.New("missing MediaType") // ErrMissingCiphertextSize indicates when metadata has zero-valued CiphertextSize. ErrMissingCiphertextSize = errors.New("missing CiphertextSize") // ErrMissingUncompressedSize indicates when metadata has zero-valued UncompressedSize. ErrMissingUncompressedSize = errors.New("missing UncompressedSize") )
var ( // ErrEmptySubscriptionFilters indicates when a *Subscription has an empty author or reader // public key filter. ErrEmptySubscriptionFilters = errors.New("subscription has empty filters") // ErrMissingSubscription indicates when a Subscription is unexpectedly nil. ErrMissingSubscription = errors.New("missing Subscription") // ErrMissingPublication indicates when a Publication is unexpectedly nil. ErrMissingPublication = errors.New("missing Publication") )
var CompressionCodec_name = map[int32]string{
0: "NONE",
1: "GZIP",
}
var CompressionCodec_value = map[string]int32{
"NONE": 0,
"GZIP": 1,
}
var ( // Endpoints is a list of all the librarian endpoints (not including All). Endpoints = []Endpoint{Introduce, Find, Store, Verify, Get, Put, Subscribe} )
var PutOperation_name = map[int32]string{
0: "STORED",
1: "LEFT_EXISTING",
}
var PutOperation_value = map[string]int32{
"STORED": 0,
"LEFT_EXISTING": 1,
}
Functions ¶
func GetAuthorPub ¶
GetAuthorPub returns the author public key for a given document.
func GetEntryPageKeys ¶
GetEntryPageKeys returns the []id.ID page keys if the entry is multi-page. It returns nil for single-page entries.
func RegisterLibrarianServer ¶
func RegisterLibrarianServer(s *grpc.Server, srv LibrarianServer)
func ValidateAESKey ¶
ValidateAESKey checks the a value can be a 256-bit AES key.
func ValidateBytes ¶
ValidateBytes returns whether the byte slice is not empty and has an expected length.
func ValidateDocument ¶
ValidateDocument checks that all fields of a Document are populated and have the expected lengths.
func ValidateEntry ¶
ValidateEntry checks that all fields of an Entry are populated and have the expected byte lengths.
func ValidateEntryMetadata ¶ added in v0.2.0
func ValidateEntryMetadata(m *EntryMetadata) error
ValidateEntryMetadata checks that the metadata has all the required non-zero values.
func ValidateEnvelope ¶
ValidateEnvelope checks that all fields of an Envelope are populated and have the expected lengths.
func ValidateHMAC256 ¶
ValidateHMAC256 checks that a value can be an HMAC-256.
func ValidateHMACKey ¶
ValidateHMACKey checks that a value can be an HMAC-256 key.
func ValidateMetadataIV ¶
ValidateMetadataIV checks that a value can be a 12-byte GCM initialization vector.
func ValidateNotEmpty ¶
ValidateNotEmpty returns whether the byte slice is not empty.
func ValidatePage ¶
ValidatePage checks that all fields of a Page are populated and have the expected lengths.
func ValidatePageIVSeed ¶
ValidatePageIVSeed checks that a value can be a 256-bit initialization vector seed.
func ValidatePageKeys ¶
ValidatePageKeys checks that all fields of a PageKeys are populated and have the expected lengths.
func ValidatePublicKey ¶
ValidatePublicKey checks that a value can be a 256-bit elliptic curve public key.
func ValidatePublication ¶
func ValidatePublication(p *Publication) error
ValidatePublication validates that a publication has all fields of the correct length.
func ValidateSubscription ¶
func ValidateSubscription(s *Subscription) error
ValidateSubscription validates that a subscription is not missing any required fields. It returns nil if the subscription is valid.
Types ¶
type BloomFilter ¶
type BloomFilter struct { // using https://godoc.org/github.com/willf/bloom#BloomFilter.GobEncode Encoded []byte `protobuf:"bytes,1,opt,name=encoded,proto3" json:"encoded,omitempty"` }
func (*BloomFilter) Descriptor ¶
func (*BloomFilter) Descriptor() ([]byte, []int)
func (*BloomFilter) GetEncoded ¶
func (m *BloomFilter) GetEncoded() []byte
func (*BloomFilter) ProtoMessage ¶
func (*BloomFilter) ProtoMessage()
func (*BloomFilter) Reset ¶
func (m *BloomFilter) Reset()
func (*BloomFilter) String ¶
func (m *BloomFilter) String() string
type CompressionCodec ¶ added in v0.2.0
type CompressionCodec int32
CompressionCodec denotes whether and how the plaintext is compressed before encryption.
const ( CompressionCodec_NONE CompressionCodec = 0 CompressionCodec_GZIP CompressionCodec = 1 )
func (CompressionCodec) EnumDescriptor ¶ added in v0.2.0
func (CompressionCodec) EnumDescriptor() ([]byte, []int)
func (CompressionCodec) String ¶ added in v0.2.0
func (x CompressionCodec) String() string
type Document ¶
type Document struct { // Types that are valid to be assigned to Contents: // *Document_Envelope // *Document_Entry // *Document_Page Contents isDocument_Contents `protobuf_oneof:"contents"` }
Document contains either an Envelope, Entry, or Page message.
func GetPageDocument ¶
GetPageDocument wraps a Page into a Document, returning it and its key.
func NewTestDocument ¶
NewTestDocument generates a dummy Entry document for use in testing.
func (*Document) Descriptor ¶
func (*Document) GetContents ¶
func (m *Document) GetContents() isDocument_Contents
func (*Document) GetEnvelope ¶
func (*Document) ProtoMessage ¶
func (*Document) ProtoMessage()
type Document_Entry ¶
type Document_Entry struct {
Entry *Entry `protobuf:"bytes,2,opt,name=entry,oneof"`
}
type Document_Envelope ¶
type Document_Envelope struct {
Envelope *Envelope `protobuf:"bytes,1,opt,name=envelope,oneof"`
}
type Document_Page ¶
type Document_Page struct {
Page *Page `protobuf:"bytes,3,opt,name=page,oneof"`
}
type Endpoint ¶ added in v0.4.0
type Endpoint int
Endpoint defines an enum for the librarian API endpoints.
const ( // All represents all endpoints, usually used when aggregating counts across all endpoints. All Endpoint = iota - 1 // Introduce represents the Introduce endpoint. Introduce // Find represents the Introduce endpoint. Find // Store represents the Introduce endpoint. Store // Verify represents the Introduce endpoint. Verify // Get represents the Introduce endpoint. Get // Put represents the Introduce endpoint. Put // Subscribe represents the Introduce endpoint. Subscribe )
type Entry ¶
type Entry struct { // ECDSA public key of the entry author AuthorPublicKey []byte `protobuf:"bytes,1,opt,name=author_public_key,json=authorPublicKey,proto3" json:"author_public_key,omitempty"` // single-page contents of the entry, set when page_keys is not set Page *Page `protobuf:"bytes,2,opt,name=page" json:"page,omitempty"` // multi-page contents of the entry, set when page is not set PageKeys [][]byte `protobuf:"bytes,3,rep,name=page_keys,json=pageKeys,proto3" json:"page_keys,omitempty"` // created epoch time (seconds since 1970-01-01) CreatedTime uint32 `protobuf:"varint,4,opt,name=created_time,json=createdTime" json:"created_time,omitempty"` // ciphertext of marshalled EntryMetadata message properties MetadataCiphertext []byte `protobuf:"bytes,5,opt,name=metadata_ciphertext,json=metadataCiphertext,proto3" json:"metadata_ciphertext,omitempty"` // 32-byte MAC of metatadata ciphertext, encrypted with the 32-byte Entry AES-256 key and // 12-byte metadata block cipher IV MetadataCiphertextMac []byte `` /* 126-byte string literal not displayed */ }
Entry is the main unit of storage in the Libri network.
func NewTestMultiPageEntry ¶
NewTestMultiPageEntry generates a dummy Entry document with two page keys for use in testing.
func NewTestSinglePageEntry ¶
NewTestSinglePageEntry generates a dummy Entry document with a single Page for use in testing.
func (*Entry) Descriptor ¶
func (*Entry) GetAuthorPublicKey ¶
func (*Entry) GetCreatedTime ¶
func (*Entry) GetMetadataCiphertext ¶
func (*Entry) GetMetadataCiphertextMac ¶
func (*Entry) GetPageKeys ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
type EntryMetadata ¶ added in v0.2.0
type EntryMetadata struct { // media/MIME type of the data MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType" json:"media_type,omitempty"` // codec used to compress the data CompressionCodec CompressionCodec `` /* 129-byte string literal not displayed */ // total ciphertext size across all pages CiphertextSize uint64 `protobuf:"varint,3,opt,name=ciphertext_size,json=ciphertextSize" json:"ciphertext_size,omitempty"` // MAC of the entire ciphertext CiphertextMac []byte `protobuf:"bytes,4,opt,name=ciphertext_mac,json=ciphertextMac,proto3" json:"ciphertext_mac,omitempty"` // total size of the entire uncompressed entry UncompressedSize uint64 `protobuf:"varint,5,opt,name=uncompressed_size,json=uncompressedSize" json:"uncompressed_size,omitempty"` // MAC of the entire uncompressed entry UncompressedMac []byte `protobuf:"bytes,6,opt,name=uncompressed_mac,json=uncompressedMac,proto3" json:"uncompressed_mac,omitempty"` // domain-specific metadata Properties map[string][]byte `` /* 147-byte string literal not displayed */ // (relative) filepath of the data contained in the entry Filepath string `protobuf:"bytes,8,opt,name=filepath" json:"filepath,omitempty"` // schema of the entry plaintext Schema *SchemaArtifact `protobuf:"bytes,9,opt,name=schema" json:"schema,omitempty"` // data dictionary of the entry plaintext DataDictionary *SchemaArtifact `protobuf:"bytes,10,opt,name=dataDictionary" json:"dataDictionary,omitempty"` }
EntryMetadata contains metadata for an entry.
func (*EntryMetadata) Descriptor ¶ added in v0.2.0
func (*EntryMetadata) Descriptor() ([]byte, []int)
func (*EntryMetadata) GetCiphertextMac ¶ added in v0.2.0
func (m *EntryMetadata) GetCiphertextMac() []byte
func (*EntryMetadata) GetCiphertextSize ¶ added in v0.2.0
func (m *EntryMetadata) GetCiphertextSize() uint64
func (*EntryMetadata) GetCompressionCodec ¶ added in v0.2.0
func (m *EntryMetadata) GetCompressionCodec() CompressionCodec
func (*EntryMetadata) GetDataDictionary ¶ added in v0.2.0
func (m *EntryMetadata) GetDataDictionary() *SchemaArtifact
func (*EntryMetadata) GetFilepath ¶ added in v0.2.0
func (m *EntryMetadata) GetFilepath() string
func (*EntryMetadata) GetMediaType ¶ added in v0.2.0
func (m *EntryMetadata) GetMediaType() string
func (*EntryMetadata) GetProperties ¶ added in v0.2.0
func (m *EntryMetadata) GetProperties() map[string][]byte
func (*EntryMetadata) GetSchema ¶ added in v0.2.0
func (m *EntryMetadata) GetSchema() *SchemaArtifact
func (*EntryMetadata) GetUncompressedMac ¶ added in v0.2.0
func (m *EntryMetadata) GetUncompressedMac() []byte
func (*EntryMetadata) GetUncompressedSize ¶ added in v0.2.0
func (m *EntryMetadata) GetUncompressedSize() uint64
func (*EntryMetadata) MarshalLogObject ¶ added in v0.2.0
func (m *EntryMetadata) MarshalLogObject(oe zapcore.ObjectEncoder) error
MarshalLogObject converts the metadata into an object (which will become json) for logging.
func (*EntryMetadata) ProtoMessage ¶ added in v0.2.0
func (*EntryMetadata) ProtoMessage()
func (*EntryMetadata) Reset ¶ added in v0.2.0
func (m *EntryMetadata) Reset()
func (*EntryMetadata) String ¶ added in v0.2.0
func (m *EntryMetadata) String() string
type Envelope ¶
type Envelope struct { // 32-byte key of the Entry whose encryption keys are being sent EntryKey []byte `protobuf:"bytes,1,opt,name=entry_key,json=entryKey,proto3" json:"entry_key,omitempty"` // ECDH public key of the entry author/sender AuthorPublicKey []byte `protobuf:"bytes,2,opt,name=author_public_key,json=authorPublicKey,proto3" json:"author_public_key,omitempty"` // ECDH public key of the entry reader/recipient ReaderPublicKey []byte `protobuf:"bytes,3,opt,name=reader_public_key,json=readerPublicKey,proto3" json:"reader_public_key,omitempty"` // ciphertext of 108-byte entry encryption key (EEK), encrypted with a KEK from the shared // ECDH shared secret EekCiphertext []byte `protobuf:"bytes,4,opt,name=eek_ciphertext,json=eekCiphertext,proto3" json:"eek_ciphertext,omitempty"` // 32-byte MAC of the EEK EekCiphertextMac []byte `protobuf:"bytes,5,opt,name=eek_ciphertext_mac,json=eekCiphertextMac,proto3" json:"eek_ciphertext_mac,omitempty"` }
Envelope defines the public keys an author uses to share an entry encryption key with a particular reader. The shared ECDH secret is used with a key derivation function to generate the key encryption key (KEK), which contains 2 sub-keys: 1) 32-byte AES-256 key, used for encrypting/decrypting the entry encryption key (EEK) 2) 12-byte EEK block cipher initialization vector 3) 32-byte HMAC-256 key, used for EEK MAC
This AES-256 EEK is then used to decrypt the EEK ciphertext, which contains 4 sub-keys: 1) 32-byte AES-256 key, used to enrypt Pages and Entry metadata 2) 32-byte Page initialization vector (IV) seed 3) 32-byte HMAC-256 key 4) 12-byte metadata block cipher initialization vector
func NewTestEnvelope ¶
NewTestEnvelope generates a dummy Envelope document for use in testing.
func (*Envelope) Descriptor ¶
func (*Envelope) GetAuthorPublicKey ¶
func (*Envelope) GetEekCiphertext ¶
func (*Envelope) GetEekCiphertextMac ¶
func (*Envelope) GetEntryKey ¶
func (*Envelope) GetReaderPublicKey ¶
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
type FindRequest ¶
type FindRequest struct { Metadata *RequestMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // 32-byte target to find peers around Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // the number of closests peers to return NumPeers uint32 `protobuf:"varint,3,opt,name=num_peers,json=numPeers" json:"num_peers,omitempty"` }
func (*FindRequest) Descriptor ¶
func (*FindRequest) Descriptor() ([]byte, []int)
func (*FindRequest) GetKey ¶
func (m *FindRequest) GetKey() []byte
func (*FindRequest) GetMetadata ¶
func (m *FindRequest) GetMetadata() *RequestMetadata
func (*FindRequest) GetNumPeers ¶
func (m *FindRequest) GetNumPeers() uint32
func (*FindRequest) ProtoMessage ¶
func (*FindRequest) ProtoMessage()
func (*FindRequest) Reset ¶
func (m *FindRequest) Reset()
func (*FindRequest) String ¶
func (m *FindRequest) String() string
type FindResponse ¶
type FindResponse struct { Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // list of peers closest to target Peers []*PeerAddress `protobuf:"bytes,2,rep,name=peers" json:"peers,omitempty"` // value, if found Value *Document `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` }
func (*FindResponse) Descriptor ¶
func (*FindResponse) Descriptor() ([]byte, []int)
func (*FindResponse) GetMetadata ¶
func (m *FindResponse) GetMetadata() *ResponseMetadata
func (*FindResponse) GetPeers ¶
func (m *FindResponse) GetPeers() []*PeerAddress
func (*FindResponse) GetValue ¶
func (m *FindResponse) GetValue() *Document
func (*FindResponse) ProtoMessage ¶
func (*FindResponse) ProtoMessage()
func (*FindResponse) Reset ¶
func (m *FindResponse) Reset()
func (*FindResponse) String ¶
func (m *FindResponse) String() string
type Finder ¶
type Finder interface { // Find returns the value for a key or the closest peers to it. Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindResponse, error) }
Finder issues Find queries.
type GetRequest ¶
type GetRequest struct { Metadata *RequestMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // 32-byte key of document to get Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` }
func (*GetRequest) Descriptor ¶
func (*GetRequest) Descriptor() ([]byte, []int)
func (*GetRequest) GetKey ¶
func (m *GetRequest) GetKey() []byte
func (*GetRequest) GetMetadata ¶
func (m *GetRequest) GetMetadata() *RequestMetadata
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) Reset ¶
func (m *GetRequest) Reset()
func (*GetRequest) String ¶
func (m *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // value to store for key Value *Document `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` }
func (*GetResponse) Descriptor ¶
func (*GetResponse) Descriptor() ([]byte, []int)
func (*GetResponse) GetMetadata ¶
func (m *GetResponse) GetMetadata() *ResponseMetadata
func (*GetResponse) GetValue ¶
func (m *GetResponse) GetValue() *Document
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) Reset ¶
func (m *GetResponse) Reset()
func (*GetResponse) String ¶
func (m *GetResponse) String() string
type Getter ¶
type Getter interface { // Get retrieves a value, if it exists. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) }
Getter issues Get queries.
type IntroduceRequest ¶
type IntroduceRequest struct { Metadata *RequestMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // info about the peer making the introduction Self *PeerAddress `protobuf:"bytes,2,opt,name=self" json:"self,omitempty"` // number of peer librarians to request info for NumPeers uint32 `protobuf:"varint,3,opt,name=num_peers,json=numPeers" json:"num_peers,omitempty"` }
func (*IntroduceRequest) Descriptor ¶
func (*IntroduceRequest) Descriptor() ([]byte, []int)
func (*IntroduceRequest) GetMetadata ¶
func (m *IntroduceRequest) GetMetadata() *RequestMetadata
func (*IntroduceRequest) GetNumPeers ¶
func (m *IntroduceRequest) GetNumPeers() uint32
func (*IntroduceRequest) GetSelf ¶
func (m *IntroduceRequest) GetSelf() *PeerAddress
func (*IntroduceRequest) ProtoMessage ¶
func (*IntroduceRequest) ProtoMessage()
func (*IntroduceRequest) Reset ¶
func (m *IntroduceRequest) Reset()
func (*IntroduceRequest) String ¶
func (m *IntroduceRequest) String() string
type IntroduceResponse ¶
type IntroduceResponse struct { Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // info about the peer receiving the introduction Self *PeerAddress `protobuf:"bytes,2,opt,name=self" json:"self,omitempty"` // info about other peers Peers []*PeerAddress `protobuf:"bytes,3,rep,name=peers" json:"peers,omitempty"` }
func (*IntroduceResponse) Descriptor ¶
func (*IntroduceResponse) Descriptor() ([]byte, []int)
func (*IntroduceResponse) GetMetadata ¶
func (m *IntroduceResponse) GetMetadata() *ResponseMetadata
func (*IntroduceResponse) GetPeers ¶
func (m *IntroduceResponse) GetPeers() []*PeerAddress
func (*IntroduceResponse) GetSelf ¶
func (m *IntroduceResponse) GetSelf() *PeerAddress
func (*IntroduceResponse) ProtoMessage ¶
func (*IntroduceResponse) ProtoMessage()
func (*IntroduceResponse) Reset ¶
func (m *IntroduceResponse) Reset()
func (*IntroduceResponse) String ¶
func (m *IntroduceResponse) String() string
type Introducer ¶
type Introducer interface { // Introduce identifies the node by name and ID. Introduce(ctx context.Context, in *IntroduceRequest, opts ...grpc.CallOption) ( *IntroduceResponse, error) }
Introducer issues Introduce queries.
type LibrarianClient ¶
type LibrarianClient interface { // Introduce identifies the node by name and ID. Introduce(ctx context.Context, in *IntroduceRequest, opts ...grpc.CallOption) (*IntroduceResponse, error) // Find returns the value for a key or the closest peers to it. Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindResponse, error) // Verify checks that a peer has the value for a given key or returns the closest peers to // that value. Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) // Store stores a value in a given key. Store(ctx context.Context, in *StoreRequest, opts ...grpc.CallOption) (*StoreResponse, error) // Get retrieves a value, if it exists. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Put stores a value. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // Subscribe streams Publications to the client per a subscription filter. Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Librarian_SubscribeClient, error) }
func NewLibrarianClient ¶
func NewLibrarianClient(cc *grpc.ClientConn) LibrarianClient
type LibrarianServer ¶
type LibrarianServer interface { // Introduce identifies the node by name and ID. Introduce(context.Context, *IntroduceRequest) (*IntroduceResponse, error) // Find returns the value for a key or the closest peers to it. Find(context.Context, *FindRequest) (*FindResponse, error) // Verify checks that a peer has the value for a given key or returns the closest peers to // that value. Verify(context.Context, *VerifyRequest) (*VerifyResponse, error) // Store stores a value in a given key. Store(context.Context, *StoreRequest) (*StoreResponse, error) // Get retrieves a value, if it exists. Get(context.Context, *GetRequest) (*GetResponse, error) // Put stores a value. Put(context.Context, *PutRequest) (*PutResponse, error) // Subscribe streams Publications to the client per a subscription filter. Subscribe(*SubscribeRequest, Librarian_SubscribeServer) error }
type Librarian_SubscribeClient ¶
type Librarian_SubscribeClient interface { Recv() (*SubscribeResponse, error) grpc.ClientStream }
type Librarian_SubscribeServer ¶
type Librarian_SubscribeServer interface { Send(*SubscribeResponse) error grpc.ServerStream }
type Page ¶
type Page struct { // ECDSA public key of the entry author AuthorPublicKey []byte `protobuf:"bytes,1,opt,name=author_public_key,json=authorPublicKey,proto3" json:"author_public_key,omitempty"` // index of Page within Entry contents Index uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` // ciphertext of Page contents, encrypted using the 32-byte AES-256 key with the block cipher // initialized by the first 12 bytes of HMAC-256(IV seed, page index) Ciphertext []byte `protobuf:"bytes,3,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` // 32-byte MAC of ciphertext using the 32-byte Page ciphertext HMAC-256 key CiphertextMac []byte `protobuf:"bytes,4,opt,name=ciphertext_mac,json=ciphertextMac,proto3" json:"ciphertext_mac,omitempty"` }
Page is a portion (possibly all) of an Entry document.
func NewTestPage ¶
NewTestPage generates a dummy Page for use in testing.
func (*Page) Descriptor ¶
func (*Page) GetAuthorPublicKey ¶
func (*Page) GetCiphertext ¶
func (*Page) GetCiphertextMac ¶
func (*Page) ProtoMessage ¶
func (*Page) ProtoMessage()
type PeerAddress ¶
type PeerAddress struct { // 32-byte peer ID PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // self-reported name of the peer PeerName string `protobuf:"bytes,2,opt,name=peer_name,json=peerName" json:"peer_name,omitempty"` // public IP address Ip string `protobuf:"bytes,3,opt,name=ip" json:"ip,omitempty"` // public address TCP port Port uint32 `protobuf:"varint,4,opt,name=port" json:"port,omitempty"` }
func (*PeerAddress) Descriptor ¶
func (*PeerAddress) Descriptor() ([]byte, []int)
func (*PeerAddress) GetIp ¶
func (m *PeerAddress) GetIp() string
func (*PeerAddress) GetPeerId ¶
func (m *PeerAddress) GetPeerId() []byte
func (*PeerAddress) GetPeerName ¶
func (m *PeerAddress) GetPeerName() string
func (*PeerAddress) GetPort ¶
func (m *PeerAddress) GetPort() uint32
func (*PeerAddress) ProtoMessage ¶
func (*PeerAddress) ProtoMessage()
func (*PeerAddress) Reset ¶
func (m *PeerAddress) Reset()
func (*PeerAddress) String ¶
func (m *PeerAddress) String() string
type Publication ¶
type Publication struct { EnvelopeKey []byte `protobuf:"bytes,1,opt,name=envelope_key,json=envelopeKey,proto3" json:"envelope_key,omitempty"` EntryKey []byte `protobuf:"bytes,2,opt,name=entry_key,json=entryKey,proto3" json:"entry_key,omitempty"` AuthorPublicKey []byte `protobuf:"bytes,3,opt,name=author_public_key,json=authorPublicKey,proto3" json:"author_public_key,omitempty"` ReaderPublicKey []byte `protobuf:"bytes,4,opt,name=reader_public_key,json=readerPublicKey,proto3" json:"reader_public_key,omitempty"` }
func GetPublication ¶
func GetPublication(key []byte, value *Document) *Publication
GetPublication returns a *Publication object if one can be made from the given document key and value. If not, it returns nil.
func NewTestPublication ¶
func NewTestPublication(rng *rand.Rand) *Publication
NewTestPublication generates a dummy Publication for use in testing.
func (*Publication) Descriptor ¶
func (*Publication) Descriptor() ([]byte, []int)
func (*Publication) GetAuthorPublicKey ¶
func (m *Publication) GetAuthorPublicKey() []byte
func (*Publication) GetEntryKey ¶
func (m *Publication) GetEntryKey() []byte
func (*Publication) GetEnvelopeKey ¶
func (m *Publication) GetEnvelopeKey() []byte
func (*Publication) GetReaderPublicKey ¶
func (m *Publication) GetReaderPublicKey() []byte
func (*Publication) ProtoMessage ¶
func (*Publication) ProtoMessage()
func (*Publication) Reset ¶
func (m *Publication) Reset()
func (*Publication) String ¶
func (m *Publication) String() string
type PutOperation ¶
type PutOperation int32
const ( // new value was added PutOperation_STORED PutOperation = 0 // value already existed PutOperation_LEFT_EXISTING PutOperation = 1 )
func (PutOperation) EnumDescriptor ¶
func (PutOperation) EnumDescriptor() ([]byte, []int)
func (PutOperation) String ¶
func (x PutOperation) String() string
type PutRequest ¶
type PutRequest struct { Metadata *RequestMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // key to store value under Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // value to store for key Value *Document `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` }
func (*PutRequest) Descriptor ¶
func (*PutRequest) Descriptor() ([]byte, []int)
func (*PutRequest) GetKey ¶
func (m *PutRequest) GetKey() []byte
func (*PutRequest) GetMetadata ¶
func (m *PutRequest) GetMetadata() *RequestMetadata
func (*PutRequest) GetValue ¶
func (m *PutRequest) GetValue() *Document
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) Reset ¶
func (m *PutRequest) Reset()
func (*PutRequest) String ¶
func (m *PutRequest) String() string
type PutResponse ¶
type PutResponse struct { Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // result of the put operation Operation PutOperation `protobuf:"varint,2,opt,name=operation,enum=api.PutOperation" json:"operation,omitempty"` // number of replicas of the stored value; only populated for operation = STORED NReplicas uint32 `protobuf:"varint,3,opt,name=n_replicas,json=nReplicas" json:"n_replicas,omitempty"` }
func (*PutResponse) Descriptor ¶
func (*PutResponse) Descriptor() ([]byte, []int)
func (*PutResponse) GetMetadata ¶
func (m *PutResponse) GetMetadata() *ResponseMetadata
func (*PutResponse) GetNReplicas ¶
func (m *PutResponse) GetNReplicas() uint32
func (*PutResponse) GetOperation ¶
func (m *PutResponse) GetOperation() PutOperation
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) Reset ¶
func (m *PutResponse) Reset()
func (*PutResponse) String ¶
func (m *PutResponse) String() string
type Putter ¶
type Putter interface { // Put stores a value. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) }
Putter issues Put queries.
type PutterGetter ¶
PutterGetter issues Put and Get queries.
type RequestMetadata ¶
type RequestMetadata struct { // 32-byte unique request ID RequestId []byte `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // peer ECDSA public key PubKey []byte `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` // (optional) organization ECDSA public key OrgPubKey []byte `protobuf:"bytes,3,opt,name=org_pub_key,json=orgPubKey,proto3" json:"org_pub_key,omitempty"` }
RequestMetadata defines metadata associated with every request.
func (*RequestMetadata) Descriptor ¶
func (*RequestMetadata) Descriptor() ([]byte, []int)
func (*RequestMetadata) GetOrgPubKey ¶ added in v0.5.0
func (m *RequestMetadata) GetOrgPubKey() []byte
func (*RequestMetadata) GetPubKey ¶
func (m *RequestMetadata) GetPubKey() []byte
func (*RequestMetadata) GetRequestId ¶
func (m *RequestMetadata) GetRequestId() []byte
func (*RequestMetadata) ProtoMessage ¶
func (*RequestMetadata) ProtoMessage()
func (*RequestMetadata) Reset ¶
func (m *RequestMetadata) Reset()
func (*RequestMetadata) String ¶
func (m *RequestMetadata) String() string
type ResponseMetadata ¶
type ResponseMetadata struct { // 32-byte request ID that generated this response RequestId []byte `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // peer ECDSA public key PubKey []byte `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` // (optional) organization ECDSA public key OrgPubKey []byte `protobuf:"bytes,3,opt,name=org_pub_key,json=orgPubKey,proto3" json:"org_pub_key,omitempty"` }
func (*ResponseMetadata) Descriptor ¶
func (*ResponseMetadata) Descriptor() ([]byte, []int)
func (*ResponseMetadata) GetOrgPubKey ¶ added in v0.5.0
func (m *ResponseMetadata) GetOrgPubKey() []byte
func (*ResponseMetadata) GetPubKey ¶
func (m *ResponseMetadata) GetPubKey() []byte
func (*ResponseMetadata) GetRequestId ¶
func (m *ResponseMetadata) GetRequestId() []byte
func (*ResponseMetadata) ProtoMessage ¶
func (*ResponseMetadata) ProtoMessage()
func (*ResponseMetadata) Reset ¶
func (m *ResponseMetadata) Reset()
func (*ResponseMetadata) String ¶
func (m *ResponseMetadata) String() string
type SchemaArtifact ¶ added in v0.2.0
type SchemaArtifact struct { // group owning the schema (commonly a Github user, e.g., 'drausin') Group string `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` // project in which schema resides (commonly a Github project, e.g., 'libri') Project string `protobuf:"bytes,2,opt,name=project" json:"project,omitempty"` // path to schema file within project (e.g., 'libri/librarian/api/documents.proto') Path string `protobuf:"bytes,3,opt,name=path" json:"path,omitempty"` // (optional) name of schema within file (e.g., 'EntrySchema') Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` // version of schema (commonly a semver tag, e.g., '0.1.0') Version string `protobuf:"bytes,5,opt,name=version" json:"version,omitempty"` }
SchemaArtifact denotes the schema artifact associated with the serialized plaintext of a particular entry. Artifacts can mainly be two separate types:
- schema: can be of any type (e.g., proto, avro, json, XML, XSD, etc) that minimally describe the format of the data and optionally/preferably also include the data dictionary (i.e., the semantic meaning of the schema components) as well.
- data dictionary: when the schema is broad/loose (as is the case in some standard data formats like HL7), this additional documentation adds clarity about the semantic meaning/use of each field. For example, a schema may contain two similar fields, A1 and A2, and one entry data producer may store a value in A1, whereas another producer may store the same semantic value in A2. The schema for both messages is the same, but the schema interpretation is different.
New schemas should obviously be as well-defined and unambiguous as possible, but many legacy data formats require additional interpretation. Clients can choose to do what they want with the schema and data dictionary, but commonly they will have combinations of these that they know how to handle explicitly.
Preferred formats:
- schema: Protobuf
- data dictionary: Markdown
func (*SchemaArtifact) Descriptor ¶ added in v0.2.0
func (*SchemaArtifact) Descriptor() ([]byte, []int)
func (*SchemaArtifact) GetGroup ¶ added in v0.2.0
func (m *SchemaArtifact) GetGroup() string
func (*SchemaArtifact) GetName ¶ added in v0.2.0
func (m *SchemaArtifact) GetName() string
func (*SchemaArtifact) GetPath ¶ added in v0.2.0
func (m *SchemaArtifact) GetPath() string
func (*SchemaArtifact) GetProject ¶ added in v0.2.0
func (m *SchemaArtifact) GetProject() string
func (*SchemaArtifact) GetVersion ¶ added in v0.2.0
func (m *SchemaArtifact) GetVersion() string
func (*SchemaArtifact) ProtoMessage ¶ added in v0.2.0
func (*SchemaArtifact) ProtoMessage()
func (*SchemaArtifact) Reset ¶ added in v0.2.0
func (m *SchemaArtifact) Reset()
func (*SchemaArtifact) String ¶ added in v0.2.0
func (m *SchemaArtifact) String() string
type StoreRequest ¶
type StoreRequest struct { Metadata *RequestMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // key to store value under Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // value to store for key Value *Document `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` }
func (*StoreRequest) Descriptor ¶
func (*StoreRequest) Descriptor() ([]byte, []int)
func (*StoreRequest) GetKey ¶
func (m *StoreRequest) GetKey() []byte
func (*StoreRequest) GetMetadata ¶
func (m *StoreRequest) GetMetadata() *RequestMetadata
func (*StoreRequest) GetValue ¶
func (m *StoreRequest) GetValue() *Document
func (*StoreRequest) ProtoMessage ¶
func (*StoreRequest) ProtoMessage()
func (*StoreRequest) Reset ¶
func (m *StoreRequest) Reset()
func (*StoreRequest) String ¶
func (m *StoreRequest) String() string
type StoreResponse ¶
type StoreResponse struct {
Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
}
func (*StoreResponse) Descriptor ¶
func (*StoreResponse) Descriptor() ([]byte, []int)
func (*StoreResponse) GetMetadata ¶
func (m *StoreResponse) GetMetadata() *ResponseMetadata
func (*StoreResponse) ProtoMessage ¶
func (*StoreResponse) ProtoMessage()
func (*StoreResponse) Reset ¶
func (m *StoreResponse) Reset()
func (*StoreResponse) String ¶
func (m *StoreResponse) String() string
type Storer ¶
type Storer interface { // Store stores a value in a given key. Store(ctx context.Context, in *StoreRequest, opts ...grpc.CallOption) (*StoreResponse, error) }
Storer issues Store queries.
type SubscribeRequest ¶
type SubscribeRequest struct { Metadata *RequestMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` Subscription *Subscription `protobuf:"bytes,2,opt,name=subscription" json:"subscription,omitempty"` }
func (*SubscribeRequest) Descriptor ¶
func (*SubscribeRequest) Descriptor() ([]byte, []int)
func (*SubscribeRequest) GetMetadata ¶
func (m *SubscribeRequest) GetMetadata() *RequestMetadata
func (*SubscribeRequest) GetSubscription ¶
func (m *SubscribeRequest) GetSubscription() *Subscription
func (*SubscribeRequest) ProtoMessage ¶
func (*SubscribeRequest) ProtoMessage()
func (*SubscribeRequest) Reset ¶
func (m *SubscribeRequest) Reset()
func (*SubscribeRequest) String ¶
func (m *SubscribeRequest) String() string
type SubscribeResponse ¶
type SubscribeResponse struct { Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Value *Publication `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` }
func (*SubscribeResponse) Descriptor ¶
func (*SubscribeResponse) Descriptor() ([]byte, []int)
func (*SubscribeResponse) GetKey ¶
func (m *SubscribeResponse) GetKey() []byte
func (*SubscribeResponse) GetMetadata ¶
func (m *SubscribeResponse) GetMetadata() *ResponseMetadata
func (*SubscribeResponse) GetValue ¶
func (m *SubscribeResponse) GetValue() *Publication
func (*SubscribeResponse) ProtoMessage ¶
func (*SubscribeResponse) ProtoMessage()
func (*SubscribeResponse) Reset ¶
func (m *SubscribeResponse) Reset()
func (*SubscribeResponse) String ¶
func (m *SubscribeResponse) String() string
type Subscriber ¶
type Subscriber interface { // Subscribe subscribes to a defined publication stream. Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) ( Librarian_SubscribeClient, error) }
Subscriber issues Subscribe queries.
type Subscription ¶
type Subscription struct { AuthorPublicKeys *BloomFilter `protobuf:"bytes,1,opt,name=author_public_keys,json=authorPublicKeys" json:"author_public_keys,omitempty"` ReaderPublicKeys *BloomFilter `protobuf:"bytes,2,opt,name=reader_public_keys,json=readerPublicKeys" json:"reader_public_keys,omitempty"` }
func (*Subscription) Descriptor ¶
func (*Subscription) Descriptor() ([]byte, []int)
func (*Subscription) GetAuthorPublicKeys ¶
func (m *Subscription) GetAuthorPublicKeys() *BloomFilter
func (*Subscription) GetReaderPublicKeys ¶
func (m *Subscription) GetReaderPublicKeys() *BloomFilter
func (*Subscription) ProtoMessage ¶
func (*Subscription) ProtoMessage()
func (*Subscription) Reset ¶
func (m *Subscription) Reset()
func (*Subscription) String ¶
func (m *Subscription) String() string
type Verifier ¶
type Verifier interface { // Verify verifies that a peer has a given value. Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) }
Verifier issues Verify queries.
type VerifyRequest ¶
type VerifyRequest struct { Metadata *RequestMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // 32-byte key of document to verify Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // 32-byte key to use in HMAC-256 verification MacKey []byte `protobuf:"bytes,3,opt,name=mac_key,json=macKey,proto3" json:"mac_key,omitempty"` // the number of closests peers to return NumPeers uint32 `protobuf:"varint,4,opt,name=num_peers,json=numPeers" json:"num_peers,omitempty"` }
func (*VerifyRequest) Descriptor ¶
func (*VerifyRequest) Descriptor() ([]byte, []int)
func (*VerifyRequest) GetKey ¶
func (m *VerifyRequest) GetKey() []byte
func (*VerifyRequest) GetMacKey ¶
func (m *VerifyRequest) GetMacKey() []byte
func (*VerifyRequest) GetMetadata ¶
func (m *VerifyRequest) GetMetadata() *RequestMetadata
func (*VerifyRequest) GetNumPeers ¶
func (m *VerifyRequest) GetNumPeers() uint32
func (*VerifyRequest) ProtoMessage ¶
func (*VerifyRequest) ProtoMessage()
func (*VerifyRequest) Reset ¶
func (m *VerifyRequest) Reset()
func (*VerifyRequest) String ¶
func (m *VerifyRequest) String() string
type VerifyResponse ¶
type VerifyResponse struct { Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // nil if the peer does not have the document, otherwise the HMAC-256 of the document's // serialized bytes given the MAC key in the request Mac []byte `protobuf:"bytes,2,opt,name=mac,proto3" json:"mac,omitempty"` // list of peers closest to target Peers []*PeerAddress `protobuf:"bytes,3,rep,name=peers" json:"peers,omitempty"` }
func (*VerifyResponse) Descriptor ¶
func (*VerifyResponse) Descriptor() ([]byte, []int)
func (*VerifyResponse) GetMac ¶
func (m *VerifyResponse) GetMac() []byte
func (*VerifyResponse) GetMetadata ¶
func (m *VerifyResponse) GetMetadata() *ResponseMetadata
func (*VerifyResponse) GetPeers ¶
func (m *VerifyResponse) GetPeers() []*PeerAddress
func (*VerifyResponse) ProtoMessage ¶
func (*VerifyResponse) ProtoMessage()
func (*VerifyResponse) Reset ¶
func (m *VerifyResponse) Reset()
func (*VerifyResponse) String ¶
func (m *VerifyResponse) String() string