Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadHandlerTemplate ¶
func LoadHandlerTemplate(fname string) (map[string]MethodHandler, error)
func LoadMiddlewareTemplate ¶
func LoadMiddlewareTemplate(fname string) (map[string]MethodHandler, error)
Types ¶
type Config ¶
type Config struct { Out *string Template *string HandlerTemplate *string MiddlewareTemplate *string Global MethodHandler Handlers map[string]MethodHandler Middlewares map[string]MethodHandler HandleField func(field *protogen.Field, prop *spec.Schema) bool }
type HandlerTemplate ¶
type HandlerTemplate struct { Consumes []string `json:"consumes"` Produces []string `json:"produces"` Parameters []spec.Parameter `json:"parameters"` Responses *spec.Responses `json:"responses"` }
func (*HandlerTemplate) Handle ¶
func (ht *HandlerTemplate) Handle(method *protogen.Method, annotations annotations.Annotations, operation *spec.Operation)
type MethodHandler ¶
type MethodHandler func(method *protogen.Method, annotations annotations.Annotations, operation *spec.Operation)
type MiddlewareTemplate ¶
type MiddlewareTemplate struct { Parameters []spec.Parameter `json:"parameters"` Security []map[string][]string `json:"security"` Responses *spec.Responses `json:"responses"` }
func (*MiddlewareTemplate) Handle ¶
func (mt *MiddlewareTemplate) Handle(method *protogen.Method, annotations annotations.Annotations, operation *spec.Operation)
Click to show internal directories.
Click to hide internal directories.