protocplugin

package
v0.0.0-...-ae4cef3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProtogenPort = 20000

Variables

This section is empty.

Functions

func ExecProtocPluginHandler

func ExecProtocPluginHandler(request *pluginpb.CodeGeneratorRequest, genFunc ProtocPluginHandler) (response *pluginpb.CodeGeneratorResponse, err error)

func ExecProtocPluginRpc

func ExecProtocPluginRpc(request *pluginpb.CodeGeneratorRequest, genFunc ProtocPluginHandler) (response *pluginpb.CodeGeneratorResponse, err error)

func ExtractFilename

func ExtractFilename(filenameWithExt string) string

ExtractFilename filename.ext -> filename

func ProtoGeneratorMain

func ProtoGeneratorMain(genFunc ProtocPluginHandler, in io.Reader, out io.Writer, logPrefix string) (request *pluginpb.CodeGeneratorRequest, response *pluginpb.CodeGeneratorResponse, err error)

ProtoGeneratorMain protobuf plugin from main

Types

type ProtocPluginHandler

type ProtocPluginHandler func(request *pluginpb.CodeGeneratorRequest) (genFiles []*pluginpb.CodeGeneratorResponse_File)

type TProtocgenRpc

type TProtocgenRpc struct {
	Handler ProtocPluginHandler
	Port    int
}

func (*TProtocgenRpc) CallBytes

func (this *TProtocgenRpc) CallBytes(request []byte, reply *TrpcReply) error

func (*TProtocgenRpc) CallReqRes

func (this *TProtocgenRpc) CallReqRes(request *pluginpb.CodeGeneratorRequest) (response *pluginpb.CodeGeneratorResponse, err error)

func (*TProtocgenRpc) OnCallBytes

func (this *TProtocgenRpc) OnCallBytes(requestBytes []byte, rpcreply *TrpcReply) error

func (*TProtocgenRpc) OnCallReqRes

func (this *TProtocgenRpc) OnCallReqRes(request *pluginpb.CodeGeneratorRequest) (response *pluginpb.CodeGeneratorResponse)

func (*TProtocgenRpc) Run

func (this *TProtocgenRpc) Run()

type TrpcReply

type TrpcReply struct {
	ResponseByte []byte
}

Jump to

Keyboard shortcuts

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