driver

package
v0.0.0-...-14d8bfa Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: Apache-2.0 Imports: 2 Imported by: 1

README

driver

-- import "github.com/autom8ter/engine/driver"

Usage

func IsPlugin
func IsPlugin(a interface{}) bool
type Plugin
type Plugin interface {
	RegisterWithServer(*grpc.Server)
}

Plugin is an interface for representing gRPC server implementations. It is easily satisfied with code generated from the protoc-gen-go grpc tool

func NewPlugin
func NewPlugin(pluginFunc PluginFunc) Plugin

NewPlugin is a helper function to create a Plugin from a PluginFunc

type PluginFunc
type PluginFunc func(s *grpc.Server)

PluginFunc is a typed function that satisfies the Plugin interface. It uses a pattern similar to that of http.Handlerfunc Embed a PluginFunc in a struct to create a Plugin, and then initialize the PluginFunc with the method generated from your .pb file

func NewPluginFunc
func NewPluginFunc(fn func(s *grpc.Server)) PluginFunc

NewPluginFunc is a helper function to create a PluginFunc

func (PluginFunc) RegisterWithServer
func (p PluginFunc) RegisterWithServer(s *grpc.Server)

RegisterWithServer registers a Plugin with a grpc server.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPlugin

func IsPlugin(a interface{}) bool

Types

type Plugin

type Plugin interface {
	RegisterWithServer(*grpc.Server)
}

Plugin is an interface for representing gRPC server implementations. It is easily satisfied with code generated from the protoc-gen-go grpc tool

func NewPlugin

func NewPlugin(pluginFunc PluginFunc) Plugin

NewPlugin is a helper function to create a Plugin from a PluginFunc

type PluginFunc

type PluginFunc func(s *grpc.Server)

PluginFunc is a typed function that satisfies the Plugin interface. It uses a pattern similar to that of http.Handlerfunc Embed a PluginFunc in a struct to create a Plugin, and then initialize the PluginFunc with the method generated from your .pb file

func NewPluginFunc

func NewPluginFunc(fn func(s *grpc.Server)) PluginFunc

NewPluginFunc is a helper function to create a PluginFunc

func (PluginFunc) RegisterWithServer

func (p PluginFunc) RegisterWithServer(s *grpc.Server)

RegisterWithServer registers a Plugin with a grpc server.

Jump to

Keyboard shortcuts

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