sdk.v3: gopkg.in/bblfsh/sdk.v3/protocol Index | Files | Directories

package protocol

import "gopkg.in/bblfsh/sdk.v3/protocol"

Package protocol is a generated protocol buffer package.

It is generated from these files:

driver.proto

It has these top-level messages:

ParseRequest
ParseResponse
ParseError
Version
Manifest
VersionRequest
VersionResponse
SupportedLanguagesRequest
SupportedLanguagesResponse

Index

Package Files

driver.go driver.pb.go

Constants

const (

    // DefaultGRPCMaxMessageBytes is maximum msg size for gRPC.
    DefaultGRPCMaxMessageBytes = 100 * mb
)

Variables

var (
    ErrInvalidLengthDriver = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowDriver   = fmt.Errorf("proto: integer overflow")
)
var DevelopmentStatus_name = map[int32]string{
    0:  "DEV_INACTIVE",
    1:  "DEV_PLANNING",
    2:  "DEV_PREALPHA",
    3:  "DEV_ALPHA",
    4:  "DEV_BETA",
    5:  "DEV_STABLE",
    6:  "DEV_MATURE",
}
var DevelopmentStatus_value = map[string]int32{
    "DEV_INACTIVE": 0,
    "DEV_PLANNING": 1,
    "DEV_PREALPHA": 2,
    "DEV_ALPHA":    3,
    "DEV_BETA":     4,
    "DEV_STABLE":   5,
    "DEV_MATURE":   6,
}
var Mode_name = map[int32]string{
    0:  "DEFAULT_MODE",
    1:  "NATIVE",
    2:  "PREPROCESSED",
    4:  "ANNOTATED",
    8:  "SEMANTIC",
}
var Mode_value = map[string]int32{
    "DEFAULT_MODE": 0,
    "NATIVE":       1,
    "PREPROCESSED": 2,
    "ANNOTATED":    4,
    "SEMANTIC":     8,
}

func AsDriver Uses

func AsDriver(cc *grpc.ClientConn) driver.Driver

AsDriver creates a v2 driver client for a given gRPC client.

func DialOptions Uses

func DialOptions() []grpc.DialOption

DialOptions returns a set of common options that should be used when dialing bblfsh server.

It automatically enables OpenTrace if a global tracer is set.

func RegisterDriver Uses

func RegisterDriver(srv *grpc.Server, d driver.Driver)

RegisterDriver registers a v2 driver server on a given gRPC server.

func RegisterDriverHostServer Uses

func RegisterDriverHostServer(s *grpc.Server, srv DriverHostServer)

func RegisterDriverServer Uses

func RegisterDriverServer(s *grpc.Server, srv DriverServer)

func ServerOptions Uses

func ServerOptions() []grpc.ServerOption

ServerOptions returns a set of common options that should be used in bblfsh server.

It automatically enables OpenTrace if a global tracer is set.

type DevelopmentStatus Uses

type DevelopmentStatus int32
const (
    DevelopmentStatus_Inactive DevelopmentStatus = 0
    DevelopmentStatus_Planning DevelopmentStatus = 1
    DevelopmentStatus_PreAlpha DevelopmentStatus = 2
    DevelopmentStatus_Alpha    DevelopmentStatus = 3
    DevelopmentStatus_Beta     DevelopmentStatus = 4
    DevelopmentStatus_Stable   DevelopmentStatus = 5
    DevelopmentStatus_Mature   DevelopmentStatus = 6
)

func (DevelopmentStatus) EnumDescriptor Uses

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

func (DevelopmentStatus) String Uses

func (x DevelopmentStatus) String() string

type DriverClient Uses

type DriverClient interface {
    // Parse returns an UAST for a given source file.
    Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error)
}

func NewDriverClient Uses

func NewDriverClient(cc *grpc.ClientConn) DriverClient

type DriverHostClient Uses

type DriverHostClient interface {
    // ServerVersion returns version information of this server.
    ServerVersion(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error)
    // SupportedLanguages returns a list of languages supported by the server.
    SupportedLanguages(ctx context.Context, in *SupportedLanguagesRequest, opts ...grpc.CallOption) (*SupportedLanguagesResponse, error)
}

func NewDriverHostClient Uses

func NewDriverHostClient(cc *grpc.ClientConn) DriverHostClient

type DriverHostServer Uses

type DriverHostServer interface {
    // ServerVersion returns version information of this server.
    ServerVersion(context.Context, *VersionRequest) (*VersionResponse, error)
    // SupportedLanguages returns a list of languages supported by the server.
    SupportedLanguages(context.Context, *SupportedLanguagesRequest) (*SupportedLanguagesResponse, error)
}

type DriverServer Uses

type DriverServer interface {
    // Parse returns an UAST for a given source file.
    Parse(context.Context, *ParseRequest) (*ParseResponse, error)
}

type Manifest Uses

type Manifest struct {
    // Name is a human-readable language or driver name.
    Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    // Language is a Babelfish language identifier.
    Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"`
    // Aliases is a list of alternative language identifiers from Enry/Linguist.
    Aliases []string `protobuf:"bytes,3,rep,name=aliases" json:"aliases,omitempty"`
    // Version of the language driver.
    Version *Version `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"`
    // Status of the driver development.
    Status DevelopmentStatus `protobuf:"varint,5,opt,name=status,proto3,enum=gopkg.in.bblfsh.sdk.v2.protocol.DevelopmentStatus" json:"status,omitempty"`
    // Features this driver supports.
    Features []string `protobuf:"bytes,6,rep,name=features" json:"features,omitempty"`
}

func NewManifest Uses

func NewManifest(m *manifest.Manifest) *Manifest

NewManifest converts driver manifest to the corresponding protocol message.

func (*Manifest) Descriptor Uses

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

func (*Manifest) Marshal Uses

func (m *Manifest) Marshal() (dAtA []byte, err error)

func (*Manifest) MarshalTo Uses

func (m *Manifest) MarshalTo(dAtA []byte) (int, error)

func (*Manifest) ProtoMessage Uses

func (*Manifest) ProtoMessage()

func (*Manifest) ProtoSize Uses

func (m *Manifest) ProtoSize() (n int)

func (*Manifest) Reset Uses

func (m *Manifest) Reset()

func (*Manifest) String Uses

func (m *Manifest) String() string

func (*Manifest) ToNative Uses

func (m *Manifest) ToNative() *manifest.Manifest

ToNative converts the manifest message to the driver manifest used by the SDK.

func (*Manifest) Unmarshal Uses

func (m *Manifest) Unmarshal(dAtA []byte) error

type Mode Uses

type Mode int32
const (
    // DefaultMode selects the transformation mode that is considered to produce UAST of the best quality.
    Mode_DefaultMode Mode = 0
    // Native disables any UAST transformations and emits a native language AST as returned by the parser.
    Mode_Native Mode = 1
    // Preprocessed runs only basic transformation over native AST (normalize positional info, type fields).
    Mode_Preprocessed Mode = 2
    // Annotated UAST is based on native AST, but provides role annotations for nodes.
    Mode_Annotated Mode = 4
    // Semantic UAST normalizes native AST nodes to a unified structure where possible.
    Mode_Semantic Mode = 8
)

func (Mode) EnumDescriptor Uses

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

func (Mode) String Uses

func (x Mode) String() string

type ParseError Uses

type ParseError struct {
    // Text is an error message.
    Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
}

func (*ParseError) Descriptor Uses

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

func (*ParseError) Marshal Uses

func (m *ParseError) Marshal() (dAtA []byte, err error)

func (*ParseError) MarshalTo Uses

func (m *ParseError) MarshalTo(dAtA []byte) (int, error)

func (*ParseError) ProtoMessage Uses

func (*ParseError) ProtoMessage()

func (*ParseError) ProtoSize Uses

func (m *ParseError) ProtoSize() (n int)

func (*ParseError) Reset Uses

func (m *ParseError) Reset()

func (*ParseError) String Uses

func (m *ParseError) String() string

func (*ParseError) Unmarshal Uses

func (m *ParseError) Unmarshal(dAtA []byte) error

type ParseRequest Uses

type ParseRequest struct {
    // Content stores the content of a source file. Required.
    Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
    // Language can be set optionally to disable automatic language detection.
    Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"`
    // Filename can be set optionally to assist automatic language detection.
    Filename string `protobuf:"bytes,3,opt,name=filename,proto3" json:"filename,omitempty"`
    // Mode sets a transformation pipeline used for UAST.
    Mode Mode `protobuf:"varint,4,opt,name=mode,proto3,enum=gopkg.in.bblfsh.sdk.v2.protocol.Mode" json:"mode,omitempty"`
}

ParseRequest is a request to parse a file and get its UAST.

func (*ParseRequest) Descriptor Uses

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

func (*ParseRequest) Marshal Uses

func (m *ParseRequest) Marshal() (dAtA []byte, err error)

func (*ParseRequest) MarshalTo Uses

func (m *ParseRequest) MarshalTo(dAtA []byte) (int, error)

func (*ParseRequest) ProtoMessage Uses

func (*ParseRequest) ProtoMessage()

func (*ParseRequest) ProtoSize Uses

func (m *ParseRequest) ProtoSize() (n int)

func (*ParseRequest) Reset Uses

func (m *ParseRequest) Reset()

func (*ParseRequest) String Uses

func (m *ParseRequest) String() string

func (*ParseRequest) Unmarshal Uses

func (m *ParseRequest) Unmarshal(dAtA []byte) error

type ParseResponse Uses

type ParseResponse struct {
    // UAST is a binary encoding of the resulting UAST.
    Uast []byte `protobuf:"bytes,1,opt,name=uast,proto3" json:"uast,omitempty"`
    // Language that was automatically detected.
    Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"`
    // Errors is a list of parsing errors.
    // Only set if parser was able to return a response. Otherwise gRPC error codes are used.
    Errors []*ParseError `protobuf:"bytes,3,rep,name=errors" json:"errors,omitempty"`
}

ParseResponse is the reply to ParseRequest.

func (*ParseResponse) Descriptor Uses

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

func (*ParseResponse) Marshal Uses

func (m *ParseResponse) Marshal() (dAtA []byte, err error)

func (*ParseResponse) MarshalTo Uses

func (m *ParseResponse) MarshalTo(dAtA []byte) (int, error)

func (*ParseResponse) Nodes Uses

func (m *ParseResponse) Nodes() (nodes.Node, error)

func (*ParseResponse) ProtoMessage Uses

func (*ParseResponse) ProtoMessage()

func (*ParseResponse) ProtoSize Uses

func (m *ParseResponse) ProtoSize() (n int)

func (*ParseResponse) Reset Uses

func (m *ParseResponse) Reset()

func (*ParseResponse) String Uses

func (m *ParseResponse) String() string

func (*ParseResponse) Unmarshal Uses

func (m *ParseResponse) Unmarshal(dAtA []byte) error

type SupportedLanguagesRequest Uses

type SupportedLanguagesRequest struct {
}

func (*SupportedLanguagesRequest) Descriptor Uses

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

func (*SupportedLanguagesRequest) Marshal Uses

func (m *SupportedLanguagesRequest) Marshal() (dAtA []byte, err error)

func (*SupportedLanguagesRequest) MarshalTo Uses

func (m *SupportedLanguagesRequest) MarshalTo(dAtA []byte) (int, error)

func (*SupportedLanguagesRequest) ProtoMessage Uses

func (*SupportedLanguagesRequest) ProtoMessage()

func (*SupportedLanguagesRequest) ProtoSize Uses

func (m *SupportedLanguagesRequest) ProtoSize() (n int)

func (*SupportedLanguagesRequest) Reset Uses

func (m *SupportedLanguagesRequest) Reset()

func (*SupportedLanguagesRequest) String Uses

func (m *SupportedLanguagesRequest) String() string

func (*SupportedLanguagesRequest) Unmarshal Uses

func (m *SupportedLanguagesRequest) Unmarshal(dAtA []byte) error

type SupportedLanguagesResponse Uses

type SupportedLanguagesResponse struct {
    // Languages is a list of driver manifests for each language supported by the server.
    Languages []*Manifest `protobuf:"bytes,1,rep,name=languages" json:"languages,omitempty"`
}

func (*SupportedLanguagesResponse) Descriptor Uses

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

func (*SupportedLanguagesResponse) Marshal Uses

func (m *SupportedLanguagesResponse) Marshal() (dAtA []byte, err error)

func (*SupportedLanguagesResponse) MarshalTo Uses

func (m *SupportedLanguagesResponse) MarshalTo(dAtA []byte) (int, error)

func (*SupportedLanguagesResponse) ProtoMessage Uses

func (*SupportedLanguagesResponse) ProtoMessage()

func (*SupportedLanguagesResponse) ProtoSize Uses

func (m *SupportedLanguagesResponse) ProtoSize() (n int)

func (*SupportedLanguagesResponse) Reset Uses

func (m *SupportedLanguagesResponse) Reset()

func (*SupportedLanguagesResponse) String Uses

func (m *SupportedLanguagesResponse) String() string

func (*SupportedLanguagesResponse) Unmarshal Uses

func (m *SupportedLanguagesResponse) Unmarshal(dAtA []byte) error

type Version Uses

type Version struct {
    Version string    `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
    Build   time.Time `protobuf:"bytes,2,opt,name=build,stdtime" json:"build"`
}

func (*Version) Descriptor Uses

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

func (*Version) Marshal Uses

func (m *Version) Marshal() (dAtA []byte, err error)

func (*Version) MarshalTo Uses

func (m *Version) MarshalTo(dAtA []byte) (int, error)

func (*Version) ProtoMessage Uses

func (*Version) ProtoMessage()

func (*Version) ProtoSize Uses

func (m *Version) ProtoSize() (n int)

func (*Version) Reset Uses

func (m *Version) Reset()

func (*Version) String Uses

func (m *Version) String() string

func (*Version) Unmarshal Uses

func (m *Version) Unmarshal(dAtA []byte) error

type VersionRequest Uses

type VersionRequest struct {
}

func (*VersionRequest) Descriptor Uses

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

func (*VersionRequest) Marshal Uses

func (m *VersionRequest) Marshal() (dAtA []byte, err error)

func (*VersionRequest) MarshalTo Uses

func (m *VersionRequest) MarshalTo(dAtA []byte) (int, error)

func (*VersionRequest) ProtoMessage Uses

func (*VersionRequest) ProtoMessage()

func (*VersionRequest) ProtoSize Uses

func (m *VersionRequest) ProtoSize() (n int)

func (*VersionRequest) Reset Uses

func (m *VersionRequest) Reset()

func (*VersionRequest) String Uses

func (m *VersionRequest) String() string

func (*VersionRequest) Unmarshal Uses

func (m *VersionRequest) Unmarshal(dAtA []byte) error

type VersionResponse Uses

type VersionResponse struct {
    Version *Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
}

func (*VersionResponse) Descriptor Uses

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

func (*VersionResponse) Marshal Uses

func (m *VersionResponse) Marshal() (dAtA []byte, err error)

func (*VersionResponse) MarshalTo Uses

func (m *VersionResponse) MarshalTo(dAtA []byte) (int, error)

func (*VersionResponse) ProtoMessage Uses

func (*VersionResponse) ProtoMessage()

func (*VersionResponse) ProtoSize Uses

func (m *VersionResponse) ProtoSize() (n int)

func (*VersionResponse) Reset Uses

func (m *VersionResponse) Reset()

func (*VersionResponse) String Uses

func (m *VersionResponse) String() string

func (*VersionResponse) Unmarshal Uses

func (m *VersionResponse) Unmarshal(dAtA []byte) error

Directories

PathSynopsis
v1

Package protocol imports 24 packages (graph). Updated 2019-08-11. Refresh now. Tools for package owners.