Documentation ¶
Index ¶
- Variables
- func NewGRPCServer(drv driver.DriverModule, opts ...grpc.ServerOption) *grpc.Server
- func NewGRPCServerCustom(drv driver.DriverModule, opts ...grpc.ServerOption) *grpc.Server
- func Run(t driver.Transforms)
- func RunNative(d driver.Native, t driver.Transforms)
- type Logger
- type LoggerFactory
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidTracer is returned by the driver server when the logger configuration is wrong. ErrInvalidLogger = errors.NewKind("invalid logger configuration") // ErrInvalidTracer is returned by the driver server when the tracing configuration is wrong. ErrInvalidTracer = errors.NewKind("invalid tracer configuration") // ErrUnsupportedLanguage is returned by the language server if the language in the request // is not supported by the driver. ErrUnsupportedLanguage = errors.NewKind("unsupported language: %q") )
var DefaultDriver driver.Native = native.NewDriver("")
var ( // ManifestLocation location of the manifest file. Should not override // this variable unless you know what are you doing. ManifestLocation = "/opt/driver/etc/" + manifest.Filename )
Functions ¶
func NewGRPCServer ¶
func NewGRPCServer(drv driver.DriverModule, opts ...grpc.ServerOption) *grpc.Server
NewGRPCServer creates a gRPC server instance that dispatches requests to a provided driver.
It will automatically include default server options for bblfsh protocol.
func NewGRPCServerCustom ¶
func NewGRPCServerCustom(drv driver.DriverModule, opts ...grpc.ServerOption) *grpc.Server
NewGRPCServerCustom is the same as NewGRPCServer, but it won't include any options except the ones that were passed.
func Run ¶
func Run(t driver.Transforms)
Run is a common main function used as an entry point for drivers. It panics in case of an error.
Types ¶
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warningf(format string, args ...interface{}) }
Logger represents a generic logger, based on logrus.Logger
type LoggerFactory ¶
LoggerFactory is a helper for create logrus.Logger's
func (LoggerFactory) Apply ¶
func (c LoggerFactory) Apply() error
Apply configures the standard logrus Logger with the LoggerFactory values.
func (LoggerFactory) New ¶
func (c LoggerFactory) New() (Logger, error)
New returns a new logger based on the LoggerFactory values.
type Server ¶
type Server struct { // Logger a logger to be used by the server. Logger Logger // contains filtered or unexported fields }
Server is a grpc server for the communication with the driver.
func NewServer ¶
func NewServer(d driver.DriverModule) *Server
NewServer returns a new server for a given Driver.