scope

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	*Request

	FileDesc *descriptorpb.FileDescriptorProto
}

File enscapsulates the generator scope for a single file within a generation request.

func (*File) EnterService

func (s *File) EnterService(d *descriptorpb.ServiceDescriptorProto) *Service

EnterService returns a scope for a service within this file.

func (*File) GoPackage

func (s *File) GoPackage() (string, string, error)

GoPackage returns the import path and unqualified package name for the file being generated.

func (*File) OutputFileName

func (s *File) OutputFileName() string

OutputFileName returns the name of the file that is generated based on this file.

type Method

type Method struct {
	*Service

	MethodDesc *descriptorpb.MethodDescriptorProto
}

Method enscapsulates the generator scope for a single method of a service.

func (*Method) GoInputType

func (s *Method) GoInputType() (string, string, error)

GoInputType returns the package path and type name for the Go type that is used as the input message for this method.

func (*Method) GoOutputType

func (s *Method) GoOutputType() (string, string, error)

GoOutputType returns the package path and type name for the Go type that is used as the output message for this method.

func (*Method) RuntimeCallConstructor

func (s *Method) RuntimeCallConstructor() string

RuntimeCallConstructor returns the name of the function that returns a new runtime.Call for this method.

func (*Method) RuntimeCallImpl

func (s *Method) RuntimeCallImpl() string

RuntimeCallImpl returns the name of the runtime.Call implementation for this method.

func (*Method) RuntimeMethodImpl

func (s *Method) RuntimeMethodImpl() string

RuntimeMethodImpl returns the name of the runtime.Method implementation for this method.

type Request

type Request struct {
	GenRequest *pluginpb.CodeGeneratorRequest
	GoModule   string
}

Request enscapsulates the generator scope for an entire generation request.

func (*Request) EnterFile

func (s *Request) EnterFile(d *descriptorpb.FileDescriptorProto) *File

EnterFile returns a scope for a file within this request.

type Service

type Service struct {
	*File

	ServiceDesc *descriptorpb.ServiceDescriptorProto
}

Service enscapsulates the generator scope for a single service within a file.

func (*Service) ClientConstructor

func (s *Service) ClientConstructor() string

ClientConstructor returns the name of the function that returns a new client for this service.

func (*Service) ClientImpl

func (s *Service) ClientImpl() string

ClientImpl returns the name of the struct that implements the client for this service.

func (*Service) EnterMethod

func (s *Service) EnterMethod(d *descriptorpb.MethodDescriptorProto) *Method

EnterMethod returns a scope for a method within this service.

func (*Service) RuntimeServiceImpl

func (s *Service) RuntimeServiceImpl() string

RuntimeServiceImpl returns the name of the runtime.Service implementation for this service.

func (*Service) ServiceInterface

func (s *Service) ServiceInterface() string

ServiceInterface returns the name of the user-facing interface for this service.

func (*Service) ServiceRegisterFunc

func (s *Service) ServiceRegisterFunc() string

ServiceRegisterFunc returns the name of the function that registers an implementation of this service with a registry.

Jump to

Keyboard shortcuts

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