Documentation
¶
Index ¶
- Constants
- Variables
- func NewErrBadServiceImportPath(file *protogen.File, importPath, fileImportPath string) error
- func NewErrCreateField(f *Field, msg *Message, err error) error
- func NewErrCreateService(svc *Service, err error) error
- func NewErrEnumValueNotFound(enumValueName string, f *Field) error
- func NewErrFieldNotFound(fieldName string, msg *Message) error
- func NewErrInvalidRuleForField(f *Field, ruleName string) error
- func NewErrInvalidRuleIn(f *Field, value string) error
- func NewErrInvalidServiceImportPath(file *protogen.File, importPath string) error
- func NewErrMessageNotFound(messageName string, svc *Service) error
- func NewErrMethodNotFound(methodName string, svc *Service) error
- func NewErrPrivatePackageNotFound(name protoreflect.FullName) error
- func NewRules(f *Field, validate *svc.Validate) ([]string, error)
- type EnumValue
- type Field
- type Message
- type Method
- type Package
- type PartialNamer
- type Plugin
- type RegisterService
- type Service
- type Type
Constants ¶
View Source
const (
FileName = "service.pb.go"
)
Variables ¶
View Source
var Partials = []string{
convertersPartial,
validatorsPartial,
mutatorsPartial,
handlersPartial,
implsPartial,
}
Functions ¶
func NewErrCreateService ¶
func NewErrEnumValueNotFound ¶
func NewErrFieldNotFound ¶
func NewErrInvalidRuleIn ¶
func NewErrMessageNotFound ¶
func NewErrMethodNotFound ¶
func NewErrPrivatePackageNotFound ¶
func NewErrPrivatePackageNotFound(name protoreflect.FullName) error
Types ¶
type EnumValue ¶
type EnumValue struct { IsLatest bool IsDeprecated bool IsPrivate bool Name string Next *EnumValue Private *EnumValue Receive []*EnumValue }
func NewEnumValue ¶
NewEnumValue creates a `EnumValue`. An error will be returned if the enum value cannot be created for any reason.
func (*EnumValue) PrivateType ¶
type Field ¶
type Field struct { IsPrivate bool IsLatest bool IsDeprecated bool IsMessage bool IsEnum bool IsOneOf bool IsMatch bool IsRepeated bool IsRequired bool Name string EnumName string Type Type Private *Field Next *Field Message *Message Messages []*Message EnumValues []*EnumValue EnumValueByName map[string]*EnumValue Rules []string }
type Message ¶
type Message struct { IsPrivate bool IsLatest bool IsDeprecated bool IsExternal bool IsOneOf bool IsConverterEmpty bool IsMatch bool IsInput bool Name string MethodName string ImportPath string PackageName string FullName string Private *Message Next *Message Parent *Message Fields []*Field FieldByName map[string]*Field }
func NewExternalMessage ¶
NewExternalMessage creates a `Message` for protobuf messages that are external to the public and private services. These are placeholder structures to make building validators and converters easier.
func NewMessage ¶
NewMessage creates a `Message`. An error will be returned if the message cannot be created for any reason.
func (*Message) PrivateType ¶
type Method ¶
type Package ¶
type Package struct { ProtoName protoreflect.FullName Name protogen.GoPackageName ImportPath protogen.GoImportPath ServiceImportPath protogen.GoImportPath Service *protogen.Service Messages []*protogen.Message }
type PartialNamer ¶
type PartialNamer interface {
PartialName() string
}
type RegisterService ¶
type Service ¶
type Service struct { IsPrivate bool IsLatest bool ProtoPackageName string PackageName string ImportPath string ServiceImportPath string SubServiceImportPath string GeneratedFileName string Name string Private *Service Next *Service Messages []*Message MessageByName map[string]*Message Methods []*Method MethodByName map[string]*Method }
func NewService ¶
func NewService( protoPackageName protoreflect.FullName, packageName protogen.GoPackageName, importPath protogen.GoImportPath, serviceImportPath protogen.GoImportPath, service *protogen.Service, messages []*protogen.Message, serviceChain []*Service, ) (*Service, error)
NewService creates a `Service`. An error will be returned if the service cannot be created for any reason.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.