generator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateClient

func GenerateClient(w io.Writer, data TemplateData) error

func GenerateServer

func GenerateServer(w io.Writer, data TemplateData) error

func GenerateSkeleton

func GenerateSkeleton(w io.Writer, data TemplateData, existingMethods map[string]*ExistingMethod) error

func ParseExistingService added in v0.1.1

func ParseExistingService(filePath string) (map[string]*ExistingMethod, error)

ParseExistingService parses an existing service file and returns the methods

Types

type ExistingMethod added in v0.1.1

type ExistingMethod struct {
	Name         string
	Parameters   []string
	Results      []string
	Body         string
	ContextType  string
	RequestType  string
	ResponseType string
}

func (*ExistingMethod) SignatureMatches added in v0.1.1

func (m *ExistingMethod) SignatureMatches(protoMethod Method) bool

SignatureMatches checks if the method signature matches the proto definition

type Method

type Method struct {
	Name       string
	InputType  string
	OutputType string
}

func (Method) CallSignature

func (m Method) CallSignature() string

func (Method) Signature

func (m Method) Signature() string

type TemplateData

type TemplateData struct {
	PackageName  string
	ProtoPackage string
	ServiceName  string
	Methods      []Method
}

Jump to

Keyboard shortcuts

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