protob

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 5 Imported by: 0

README

Protobuf for bhlindex

Install protoc v3 on Ubuntu

Check the latest releases

# Make sure you grab the latest version, change XXXX accordingly
curl -OL https://github.com/google/protobuf/releases/download/v3.XXXX/protoc-3.XXXX-linux-x86_64.zip

# Unzip
unzip protoc-3.XXXX-linux-x86_64.zip -d protoc3

# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/

# Move protoc3/include to /usr/local/include/
sudo mv protoc3/include/* /usr/local/include/

# Optional: change owner
sudo chown [user] /usr/local/bin/protoc
sudo chown -R [user] /usr/local/include/google

Install Go protobuf etc

From gnfinder root install all dependencies:

go get -u github.com/golang/protobuf/protoc-gen-go
go get -u ./...

How to create/update

cd protob
protoc -I . ./protob.proto --go_out=plugins=grpc:.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MatchType_name = map[int32]string{
	0: "NONE",
	1: "EXACT",
	2: "FUZZY",
	3: "PARTIAL_EXACT",
	4: "PARTIAL_FUZZY",
}
View Source
var MatchType_value = map[string]int32{
	"NONE":          0,
	"EXACT":         1,
	"FUZZY":         2,
	"PARTIAL_EXACT": 3,
	"PARTIAL_FUZZY": 4,
}

Functions

func RegisterGNFinderServer

func RegisterGNFinderServer(s *grpc.Server, srv GNFinderServer)

Types

type GNFinderClient

type GNFinderClient interface {
	Ping(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Pong, error)
	Ver(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Version, error)
	FindNames(ctx context.Context, in *Params, opts ...grpc.CallOption) (*Output, error)
}

GNFinderClient is the client API for GNFinder service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewGNFinderClient

func NewGNFinderClient(cc *grpc.ClientConn) GNFinderClient

type GNFinderServer

type GNFinderServer interface {
	Ping(context.Context, *Void) (*Pong, error)
	Ver(context.Context, *Void) (*Version, error)
	FindNames(context.Context, *Params) (*Output, error)
}

GNFinderServer is the server API for GNFinder service.

type MatchType

type MatchType int32
const (
	MatchType_NONE          MatchType = 0
	MatchType_EXACT         MatchType = 1
	MatchType_FUZZY         MatchType = 2
	MatchType_PARTIAL_EXACT MatchType = 3
	MatchType_PARTIAL_FUZZY MatchType = 4
)

func (MatchType) EnumDescriptor

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

func (MatchType) String

func (x MatchType) String() string

type NameString

type NameString struct {
	Type                 string        `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Verbatim             string        `protobuf:"bytes,2,opt,name=verbatim,proto3" json:"verbatim,omitempty"`
	Name                 string        `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Odds                 float32       `protobuf:"fixed32,4,opt,name=odds,proto3" json:"odds,omitempty"`
	OffsetStart          int32         `protobuf:"varint,5,opt,name=offset_start,json=offsetStart,proto3" json:"offset_start,omitempty"`
	OffsetEnd            int32         `protobuf:"varint,6,opt,name=offset_end,json=offsetEnd,proto3" json:"offset_end,omitempty"`
	Verification         *Verification `protobuf:"bytes,7,opt,name=verification,proto3" json:"verification,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (*NameString) Descriptor

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

func (*NameString) GetName

func (m *NameString) GetName() string

func (*NameString) GetOdds

func (m *NameString) GetOdds() float32

func (*NameString) GetOffsetEnd

func (m *NameString) GetOffsetEnd() int32

func (*NameString) GetOffsetStart

func (m *NameString) GetOffsetStart() int32

func (*NameString) GetType

func (m *NameString) GetType() string

func (*NameString) GetVerbatim

func (m *NameString) GetVerbatim() string

func (*NameString) GetVerification

func (m *NameString) GetVerification() *Verification

func (*NameString) ProtoMessage

func (*NameString) ProtoMessage()

func (*NameString) Reset

func (m *NameString) Reset()

func (*NameString) String

func (m *NameString) String() string

func (*NameString) XXX_DiscardUnknown

func (m *NameString) XXX_DiscardUnknown()

func (*NameString) XXX_Marshal

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

func (*NameString) XXX_Merge

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

func (*NameString) XXX_Size

func (m *NameString) XXX_Size() int

func (*NameString) XXX_Unmarshal

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

type Output

type Output struct {
	Date                 string        `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"`
	FinderVersion        string        `protobuf:"bytes,2,opt,name=finder_version,json=finderVersion,proto3" json:"finder_version,omitempty"`
	Language             string        `protobuf:"bytes,3,opt,name=language,proto3" json:"language,omitempty"`
	LanguageDetected     string        `protobuf:"bytes,4,opt,name=language_detected,json=languageDetected,proto3" json:"language_detected,omitempty"`
	DetectLanguage       bool          `protobuf:"varint,5,opt,name=detect_language,json=detectLanguage,proto3" json:"detect_language,omitempty"`
	TotalTokens          int32         `protobuf:"varint,6,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"`
	TotalCandidates      int32         `protobuf:"varint,7,opt,name=total_candidates,json=totalCandidates,proto3" json:"total_candidates,omitempty"`
	TotalNames           int32         `protobuf:"varint,8,opt,name=total_names,json=totalNames,proto3" json:"total_names,omitempty"`
	Names                []*NameString `protobuf:"bytes,9,rep,name=names,proto3" json:"names,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (*Output) Descriptor

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

func (*Output) GetDate

func (m *Output) GetDate() string

func (*Output) GetDetectLanguage

func (m *Output) GetDetectLanguage() bool

func (*Output) GetFinderVersion

func (m *Output) GetFinderVersion() string

func (*Output) GetLanguage

func (m *Output) GetLanguage() string

func (*Output) GetLanguageDetected

func (m *Output) GetLanguageDetected() string

func (*Output) GetNames

func (m *Output) GetNames() []*NameString

func (*Output) GetTotalCandidates

func (m *Output) GetTotalCandidates() int32

func (*Output) GetTotalNames

func (m *Output) GetTotalNames() int32

func (*Output) GetTotalTokens

func (m *Output) GetTotalTokens() int32

func (*Output) ProtoMessage

func (*Output) ProtoMessage()

func (*Output) Reset

func (m *Output) Reset()

func (*Output) String

func (m *Output) String() string

func (*Output) XXX_DiscardUnknown

func (m *Output) XXX_DiscardUnknown()

func (*Output) XXX_Marshal

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

func (*Output) XXX_Merge

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

func (*Output) XXX_Size

func (m *Output) XXX_Size() int

func (*Output) XXX_Unmarshal

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

type Params

type Params struct {
	Text                 string   `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	NoBayes              bool     `protobuf:"varint,3,opt,name=no_bayes,json=noBayes,proto3" json:"no_bayes,omitempty"`
	Language             string   `protobuf:"bytes,4,opt,name=language,proto3" json:"language,omitempty"`
	DetectLanguage       bool     `protobuf:"varint,5,opt,name=detect_language,json=detectLanguage,proto3" json:"detect_language,omitempty"`
	Verification         bool     `protobuf:"varint,6,opt,name=verification,proto3" json:"verification,omitempty"`
	Sources              []int32  `protobuf:"varint,7,rep,packed,name=sources,proto3" json:"sources,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Params) Descriptor

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

func (*Params) GetDetectLanguage

func (m *Params) GetDetectLanguage() bool

func (*Params) GetLanguage

func (m *Params) GetLanguage() string

func (*Params) GetNoBayes

func (m *Params) GetNoBayes() bool

func (*Params) GetSources

func (m *Params) GetSources() []int32

func (*Params) GetText

func (m *Params) GetText() string

func (*Params) GetVerification

func (m *Params) GetVerification() bool

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) String

func (m *Params) String() string

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

type Pong

type Pong struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Pong) Descriptor

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

func (*Pong) GetValue

func (m *Pong) GetValue() string

func (*Pong) ProtoMessage

func (*Pong) ProtoMessage()

func (*Pong) Reset

func (m *Pong) Reset()

func (*Pong) String

func (m *Pong) String() string

func (*Pong) XXX_DiscardUnknown

func (m *Pong) XXX_DiscardUnknown()

func (*Pong) XXX_Marshal

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

func (*Pong) XXX_Merge

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

func (*Pong) XXX_Size

func (m *Pong) XXX_Size() int

func (*Pong) XXX_Unmarshal

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

type ResultData

type ResultData struct {
	DataSourceId         int32     `protobuf:"varint,1,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"`
	DataSourceTitle      string    `protobuf:"bytes,2,opt,name=data_source_title,json=dataSourceTitle,proto3" json:"data_source_title,omitempty"`
	TaxonId              string    `protobuf:"bytes,3,opt,name=taxon_id,json=taxonId,proto3" json:"taxon_id,omitempty"`
	MatchedName          string    `protobuf:"bytes,4,opt,name=matched_name,json=matchedName,proto3" json:"matched_name,omitempty"`
	MatchedCanonical     string    `protobuf:"bytes,5,opt,name=matched_canonical,json=matchedCanonical,proto3" json:"matched_canonical,omitempty"`
	CurrentName          string    `protobuf:"bytes,6,opt,name=current_name,json=currentName,proto3" json:"current_name,omitempty"`
	Synonym              bool      `protobuf:"varint,7,opt,name=synonym,proto3" json:"synonym,omitempty"`
	ClassificationPath   string    `protobuf:"bytes,8,opt,name=classification_path,json=classificationPath,proto3" json:"classification_path,omitempty"`
	ClassificationRank   string    `protobuf:"bytes,9,opt,name=classification_rank,json=classificationRank,proto3" json:"classification_rank,omitempty"`
	ClassificationIds    string    `protobuf:"bytes,10,opt,name=classification_ids,json=classificationIds,proto3" json:"classification_ids,omitempty"`
	EditDistance         int32     `protobuf:"varint,11,opt,name=edit_distance,json=editDistance,proto3" json:"edit_distance,omitempty"`
	StemEditDistance     int32     `protobuf:"varint,12,opt,name=stem_edit_distance,json=stemEditDistance,proto3" json:"stem_edit_distance,omitempty"`
	MatchType            MatchType `protobuf:"varint,13,opt,name=match_type,json=matchType,proto3,enum=protob.MatchType" json:"match_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*ResultData) Descriptor

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

func (*ResultData) GetClassificationIds

func (m *ResultData) GetClassificationIds() string

func (*ResultData) GetClassificationPath

func (m *ResultData) GetClassificationPath() string

func (*ResultData) GetClassificationRank

func (m *ResultData) GetClassificationRank() string

func (*ResultData) GetCurrentName

func (m *ResultData) GetCurrentName() string

func (*ResultData) GetDataSourceId

func (m *ResultData) GetDataSourceId() int32

func (*ResultData) GetDataSourceTitle

func (m *ResultData) GetDataSourceTitle() string

func (*ResultData) GetEditDistance

func (m *ResultData) GetEditDistance() int32

func (*ResultData) GetMatchType

func (m *ResultData) GetMatchType() MatchType

func (*ResultData) GetMatchedCanonical

func (m *ResultData) GetMatchedCanonical() string

func (*ResultData) GetMatchedName

func (m *ResultData) GetMatchedName() string

func (*ResultData) GetStemEditDistance

func (m *ResultData) GetStemEditDistance() int32

func (*ResultData) GetSynonym

func (m *ResultData) GetSynonym() bool

func (*ResultData) GetTaxonId

func (m *ResultData) GetTaxonId() string

func (*ResultData) ProtoMessage

func (*ResultData) ProtoMessage()

func (*ResultData) Reset

func (m *ResultData) Reset()

func (*ResultData) String

func (m *ResultData) String() string

func (*ResultData) XXX_DiscardUnknown

func (m *ResultData) XXX_DiscardUnknown()

func (*ResultData) XXX_Marshal

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

func (*ResultData) XXX_Merge

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

func (*ResultData) XXX_Size

func (m *ResultData) XXX_Size() int

func (*ResultData) XXX_Unmarshal

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

type Verification

type Verification struct {
	BestResult           *ResultData   `protobuf:"bytes,1,opt,name=best_result,json=bestResult,proto3" json:"best_result,omitempty"`
	PreferredResults     []*ResultData `protobuf:"bytes,2,rep,name=preferred_results,json=preferredResults,proto3" json:"preferred_results,omitempty"`
	DataSourcesNum       int32         `protobuf:"varint,3,opt,name=data_sources_num,json=dataSourcesNum,proto3" json:"data_sources_num,omitempty"`
	DataSourceQuality    string        `protobuf:"bytes,4,opt,name=data_source_quality,json=dataSourceQuality,proto3" json:"data_source_quality,omitempty"`
	Retries              int32         `protobuf:"varint,5,opt,name=retries,proto3" json:"retries,omitempty"`
	Error                string        `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (*Verification) Descriptor

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

func (*Verification) GetBestResult

func (m *Verification) GetBestResult() *ResultData

func (*Verification) GetDataSourceQuality

func (m *Verification) GetDataSourceQuality() string

func (*Verification) GetDataSourcesNum

func (m *Verification) GetDataSourcesNum() int32

func (*Verification) GetError

func (m *Verification) GetError() string

func (*Verification) GetPreferredResults

func (m *Verification) GetPreferredResults() []*ResultData

func (*Verification) GetRetries

func (m *Verification) GetRetries() int32

func (*Verification) ProtoMessage

func (*Verification) ProtoMessage()

func (*Verification) Reset

func (m *Verification) Reset()

func (*Verification) String

func (m *Verification) String() string

func (*Verification) XXX_DiscardUnknown

func (m *Verification) XXX_DiscardUnknown()

func (*Verification) XXX_Marshal

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

func (*Verification) XXX_Merge

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

func (*Verification) XXX_Size

func (m *Verification) XXX_Size() int

func (*Verification) XXX_Unmarshal

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

type Version

type Version struct {
	Version              string   `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Build                string   `protobuf:"bytes,2,opt,name=build,proto3" json:"build,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Version) Descriptor

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

func (*Version) GetBuild

func (m *Version) GetBuild() string

func (*Version) GetVersion

func (m *Version) GetVersion() string

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) Reset

func (m *Version) Reset()

func (*Version) String

func (m *Version) String() string

func (*Version) XXX_DiscardUnknown

func (m *Version) XXX_DiscardUnknown()

func (*Version) XXX_Marshal

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

func (*Version) XXX_Merge

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

func (*Version) XXX_Size

func (m *Version) XXX_Size() int

func (*Version) XXX_Unmarshal

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

type Void

type Void struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Void) Descriptor

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

func (*Void) ProtoMessage

func (*Void) ProtoMessage()

func (*Void) Reset

func (m *Void) Reset()

func (*Void) String

func (m *Void) String() string

func (*Void) XXX_DiscardUnknown

func (m *Void) XXX_DiscardUnknown()

func (*Void) XXX_Marshal

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

func (*Void) XXX_Merge

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

func (*Void) XXX_Size

func (m *Void) XXX_Size() int

func (*Void) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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