storage_proto

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package storage_proto is a generated protocol buffer package.

It is generated from these files:

kythe/proto/storage.proto

It has these top-level messages:

VName
VNameMask
Entry
Entries
ReadRequest
WriteRequest
WriteReply
ScanRequest
CountRequest
CountReply
ShardRequest
SearchRequest
SearchReply

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGraphStoreServer

func RegisterGraphStoreServer(s *grpc.Server, srv GraphStoreServer)

func RegisterSearchServiceServer

func RegisterSearchServiceServer(s *grpc.Server, srv SearchServiceServer)

func RegisterShardedGraphStoreServer

func RegisterShardedGraphStoreServer(s *grpc.Server, srv ShardedGraphStoreServer)

Types

type CountReply

type CountReply struct {
	// Total number of entries in the specified shard.
	Entries int64 `protobuf:"varint,1,opt,name=entries" json:"entries,omitempty"`
}

Response for a CountRequest

func (*CountReply) ProtoMessage

func (*CountReply) ProtoMessage()

func (*CountReply) Reset

func (m *CountReply) Reset()

func (*CountReply) String

func (m *CountReply) String() string

type CountRequest

type CountRequest struct {
	Index  int64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
	Shards int64 `protobuf:"varint,2,opt,name=shards" json:"shards,omitempty"`
}

Request for the size of the shard at the given index.

func (*CountRequest) ProtoMessage

func (*CountRequest) ProtoMessage()

func (*CountRequest) Reset

func (m *CountRequest) Reset()

func (*CountRequest) String

func (m *CountRequest) String() string

type Entries

type Entries struct {
	Entries []*Entry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"`
}

A collection of Entry instances.

func (*Entries) GetEntries

func (m *Entries) GetEntries() []*Entry

func (*Entries) ProtoMessage

func (*Entries) ProtoMessage()

func (*Entries) Reset

func (m *Entries) Reset()

func (*Entries) String

func (m *Entries) String() string

type Entry

type Entry struct {
	Source *VName `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"`
	// The following two fields must either be both empty, or both nonempty.
	EdgeKind string `protobuf:"bytes,2,opt,name=edge_kind" json:"edge_kind,omitempty"`
	Target   *VName `protobuf:"bytes,3,opt,name=target" json:"target,omitempty"`
	// The grammar for fact_name:
	//  name   = "/" | 1*path
	//  path   = "/" word
	//  word   = 1*{LETTER|DIGIT|PUNCT}
	//  LETTER = [A-Za-z]
	//  DIGIT  = [0-9]
	//  PUNCT  = [-.@#$%&_+:()]
	FactName  string `protobuf:"bytes,4,opt,name=fact_name" json:"fact_name,omitempty"`
	FactValue []byte `protobuf:"bytes,5,opt,name=fact_value,proto3" json:"fact_value,omitempty"`
}

An Entry associates a fact with a graph object (node or edge). This is the the primary unit of storage.

func (*Entry) GetSource

func (m *Entry) GetSource() *VName

func (*Entry) GetTarget

func (m *Entry) GetTarget() *VName

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) Reset

func (m *Entry) Reset()

func (*Entry) String

func (m *Entry) String() string

type GraphStoreClient

type GraphStoreClient interface {
	// Read responds with all Entry messages that match the given ReadRequest.
	// The Read operation should be implemented with time complexity proportional
	// to the size of the return set.
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (GraphStore_ReadClient, error)
	// Scan responds with all Entry messages matching the given ScanRequest.  If a
	// ScanRequest field is empty, any entry value for that field matches and will
	// be returned.  Scan is similar to Read, but with no time complexity
	// restrictions.
	Scan(ctx context.Context, in *ScanRequest, opts ...grpc.CallOption) (GraphStore_ScanClient, error)
	// Write atomically inserts or updates a collection of entries into the store.
	// Each update is a tuple of the form (kind, target, fact, value).  For each
	// such update, an entry (source, kind, target, fact, value) is written into
	// the store, replacing any existing entry (source, kind, target, fact,
	// value') that may exist.  Note that this operation cannot delete any data
	// from the store; entries are only ever inserted or updated.  Apart from
	// acting atomically, no other constraints are placed on the implementation.
	Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteReply, error)
}

func NewGraphStoreClient

func NewGraphStoreClient(cc *grpc.ClientConn) GraphStoreClient

type GraphStoreServer

type GraphStoreServer interface {
	// Read responds with all Entry messages that match the given ReadRequest.
	// The Read operation should be implemented with time complexity proportional
	// to the size of the return set.
	Read(*ReadRequest, GraphStore_ReadServer) error
	// Scan responds with all Entry messages matching the given ScanRequest.  If a
	// ScanRequest field is empty, any entry value for that field matches and will
	// be returned.  Scan is similar to Read, but with no time complexity
	// restrictions.
	Scan(*ScanRequest, GraphStore_ScanServer) error
	// Write atomically inserts or updates a collection of entries into the store.
	// Each update is a tuple of the form (kind, target, fact, value).  For each
	// such update, an entry (source, kind, target, fact, value) is written into
	// the store, replacing any existing entry (source, kind, target, fact,
	// value') that may exist.  Note that this operation cannot delete any data
	// from the store; entries are only ever inserted or updated.  Apart from
	// acting atomically, no other constraints are placed on the implementation.
	Write(context.Context, *WriteRequest) (*WriteReply, error)
}

type GraphStore_ReadClient

type GraphStore_ReadClient interface {
	Recv() (*Entry, error)
	grpc.ClientStream
}

type GraphStore_ReadServer

type GraphStore_ReadServer interface {
	Send(*Entry) error
	grpc.ServerStream
}

type GraphStore_ScanClient

type GraphStore_ScanClient interface {
	Recv() (*Entry, error)
	grpc.ClientStream
}

type GraphStore_ScanServer

type GraphStore_ScanServer interface {
	Send(*Entry) error
	grpc.ServerStream
}

type ReadRequest

type ReadRequest struct {
	// Return entries having this source VName, which may not be empty.
	Source *VName `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"`
	// Return entries having this edge kind; if empty, only entries with an empty
	// edge kind are returned; if "*", entries of any edge kind are returned.
	EdgeKind string `protobuf:"bytes,2,opt,name=edge_kind" json:"edge_kind,omitempty"`
}

Request for a stream of Entry objects from a GraphStore. Read operations should be implemented with time complexity proportional to the size of the return set.

func (*ReadRequest) GetSource

func (m *ReadRequest) GetSource() *VName

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) Reset

func (m *ReadRequest) Reset()

func (*ReadRequest) String

func (m *ReadRequest) String() string

type ScanRequest

type ScanRequest struct {
	// Return entries having this target VName; if empty, any target field is
	// matched, including empty.
	Target *VName `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"`
	// Return entries having this kind; if empty, any kind is matched, including
	// empty.
	EdgeKind string `protobuf:"bytes,2,opt,name=edge_kind" json:"edge_kind,omitempty"`
	// Return entries having fact labels with this prefix; if empty, any fact
	// label is matched,
	FactPrefix string `protobuf:"bytes,3,opt,name=fact_prefix" json:"fact_prefix,omitempty"`
}

Request for a stream of Entry objects resulting from a full scan of a GraphStore.

func (*ScanRequest) GetTarget

func (m *ScanRequest) GetTarget() *VName

func (*ScanRequest) ProtoMessage

func (*ScanRequest) ProtoMessage()

func (*ScanRequest) Reset

func (m *ScanRequest) Reset()

func (*ScanRequest) String

func (m *ScanRequest) String() string

type SearchReply

type SearchReply struct {
	// Set of node tickets matching a given SearchRequest.
	Ticket []string `protobuf:"bytes,1,rep,name=ticket" json:"ticket,omitempty"`
}

Response for a SearchRequest.

func (*SearchReply) ProtoMessage

func (*SearchReply) ProtoMessage()

func (*SearchReply) Reset

func (m *SearchReply) Reset()

func (*SearchReply) String

func (m *SearchReply) String() string

type SearchRequest

type SearchRequest struct {
	// Partial VName to match against nodes.  Each non-empty field becomes a
	// constraint (i.e. the signature/corpus/etc. must be exactly case-sensitively
	// equal to the given string) on the set of returned nodes.  Exact matching
	// turns into prefix matching if the corresponding field in partial_prefix is
	// set to true.
	Partial *VName `protobuf:"bytes,1,opt,name=partial" json:"partial,omitempty"`
	// Facts that a node must have to be matched.  Exact matching turns into
	// prefix matching if a Fact has its prefix field set to true.
	Fact []*SearchRequest_Fact `protobuf:"bytes,2,rep,name=fact" json:"fact,omitempty"`
	// Setting any field in this mask to true converts exact value matching to
	// prefix value matching for the corresponding VName component in partial.
	PartialPrefix *VNameMask `protobuf:"bytes,3,opt,name=partial_prefix" json:"partial_prefix,omitempty"`
}

Request for the set of node tickets matching a partial VName and collection of known facts.

func (*SearchRequest) GetFact

func (m *SearchRequest) GetFact() []*SearchRequest_Fact

func (*SearchRequest) GetPartial

func (m *SearchRequest) GetPartial() *VName

func (*SearchRequest) GetPartialPrefix

func (m *SearchRequest) GetPartialPrefix() *VNameMask

func (*SearchRequest) ProtoMessage

func (*SearchRequest) ProtoMessage()

func (*SearchRequest) Reset

func (m *SearchRequest) Reset()

func (*SearchRequest) String

func (m *SearchRequest) String() string

type SearchRequest_Fact

type SearchRequest_Fact struct {
	Name   string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Value  []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Prefix bool   `protobuf:"varint,3,opt,name=prefix" json:"prefix,omitempty"`
}

func (*SearchRequest_Fact) ProtoMessage

func (*SearchRequest_Fact) ProtoMessage()

func (*SearchRequest_Fact) Reset

func (m *SearchRequest_Fact) Reset()

func (*SearchRequest_Fact) String

func (m *SearchRequest_Fact) String() string

type SearchServiceClient

type SearchServiceClient interface {
	// Search responds with the set of node tickets that match the given
	// SearchRequest.
	Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchReply, error)
}

func NewSearchServiceClient

func NewSearchServiceClient(cc *grpc.ClientConn) SearchServiceClient

type SearchServiceServer

type SearchServiceServer interface {
	// Search responds with the set of node tickets that match the given
	// SearchRequest.
	Search(context.Context, *SearchRequest) (*SearchReply, error)
}

type ShardRequest

type ShardRequest struct {
	Index  int64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
	Shards int64 `protobuf:"varint,2,opt,name=shards" json:"shards,omitempty"`
}

Request for a stream of Entry objects in the given shard.

func (*ShardRequest) ProtoMessage

func (*ShardRequest) ProtoMessage()

func (*ShardRequest) Reset

func (m *ShardRequest) Reset()

func (*ShardRequest) String

func (m *ShardRequest) String() string

type ShardedGraphStoreClient

type ShardedGraphStoreClient interface {
	// Count returns the number of entries in the given shard.
	Count(ctx context.Context, in *CountRequest, opts ...grpc.CallOption) (*CountReply, error)
	// Shard responds with each Entry in the given shard.
	Shard(ctx context.Context, in *ShardRequest, opts ...grpc.CallOption) (ShardedGraphStore_ShardClient, error)
}

func NewShardedGraphStoreClient

func NewShardedGraphStoreClient(cc *grpc.ClientConn) ShardedGraphStoreClient

type ShardedGraphStoreServer

type ShardedGraphStoreServer interface {
	// Count returns the number of entries in the given shard.
	Count(context.Context, *CountRequest) (*CountReply, error)
	// Shard responds with each Entry in the given shard.
	Shard(*ShardRequest, ShardedGraphStore_ShardServer) error
}

type ShardedGraphStore_ShardClient

type ShardedGraphStore_ShardClient interface {
	Recv() (*Entry, error)
	grpc.ClientStream
}

type ShardedGraphStore_ShardServer

type ShardedGraphStore_ShardServer interface {
	Send(*Entry) error
	grpc.ServerStream
}

type VName

type VName struct {
	// A language-specific signature assigned by the analyzer.
	// e.g., "com.google.common.collect.Lists.newLinkedList<#1>()"
	Signature string `protobuf:"bytes,1,opt,name=signature" json:"signature,omitempty"`
	// The corpus this name belongs to.
	// e.g., "kythe", "chromium", "github.com/creachadair/imath", "aosp"
	// The corpus label "kythe" is reserved for internal use.
	Corpus string `protobuf:"bytes,2,opt,name=corpus" json:"corpus,omitempty"`
	// A corpus-specific root label, designating a subordinate collection within
	// the corpus.  If a corpus stores files in unrelated directory structures,
	// for example, the root can be used to distinguish them.  Or, of a corpus
	// incorporates subprojects, the root can be a project ID that it governs.
	// This may also be used to distinguish virtual subgroups of a corpus such as
	// generated files.
	Root string `protobuf:"bytes,3,opt,name=root" json:"root,omitempty"`
	// A path-structured label describing the location of this object relative to
	// the corpus and the root.  For code, this will generally be the relative
	// path to the file containing the code, e.g., "storage/service.go" in kythe.
	//
	// However, this need not be a true file path; virtual objects like figments
	// can assign an ad-hoc abstract ID, or omit it entirely.
	//
	// Examples:
	//   "devools/kythe/platform/go/datastore.go" (a file)
	//   "type/cpp/void.cc" (a type figment)
	Path string `protobuf:"bytes,4,opt,name=path" json:"path,omitempty"`
	// The language this name belongs to.
	// e.g., "c++", "python", "elisp", "haskell", "java"
	//
	// The schema will define specific labels for each supported language, so we
	// don't wind up with a confusion of names like "cxx", "cpp", "C++", etc.
	// Prototype: Official language name converted to lowercase.  If a version
	// number is necessary, include it, e.g., "python3".
	Language string `protobuf:"bytes,5,opt,name=language" json:"language,omitempty"`
}

VName is a proto representation of a vector name.

Rules:

  • All fields must be optional, and must have default values.
  • No field may ever be removed. If a field is deprecated, it may be renamed or marked with a comment, but must not be deleted.
  • New fields are always added to the end of the message.
  • All fields must be strings, not messages.

One of the key principles is that we want as few fields as possible in a vname. We're not trying to exhaust the possible dimensions along which a name could vary, but to find a minimal basis. Be conservative.

func (*VName) ProtoMessage

func (*VName) ProtoMessage()

func (*VName) Reset

func (m *VName) Reset()

func (*VName) String

func (m *VName) String() string

type VNameMask

type VNameMask struct {
	Signature bool `protobuf:"varint,1,opt,name=signature" json:"signature,omitempty"`
	Corpus    bool `protobuf:"varint,2,opt,name=corpus" json:"corpus,omitempty"`
	Root      bool `protobuf:"varint,3,opt,name=root" json:"root,omitempty"`
	Path      bool `protobuf:"varint,4,opt,name=path" json:"path,omitempty"`
	Language  bool `protobuf:"varint,5,opt,name=language" json:"language,omitempty"`
}

func (*VNameMask) ProtoMessage

func (*VNameMask) ProtoMessage()

func (*VNameMask) Reset

func (m *VNameMask) Reset()

func (*VNameMask) String

func (m *VNameMask) String() string

type WriteReply

type WriteReply struct {
}

Response to a WriteRequest

func (*WriteReply) ProtoMessage

func (*WriteReply) ProtoMessage()

func (*WriteReply) Reset

func (m *WriteReply) Reset()

func (*WriteReply) String

func (m *WriteReply) String() string

type WriteRequest

type WriteRequest struct {
	Source *VName                 `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"`
	Update []*WriteRequest_Update `protobuf:"bytes,2,rep,name=update" json:"update,omitempty"`
}

Request to write Entry objects to a GraphStore

func (*WriteRequest) GetSource

func (m *WriteRequest) GetSource() *VName

func (*WriteRequest) GetUpdate

func (m *WriteRequest) GetUpdate() []*WriteRequest_Update

func (*WriteRequest) ProtoMessage

func (*WriteRequest) ProtoMessage()

func (*WriteRequest) Reset

func (m *WriteRequest) Reset()

func (*WriteRequest) String

func (m *WriteRequest) String() string

type WriteRequest_Update

type WriteRequest_Update struct {
	EdgeKind  string `protobuf:"bytes,1,opt,name=edge_kind" json:"edge_kind,omitempty"`
	Target    *VName `protobuf:"bytes,2,opt,name=target" json:"target,omitempty"`
	FactName  string `protobuf:"bytes,3,opt,name=fact_name" json:"fact_name,omitempty"`
	FactValue []byte `protobuf:"bytes,4,opt,name=fact_value,proto3" json:"fact_value,omitempty"`
}

func (*WriteRequest_Update) GetTarget

func (m *WriteRequest_Update) GetTarget() *VName

func (*WriteRequest_Update) ProtoMessage

func (*WriteRequest_Update) ProtoMessage()

func (*WriteRequest_Update) Reset

func (m *WriteRequest_Update) Reset()

func (*WriteRequest_Update) String

func (m *WriteRequest_Update) String() string

Jump to

Keyboard shortcuts

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