generator

package
v0.0.0-...-1d82211 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGithubContentLocation

func GetGithubContentLocation(url string) (string, string, string)

Types

type DataModelDescriptor

type DataModelDescriptor struct {
	ModelNameCamelCase string
	ModelNameLowerCase string
}

type Generator

type Generator interface {
	CreateCodeContent(
		tpl string,
		serviceTemplate *ServiceTemplate,
	) map[string]string
}

func NewGrpcGoGenerator

func NewGrpcGoGenerator() Generator

type ServiceDescriptor

type ServiceDescriptor struct {
	Name    string
	Methods []ServiceMethodDescriptor
}

type ServiceMethodDescriptor

type ServiceMethodDescriptor struct {
	Name          string
	NameCamelCase string
	RequestType   string
	ResponseType  string
}

type ServiceTemplate

type ServiceTemplate struct {
	GoModule                 string
	GoVersion                string
	GoPackageAddress         string
	HttpEnabled              bool
	SwaggerEnabled           bool
	ProtocolServiceName      string
	ProtocolServiceNameLower string
	ProtocolContent          string
	ServiceName              string
	ServiceNameCamelCase     string
	ServiceNameLower         string

	DefaultDataModelNameCamelCase string
	DefaultDataModelNameLowerCase string

	RpcServices []ServiceDescriptor

	DataModels []DataModelDescriptor

	Value map[string]string
}

func CreateServiceTemplate

func CreateServiceTemplate() *ServiceTemplate

func (*ServiceTemplate) WithDataModelNames

func (t *ServiceTemplate) WithDataModelNames(modelNames []string) *ServiceTemplate

func (*ServiceTemplate) WithRpcParameters

func (t *ServiceTemplate) WithRpcParameters(
	protoContent string,
	goModule string,
	goVersion string,
	userServiceName string,
) *ServiceTemplate

func (*ServiceTemplate) WithRpcProtocol

func (t *ServiceTemplate) WithRpcProtocol(protoUri string, goModule string, goVersion string, serviceName string, httpEnabled bool) *ServiceTemplate

func (*ServiceTemplate) WithUserValues

func (t *ServiceTemplate) WithUserValues(values map[string]string) *ServiceTemplate

Jump to

Keyboard shortcuts

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