gothriftpool

package module
v0.0.0-...-f698312 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 5 Imported by: 0

README

gothriftpool

Go Thrift pool proxy generator.

Example

go install github.com/koofr/gothriftpool/gothriftpool
thrift --gen go -out . gothriftpooltest/myservice.thrift
gothriftpool -w myservice.MyService

The latter will create ./myserviceproxy/myserviceproxy.go file.

Testing

go test ./gothriftpooltest

Coverage:

cd gothriftpooltest
go test -coverpkg=./myserviceproxy -coverprofile=test.coverprofile && go tool cover -html=test.coverprofile

Regenerate test service

thrift --gen go -out `pwd`/gothriftpooltest gothriftpooltest/myservice.thrift
go run ./gothriftpool myservice.MyService > gothriftpooltest/myserviceproxy/myserviceproxy.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	InterfaceImport  string
	InterfacePackage string
	InterfaceName    string
	ProxyPackage     string
	Functions        []gointerfacer.Func
}

func NewGenerator

func NewGenerator(iface string) (g *Generator, err error)

func (*Generator) Generate

func (g *Generator) Generate() (code []byte, err error)

type ThriftInterface

type ThriftInterface struct {
	InterfaceImport string
	ProxyPackage    string
	ClientType      string
	Functions       []gointerfacer.Func
}

Directories

Path Synopsis
gothriftpooltest

Jump to

Keyboard shortcuts

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