plugin

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2012 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package plugin implements a plugin for protoc-gen-go that generates RPC stubs for use with the the net/rpc package.

To register the plugin, import this package as follows:

import _ "github.com/kylelemons/go-rpcgen/plugin"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

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

Plugin implements the generator.Plugin interface.

func (*Plugin) Generate

func (p *Plugin) Generate(file *generator.FileDescriptor)

Generate generates the RPC stubs for all plugin in the given FileDescriptorProto.

func (*Plugin) GenerateCommonStubs

func (p *Plugin) GenerateCommonStubs(svc *descriptor.ServiceDescriptorProto)

GenerateCommonStubs is the core of the plugin package. It generates an interface based on the ServiceDescriptorProto that is used by the other two halves of the plugin.

func (*Plugin) GenerateImports

func (p *Plugin) GenerateImports(file *generator.FileDescriptor)

GenerateImports adds the required imports to the output file if the Generate function generated any RPC stubs.

func (*Plugin) GenerateRPCStubs

func (p *Plugin) GenerateRPCStubs(svc *descriptor.ServiceDescriptorProto)

GenerateRPCStubs generates the net/rpc-based stubs. It generates an RPC client implementation of the interface as well as three helper functions to create the Client and Server necessary to utilize the service over RPC.

func (*Plugin) GenerateWebStubs

func (p *Plugin) GenerateWebStubs(svc *descriptor.ServiceDescriptorProto)

GenerateWebStubs generates the webrpc stubs. It generates a webrpc client implementation of the interface as well as webrpc handlers and a helper function.

func (*Plugin) Init

func (p *Plugin) Init(g *generator.Generator)

Init stores the given generator in the Plugin for use in the Generate* class of functions.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the name of the plugin.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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