Documentation ¶
Index ¶
- Variables
- func C(wrap int, args ...interface{}) string
- func C80(args ...interface{}) string
- func Disabled(msg protogen.Message) (disabled bool)
- func EnumName(enum protoreflect.EnumDescriptor) string
- func FileDescriptor(enum protoreflect.Descriptor) protoreflect.FileDescriptor
- func FileNeeds(f protogen.File, wk WellKnown) bool
- func GetElemRule(field protogen.Field, rule proto.Message) (rules *v.FieldRules, err error)
- func GetImports(fileDesc protoreflect.FileDescriptor) map[string]string
- func Has(msg proto.Message, fld string) bool
- func Ignored(msg protogen.Message) (ignored bool)
- func Needs(m protoreflect.MessageDescriptor, wk WellKnown) bool
- func OnType(field *protogen.Field, typ string) string
- func Render(tpl *template.Template) func(tmplName string, data interface{}) (string, error)
- func RequiredOneOf(oo protogen.Oneof) (required bool)
- type WellKnown
Constants ¶
This section is empty.
Variables ¶
View Source
var ExtraPkg = map[string]string{}
map[pkgPath]pkgName
View Source
var ExtraPkgPath = map[string]string{}
View Source
var FuncMap = map[string]interface{}{ "required": RequiredOneOf, "has": Has, "needs": Needs, "fileneeds": FileNeeds, "isEnum": isEnum, "enumList": enumList, "enumVal": enumVal, "byteStr": byteStr, "cmt": C80, "durGt": durGt, "durLit": durLit, "durStr": durStr, "err": err, "errCause": errCause, "errIdx": errIdx, "inKey": inKey, "inType": inType, "isBytes": isBytes, "lit": lit, "lookup": lookup, "oneOfType": oneOfTypeName, "tsGt": tsGt, "tsLit": tsLit, "tsStr": tsStr, "externalEnums": externalEnums, "enumName": EnumName, "OnType": OnType, "GetElemRule": GetElemRule, "inKind": inKind, }
View Source
var StdPkg = map[string]int{
"bytes": 0,
"errors": 0,
"fmt": 0,
"net": 0,
"mail": 0,
"url": 0,
"regexp": 0,
"sort": 0,
"strings": 0,
"time": 0,
"utf8": 0,
"anypb": 0,
}
Functions ¶
func EnumName ¶
func EnumName(enum protoreflect.EnumDescriptor) string
func FileDescriptor ¶
func FileDescriptor(enum protoreflect.Descriptor) protoreflect.FileDescriptor
func GetElemRule ¶
func GetImports ¶
func GetImports(fileDesc protoreflect.FileDescriptor) map[string]string
func Needs ¶
func Needs(m protoreflect.MessageDescriptor, wk WellKnown) bool
Needs returns true if a well-known string validator is needed for this message.
func RequiredOneOf ¶
RequiredOneOf returns true if the oneof field requires a field to be set
Types ¶
Click to show internal directories.
Click to hide internal directories.