parse

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PbService

type PbService struct {
	Name      string           // Greeter
	LowerName string           // greeter first character to lower
	ProtoName string           // proto file name greeter.proto
	Methods   []*ServiceMethod // service methods
}

PbService service fields

func GetServices

func GetServices(protoName string, file *protogen.File) []*PbService

GetServices parse protobuf services

func (*PbService) RandNumber

func (s *PbService) RandNumber() int

RandNumber rand number 1~100

type RequestField

type RequestField struct {
	FieldName string
	FieldType string
	Comment   string
}

RequestField request fields

func (RequestField) GoTypeZero

func (r RequestField) GoTypeZero() string

GoTypeZero default zero value for type

type ServiceMethod

type ServiceMethod struct {
	MethodName    string         // e.g. Create
	Request       string         // e.g. CreateRequest
	RequestFields []RequestField // request fields
	Reply         string         // e.g. CreateReply

	ServiceName      string // Greeter
	LowerServiceName string // greeter first character to lower
}

ServiceMethod method fields

func (*ServiceMethod) AddOne

func (t *ServiceMethod) AddOne(i int) int

AddOne counter

Jump to

Keyboard shortcuts

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