Documentation ¶
Index ¶
- Constants
- Variables
- func Generate(cfg Config)
- func Merge(proto *Proto, importedProtos ...Proto) (err error)
- func MinusP(in string) string
- func MinusStar(in string) string
- func RemoveUnusedFile(completeFilePath string)
- func Scan(fileBytes []byte) (tokens chan Token)
- func ToCamelCase(src string) (out string)
- func ToDashCase(in string) (out string)
- func ToSnakeCase(src string) (out string)
- func Validate(in interface{}) (err error)
- type Config
- type Degeneres
- type DgEndpoint
- type DgField
- type DgMessage
- type DgService
- type Field
- type KV
- type Message
- type Name
- type Option
- type Proto
- type RPC
- type Scanner
- type Service
- type State
- type Template
- type Token
Constants ¶
View Source
const ( OptionVersion = "version" OptionImportPath = "import_path" OptionAuthor = "author" OptionProjectName = "project_name" OptionShortDescription = "short_description" OptionLongDescription = "long_description" OptionCertsPath = "certs_path" OptionPublicKeyName = "public_key_name" OptionPrivateKeyName = "private_key_name" OptionDockerPath = "docker_path" OptionProjectNameCommander = "project_name_commander" OptionTransform = "transform" OptionValidate = "validate" OptionMiddlewareCORS = "middleware.cors" OptionMiddlewareNoCache = "middleware.no_cache" OptionMiddlewareLogger = "middleware.logger" OptionMiddlewareSecure = "middleware.secure" OptionMethod = "method" OptionOrigins = "origins" MiddlewareCORS = "CORS" MiddlewareNoCache = "NoCache" MiddlewareLogger = "Logger" MiddlewareSecure = "Secure" )
View Source
const ( FileSyntax = "syntax" FilePackage = "package" FileImport = "import" FieldRuleOptional = "optional" FieldRuleRepeated = "repeated" FieldRuleRequired = "required" )
View Source
const ( TokenFileKey = "fileKey" TokenFileVal = "fileVal" TokenRPCName = "rpcName" TokenRPCIn = "rpcIn" TokenRPCOut = "rpcOut" TokenFileOptionKey = "fileOptionKey" TokenFileOptionVal = "fileOptionVal" TokenServiceKey = "serviceKey" TokenServiceOptionKey = "serviceOptionKey" TokenServiceOptionVal = "serviceOptionVal" TokenRPCOptionKey = "rpcOptionKey" TokenRPCOptionVal = "rpcOptionVal" TokenMessageKey = "messageKey" TokenFieldDataType = "fieldDataType" TokenFieldKey = "fieldKey" TokenFieldOptionKey = "fieldOptionKey" TokenFieldOptionVal = "fieldOptionVal" TokenRPCDone = "rpcDone" TokenMessageDone = "messageDone" TokenServiceDone = "serviceDone" TokenFieldDone = "fieldDone" TokenFieldRule = "fieldRule" )
View Source
const ( TagNameValidate = "validate" ValidateRequired = "required" )
Variables ¶
View Source
var ( ErrorMismatchSyntax = errors.New("Syntax mismatch on imports") ErrorNoImportsProvided = errors.New("No imports provided") ErrorFieldInvalidSyntax = errors.New("Field import syntax invalid") )
View Source
var (
ValidateRequiredErr = errors.New("Failed Required Validation")
)
Functions ¶
func RemoveUnusedFile ¶
func RemoveUnusedFile(completeFilePath string)
func ToCamelCase ¶
func ToDashCase ¶
func ToSnakeCase ¶
Courtesy of https://github.com/fatih/camelcase/blob/master/camelcase.go
Types ¶
type Degeneres ¶
type Degeneres struct { GeneratorVersion string Version string `validate:"required"` ImportPath string `validate:"required"` DockerPath string Author string `validate:"required"` ProjectName string `validate:"required"` ProjectNameCommander string ProjectFolder string ShortDescription string LongDescription string Origins string Services []DgService Messages []DgMessage Inputs []DgMessage ProtoPaths []string ProtoFilePath string }
func NewDegeneres ¶
type DgEndpoint ¶
type Proto ¶
type Proto struct { Syntax string Package string Imports []string Options []Option Services []Service Messages []Message ProtoPaths []string ProtoFilePath string }
func UnmarshalFile ¶
type Scanner ¶
func NewScanner ¶
func (Scanner) FieldOptionsState ¶
func (Scanner) MessageState ¶
func (Scanner) ServiceState ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.