cli

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchmarkPlugin

type BenchmarkPlugin struct {
	// contains filtered or unexported fields
}

BenchmarkPlugin wraps symbols (functions and variables) exported by plugin github.com/wendigo/go-bind-plugin/internal/test_fixtures/benchmark_plugin

See docs at https://godoc.org/github.com/wendigo/go-bind-plugin/internal/test_fixtures/benchmark_plugin

func BindBenchmarkPlugin

func BindBenchmarkPlugin(path string) (*BenchmarkPlugin, error)

BindBenchmarkPlugin loads plugin from the given path and binds symbols (variables and functions) to the BenchmarkPlugin struct.

func (*BenchmarkPlugin) String

func (p *BenchmarkPlugin) String() string

String returnes textual representation of the wrapper. It provides info on exported symbols and variables.

func (*BenchmarkPlugin) Sum

func (p *BenchmarkPlugin) Sum(in0 []uint64) uint64

Sum function was exported from plugin github.com/wendigo/go-bind-plugin/internal/test_fixtures/benchmark_plugin symbol 'Sum'

See docs at https://godoc.org/github.com/wendigo/go-bind-plugin/internal/test_fixtures/benchmark_plugin#Sum

type Cli

type Cli struct {
	// contains filtered or unexported fields
}

Cli is responsible for generating plugin wrapper, can be initialized with New()

func New

func New(config Config, logger *log.Logger) (*Cli, error)

New creates new plugin wrapper generator

func (*Cli) GenerateFile

func (c *Cli) GenerateFile() error

GenerateFile generates wrapper file for plugin

type Config

type Config struct {
	// Path to the plugin
	PluginPath string
	// Plugin's package (will be used to compile plugin when PluginPath does not exist)
	PluginPackage string
	// Path where generated wrapper will be written
	OutputPath string

	// Name of the struct/interface that will be generated
	OutputName string

	// Dereference variables exported by plugin
	DereferenceVariables bool

	// Generate SHA256 for existing/compiled plugin and write it to the Bind* function
	CheckSha256 bool

	// Format generated code using gofmt -s -w
	FormatCode bool

	// Rebuild plugin from sources even if *.so exists at PluginPath
	ForcePluginRebuild bool

	// Package name of the generated file
	OutputPackage string

	// Do not export plugin's variables
	HideVariables bool

	// Generate interface and return it in Bind* function instead of struct (enables HideVariables)
	AsInterface bool
}

Config for Cli

func (Config) String

func (c Config) String() string

String formats config as command line arguments

Jump to

Keyboard shortcuts

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