Documentation
¶
Index ¶
- Variables
- func FieldGoType(g *protogen.GeneratedFile, field *protogen.Field) (goType []any, pointer bool)
- func FindField(name string, inMessage *protogen.Message) *protogen.Field
- func FullFieldName(fields []*protogen.Field) string
- type Endpoint
- func (e *Endpoint) Body() string
- func (e *Endpoint) FullName() string
- func (e *Endpoint) HttpRule() *annotations.HttpRule
- func (e *Endpoint) Input() *protogen.Message
- func (e *Endpoint) InputGoIdent() protogen.GoIdent
- func (e *Endpoint) IsStreaming() bool
- func (e *Endpoint) Method() string
- func (e *Endpoint) Name() string
- func (e *Endpoint) Output() *protogen.Message
- func (e *Endpoint) OutputGoIdent() protogen.GoIdent
- func (e *Endpoint) ParseParameters() (*protogen.Message, *protogen.Field, []*protogen.Field, []*protogen.Field, ...)
- func (e *Endpoint) Path() string
- func (e *Endpoint) PathParameters() ([]string, error)
- func (e *Endpoint) ResponseBody() string
- func (e *Endpoint) Route() *mux.Route
- func (e *Endpoint) SetHttpRule()
- func (e *Endpoint) SetRoute(route *mux.Route)
- func (e *Endpoint) Unexported(s string) string
- type Service
- func (s *Service) AppendRouteName() string
- func (s *Service) FullName() string
- func (s *Service) GorillaName() string
- func (s *Service) HandlerName() string
- func (s *Service) Name() string
- func (s *Service) RequestDecoderName() string
- func (s *Service) ResponseEncoderName() string
- func (s *Service) ServiceName() string
- func (s *Service) Unexported(name string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProtoJsonPackage = protogen.GoImportPath("google.golang.org/protobuf/encoding/protojson") ProtoJsonMarshalOptionsIdent = ProtoJsonPackage.Ident("MarshalOptions") ProtoJsonUnmarshalOptionsIdent = ProtoJsonPackage.Ident("UnmarshalOptions") )
View Source
var ( ContextPackage = protogen.GoImportPath("context") ContextIdent = ContextPackage.Ident("Context") )
View Source
var ( HttpPackage = protogen.GoImportPath("net/http") ClientIdent = HttpPackage.Ident("Client") HttpHandlerIdent = HttpPackage.Ident("Handler") HttpHandlerFuncIdent = HttpPackage.Ident("HandlerFunc") ResponseWriterIdent = HttpPackage.Ident("ResponseWriter") RequestIdent = HttpPackage.Ident("Request") ResponseIdent = HttpPackage.Ident("Response") )
View Source
var ( FmtPackage = protogen.GoImportPath("fmt") SprintfIdent = FmtPackage.Ident("Sprintf") )
View Source
var ( MuxPackage = protogen.GoImportPath("github.com/gorilla/mux") RouterIdent = MuxPackage.Ident("Router") VarsIdent = MuxPackage.Ident("Vars") )
View Source
var ( ProtoPackage = protogen.GoImportPath("google.golang.org/protobuf/proto") ProtoStringIdent = ProtoPackage.Ident("String") )
View Source
var ( GorillaPackage = protogen.GoImportPath("github.com/go-leo/gorilla") ErrorEncoderIdent = GorillaPackage.Ident("ErrorEncoder") ResponseTransformerIdent = GorillaPackage.Ident("ResponseTransformer") DefaultEncodeErrorIdent = GorillaPackage.Ident("DefaultEncodeError") EncodeResponseIdent = GorillaPackage.Ident("EncodeResponse") EncodeHttpBodyIdent = GorillaPackage.Ident("EncodeHttpBody") EncodeHttpResponseIdent = GorillaPackage.Ident("EncodeHttpResponse") DecodeRequestIdent = GorillaPackage.Ident("DecodeRequest") DecodeHttpBodyIdent = GorillaPackage.Ident("DecodeHttpBody") DecodeHttpRequestIdent = GorillaPackage.Ident("DecodeHttpRequest") DecodeFormIdent = GorillaPackage.Ident("DecodeForm") OptionIdent = GorillaPackage.Ident("Option") NewOptionsIdent = GorillaPackage.Ident("NewOptions") ChainIdent = GorillaPackage.Ident("Chain") CustomDecodeRequestIdent = GorillaPackage.Ident("CustomDecodeRequest") OnValidationErrCallbackIdent = GorillaPackage.Ident("OnValidationErrCallback") ValidateRequestIdent = GorillaPackage.Ident("ValidateRequest") )
View Source
var ( WrapperspbPackage = protogen.GoImportPath("google.golang.org/protobuf/types/known/wrapperspb") WrapperspbStringIdent = WrapperspbPackage.Ident("String") )
Functions ¶
func FieldGoType ¶
FieldGoType returns the Go type used for a field.
If it returns pointer=true, the struct field is a pointer to the type.
func FullFieldName ¶
Types ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func (*Endpoint) HttpRule ¶
func (e *Endpoint) HttpRule() *annotations.HttpRule
func (*Endpoint) InputGoIdent ¶
func (*Endpoint) IsStreaming ¶
func (*Endpoint) OutputGoIdent ¶
func (*Endpoint) ParseParameters ¶
func (*Endpoint) PathParameters ¶ added in v1.0.1
func (*Endpoint) ResponseBody ¶
func (*Endpoint) SetHttpRule ¶
func (e *Endpoint) SetHttpRule()
func (*Endpoint) Unexported ¶
type Service ¶
func (*Service) AppendRouteName ¶
func (*Service) GorillaName ¶
func (*Service) HandlerName ¶
func (*Service) RequestDecoderName ¶
func (*Service) ResponseEncoderName ¶
func (*Service) ServiceName ¶
func (*Service) Unexported ¶
Click to show internal directories.
Click to hide internal directories.