schema

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package grpc/schema provides generator for GRPC gateway's schema

Index

Constants

This section is empty.

Variables

View Source
var ScalarTypes = map[string]bool{
	"string":    true,
	"int32":     true,
	"int64":     true,
	"double":    true,
	"float":     true,
	"Timestamp": true,
	"bytes":     true,
	"bool":      true,
}
View Source
var ScalarTypesMap = map[string]string{
	"String":   "string",
	"Int":      "int32",
	"Int16":    "int32",
	"Int64":    "int64",
	"Double":   "double",
	"Float":    "float",
	"DateTime": "Timestamp",
	"Binary":   "bytes",
	"Stream":   "bytes",
	"Boolean":  "bool",
	"Guid":     "string",
}

Functions

func ToCamelCase

func ToCamelCase(src string) string

func ToLowerCamelCase

func ToLowerCamelCase(src string) string

Types

type Generator

type Generator struct {
	TypeMap      map[string]string
	NameMap      map[string]string
	Associations map[string]map[string]string
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(schema shared.Schema) *Generator

NewGenerator returns initialized generator

func (*Generator) Generate

func (g *Generator) Generate()

Generate generates the grpc schema and writes it to ./odata folder

Jump to

Keyboard shortcuts

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