Documentation
¶
Index ¶
- Variables
- func Funcs() template.FuncMap
- func ParamStyleKey(prefix, style string, explode bool) string
- func PathToChiPattern(path string) string
- func PathToEchoPattern(path string) string
- func PathToFiberPattern(path string) string
- func PathToGinPattern(path string) string
- func PathToGorillaPattern(path string) string
- func PathToIrisPattern(path string) string
- func PathToStdHTTPPattern(path string) string
- func ToGoIdentifier(s string) string
- type ClientTemplate
- type HelperTemplate
- type Import
- type InitiatorTemplate
- type ParamTemplate
- type ReceiverTemplate
- type ServerTemplate
- type TypeTemplate
Constants ¶
This section is empty.
Variables ¶
var ChiReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, }, Template: "server/chi/receiver.go.tmpl", }, }
ChiReceiverTemplates contains receiver templates for Chi servers.
var ChiServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "net/http"}, }, Template: "server/chi/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "net/http"}, {Path: "github.com/go-chi/chi/v5"}, }, Template: "server/chi/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/go-chi/chi/v5"}, }, Template: "server/chi/wrapper.go.tmpl", }, }
ChiServerTemplates contains templates for Chi server generation.
var ClientTemplates = map[string]ClientTemplate{ "base": { Name: "base", Imports: []Import{ {Path: "context"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "strings"}, }, Template: "client/base.go.tmpl", }, "interface": { Name: "interface", Imports: []Import{ {Path: "context"}, {Path: "io"}, {Path: "net/http"}, }, Template: "client/interface.go.tmpl", }, "methods": { Name: "methods", Imports: []Import{ {Path: "context"}, {Path: "io"}, {Path: "net/http"}, }, Template: "client/methods.go.tmpl", }, "request_builders": { Name: "request_builders", Imports: []Import{ {Path: "bytes"}, {Path: "encoding/json"}, {Path: "fmt"}, {Path: "io"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "strings"}, }, Template: "client/request_builders.go.tmpl", }, "simple": { Name: "simple", Imports: []Import{ {Path: "context"}, {Path: "encoding/json"}, {Path: "fmt"}, {Path: "io"}, {Path: "net/http"}, }, Template: "client/simple.go.tmpl", }, }
ClientTemplates contains templates for client generation.
var EchoReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/labstack/echo/v5"}, }, Template: "server/echo/receiver.go.tmpl", }, }
EchoReceiverTemplates contains receiver templates for Echo v5 servers.
var EchoServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "net/http"}, {Path: "github.com/labstack/echo/v5"}, }, Template: "server/echo/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "github.com/labstack/echo/v5"}, }, Template: "server/echo/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/labstack/echo/v5"}, }, Template: "server/echo/wrapper.go.tmpl", }, }
EchoServerTemplates contains templates for Echo v5 server generation.
var EchoV4ReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/labstack/echo/v4"}, }, Template: "server/echo-v4/receiver.go.tmpl", }, }
EchoV4ReceiverTemplates contains receiver templates for Echo v4 servers.
var EchoV4ServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "net/http"}, {Path: "github.com/labstack/echo/v4"}, }, Template: "server/echo-v4/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "github.com/labstack/echo/v4"}, }, Template: "server/echo-v4/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/labstack/echo/v4"}, }, Template: "server/echo-v4/wrapper.go.tmpl", }, }
EchoV4ServerTemplates contains templates for Echo v4 server generation.
var FiberReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/gofiber/fiber/v3"}, }, Template: "server/fiber/receiver.go.tmpl", }, }
FiberReceiverTemplates contains receiver templates for Fiber servers.
var FiberServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "github.com/gofiber/fiber/v3"}, }, Template: "server/fiber/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "github.com/gofiber/fiber/v3"}, }, Template: "server/fiber/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/gofiber/fiber/v3"}, }, Template: "server/fiber/wrapper.go.tmpl", }, }
FiberServerTemplates contains templates for Fiber server generation.
var GinReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/gin-gonic/gin"}, }, Template: "server/gin/receiver.go.tmpl", }, }
GinReceiverTemplates contains receiver templates for Gin servers.
var GinServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "net/http"}, {Path: "github.com/gin-gonic/gin"}, }, Template: "server/gin/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "github.com/gin-gonic/gin"}, }, Template: "server/gin/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/gin-gonic/gin"}, }, Template: "server/gin/wrapper.go.tmpl", }, }
GinServerTemplates contains templates for Gin server generation.
var GorillaReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, }, Template: "server/gorilla/receiver.go.tmpl", }, }
GorillaReceiverTemplates contains receiver templates for Gorilla servers.
var GorillaServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "net/http"}, }, Template: "server/gorilla/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "net/http"}, {Path: "github.com/gorilla/mux"}, }, Template: "server/gorilla/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/gorilla/mux"}, }, Template: "server/gorilla/wrapper.go.tmpl", }, }
GorillaServerTemplates contains templates for Gorilla server generation.
var InitiatorTemplates = map[string]InitiatorTemplate{ "initiator_base": { Name: "initiator_base", Imports: []Import{ {Path: "context"}, {Path: "net/http"}, }, Template: "initiator/base.go.tmpl", }, "initiator_interface": { Name: "initiator_interface", Imports: []Import{ {Path: "context"}, {Path: "io"}, {Path: "net/http"}, }, Template: "initiator/interface.go.tmpl", }, "initiator_methods": { Name: "initiator_methods", Imports: []Import{ {Path: "context"}, {Path: "io"}, {Path: "net/http"}, }, Template: "initiator/methods.go.tmpl", }, "initiator_request_builders": { Name: "initiator_request_builders", Imports: []Import{ {Path: "bytes"}, {Path: "encoding/json"}, {Path: "fmt"}, {Path: "io"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "strings"}, }, Template: "initiator/request_builders.go.tmpl", }, "initiator_simple": { Name: "initiator_simple", Imports: []Import{ {Path: "context"}, {Path: "encoding/json"}, {Path: "fmt"}, {Path: "io"}, {Path: "net/http"}, }, Template: "initiator/simple.go.tmpl", }, }
InitiatorTemplates contains templates for initiator generation. These are shared between webhook and callback initiators (parameterized by prefix).
var IrisReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/kataras/iris/v12"}, }, Template: "server/iris/receiver.go.tmpl", }, }
IrisReceiverTemplates contains receiver templates for Iris servers.
var IrisServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "net/http"}, {Path: "github.com/kataras/iris/v12"}, }, Template: "server/iris/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "github.com/kataras/iris/v12"}, }, Template: "server/iris/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, {Path: "github.com/kataras/iris/v12"}, }, Template: "server/iris/wrapper.go.tmpl", }, }
IrisServerTemplates contains templates for Iris server generation.
var MarshalFormHelperTemplate = HelperTemplate{ Name: "marshal_form", Imports: []Import{ {Path: "errors"}, {Path: "fmt"}, {Path: "net/url"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "helpers/marshal_form.go.tmpl", }
MarshalFormHelperTemplate is the template for the marshalForm helper function. This is included when any operation has a form-encoded typed request body.
var ParamHelpersTemplate = ParamTemplate{ Name: "helpers", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "net/url"}, {Path: "reflect"}, {Path: "sort"}, {Path: "strconv"}, {Path: "strings"}, {Path: "time"}, {Path: "github.com/google/uuid"}, }, Template: "params/helpers.go.tmpl", }
ParamHelpersTemplate is the template for shared helper functions. This is included whenever any param function is used.
var ParamTemplates = map[string]ParamTemplate{ "style_simple": { Name: "StyleSimpleParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_simple.go.tmpl", }, "style_simple_explode": { Name: "StyleSimpleExplodeParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_simple_explode.go.tmpl", }, "style_label": { Name: "StyleLabelParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_label.go.tmpl", }, "style_label_explode": { Name: "StyleLabelExplodeParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_label_explode.go.tmpl", }, "style_matrix": { Name: "StyleMatrixParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_matrix.go.tmpl", }, "style_matrix_explode": { Name: "StyleMatrixExplodeParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_matrix_explode.go.tmpl", }, "style_form": { Name: "StyleFormParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_form.go.tmpl", }, "style_form_explode": { Name: "StyleFormExplodeParam", Imports: []Import{ {Path: "bytes"}, {Path: "encoding"}, {Path: "encoding/json"}, {Path: "errors"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_form_explode.go.tmpl", }, "style_spaceDelimited": { Name: "StyleSpaceDelimitedParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_space_delimited.go.tmpl", }, "style_spaceDelimited_explode": { Name: "StyleSpaceDelimitedExplodeParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_space_delimited_explode.go.tmpl", }, "style_pipeDelimited": { Name: "StylePipeDelimitedParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_pipe_delimited.go.tmpl", }, "style_pipeDelimited_explode": { Name: "StylePipeDelimitedExplodeParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/style_pipe_delimited_explode.go.tmpl", }, "style_deepObject": { Name: "StyleDeepObjectParam", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "sort"}, {Path: "strconv"}, {Path: "strings"}, }, Template: "params/style_deep_object.go.tmpl", }, "bind_simple": { Name: "BindSimpleParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_simple.go.tmpl", }, "bind_simple_explode": { Name: "BindSimpleExplodeParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_simple_explode.go.tmpl", }, "bind_label": { Name: "BindLabelParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_label.go.tmpl", }, "bind_label_explode": { Name: "BindLabelExplodeParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_label_explode.go.tmpl", }, "bind_matrix": { Name: "BindMatrixParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_matrix.go.tmpl", }, "bind_matrix_explode": { Name: "BindMatrixExplodeParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_matrix_explode.go.tmpl", }, "bind_form": { Name: "BindFormParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_form.go.tmpl", }, "bind_form_explode": { Name: "BindFormExplodeParam", Imports: []Import{ {Path: "fmt"}, {Path: "net/url"}, {Path: "reflect"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/bind_form_explode.go.tmpl", }, "bind_spaceDelimited": { Name: "BindSpaceDelimitedParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_space_delimited.go.tmpl", }, "bind_spaceDelimited_explode": { Name: "BindSpaceDelimitedExplodeParam", Imports: []Import{ {Path: "net/url"}, }, Template: "params/bind_space_delimited_explode.go.tmpl", }, "bind_pipeDelimited": { Name: "BindPipeDelimitedParam", Imports: []Import{ {Path: "encoding"}, {Path: "fmt"}, {Path: "reflect"}, {Path: "strings"}, }, Template: "params/bind_pipe_delimited.go.tmpl", }, "bind_pipeDelimited_explode": { Name: "BindPipeDelimitedExplodeParam", Imports: []Import{ {Path: "net/url"}, }, Template: "params/bind_pipe_delimited_explode.go.tmpl", }, "bind_deepObject": { Name: "BindDeepObjectParam", Imports: []Import{ {Path: "errors"}, {Path: "fmt"}, {Path: "net/url"}, {Path: "reflect"}, {Path: "sort"}, {Path: "strconv"}, {Path: "strings"}, {Path: "time"}, }, Template: "params/bind_deep_object.go.tmpl", }, }
ParamTemplates maps style/explode combinations to their template definitions. Keys follow the pattern: "style_{style}" or "style_{style}_explode" for styling, and "bind_{style}" or "bind_{style}_explode" for binding.
"errors": { Name: "errors", Imports: []Import{ {Path: "fmt"}, }, Template: "server/errors.go.tmpl", }, "param_types": { Name: "param_types", Imports: []Import{}, Template: "server/param_types.go.tmpl", }, }
SharedServerTemplates contains templates shared across all server implementations.
var StdHTTPReceiverTemplates = map[string]ReceiverTemplate{ "receiver": { Name: "receiver", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, }, Template: "server/stdhttp/receiver.go.tmpl", }, }
StdHTTPReceiverTemplates contains receiver templates for StdHTTP servers.
var StdHTTPServerTemplates = map[string]ServerTemplate{ "interface": { Name: "interface", Imports: []Import{ {Path: "net/http"}, }, Template: "server/stdhttp/interface.go.tmpl", }, "handler": { Name: "handler", Imports: []Import{ {Path: "net/http"}, }, Template: "server/stdhttp/handler.go.tmpl", }, "wrapper": { Name: "wrapper", Imports: []Import{ {Path: "encoding/json"}, {Path: "fmt"}, {Path: "net/http"}, {Path: "net/url"}, }, Template: "server/stdhttp/wrapper.go.tmpl", }, }
StdHTTPServerTemplates contains templates for StdHTTP server generation.
var TemplateFS embed.FS
TemplateFS contains all embedded template files. The files/* pattern recursively includes all files in subdirectories.
var TypeTemplates = map[string]TypeTemplate{ "Email": { Name: "Email", Imports: []Import{ {Path: "encoding/json"}, {Path: "errors"}, {Path: "regexp"}, }, Template: "types/email.tmpl", }, "Date": { Name: "Date", Imports: []Import{ {Path: "encoding/json"}, {Path: "time"}, }, Template: "types/date.tmpl", }, "UUID": { Name: "UUID", Imports: []Import{ {Path: "github.com/google/uuid"}, }, Template: "types/uuid.tmpl", }, "File": { Name: "File", Imports: []Import{ {Path: "bytes"}, {Path: "encoding/json"}, {Path: "io"}, {Path: "mime/multipart"}, }, Template: "types/file.tmpl", }, "Nullable": { Name: "Nullable", Imports: []Import{ {Path: "encoding/json"}, {Path: "errors"}, }, Template: "types/nullable.tmpl", }, }
TypeTemplates maps type names to their template definitions.
Functions ¶
func ParamStyleKey ¶
ParamStyleKey returns the registry key for a style/explode combination. The prefix should be "style_" for serialization or "bind_" for binding.
func PathToChiPattern ¶
PathToChiPattern converts an OpenAPI path template to a Chi-compatible pattern. OpenAPI: /users/{user_id}/posts/{post_id} Chi: /users/{user_id}/posts/{post_id}
func PathToEchoPattern ¶
PathToEchoPattern converts an OpenAPI path template to an Echo-compatible pattern. OpenAPI: /users/{user_id}/posts/{post_id} Echo: /users/:user_id/posts/:post_id
func PathToFiberPattern ¶
PathToFiberPattern converts an OpenAPI path template to a Fiber-compatible pattern. OpenAPI: /users/{user_id}/posts/{post_id} Fiber: /users/:user_id/posts/:post_id
func PathToGinPattern ¶
PathToGinPattern converts an OpenAPI path template to a Gin-compatible pattern. OpenAPI: /users/{user_id}/posts/{post_id} Gin: /users/:user_id/posts/:post_id
func PathToGorillaPattern ¶
PathToGorillaPattern converts an OpenAPI path template to a Gorilla Mux-compatible pattern. OpenAPI: /users/{user_id}/posts/{post_id} Gorilla: /users/{user_id}/posts/{post_id}
func PathToIrisPattern ¶
PathToIrisPattern converts an OpenAPI path template to an Iris-compatible pattern. OpenAPI: /users/{user_id}/posts/{post_id} Iris: /users/:user_id/posts/:post_id
func PathToStdHTTPPattern ¶
PathToStdHTTPPattern converts an OpenAPI path template to a Go 1.22+ std http pattern. OpenAPI: /users/{user_id}/posts/{post_id} StdHTTP: /users/{user_id}/posts/{post_id} Special case: "/" becomes "/{$}" to match only the root path.
func ToGoIdentifier ¶
ToGoIdentifier converts a string to a valid Go identifier. This is a simple version for template usage.
Types ¶
type ClientTemplate ¶
type ClientTemplate struct {
Name string // Template name (e.g., "base", "interface")
Imports []Import // Required imports for this template
Template string // Template path in embedded FS
}
ClientTemplate defines a template for client generation.
type HelperTemplate ¶
type HelperTemplate struct {
Name string // Template name (e.g., "marshal_form")
Imports []Import // Required imports for this function
Template string // Template path in embedded FS (e.g., "helpers/marshal_form.go.tmpl")
}
HelperTemplate defines a template for a helper function that is conditionally included.
type InitiatorTemplate ¶
type InitiatorTemplate struct {
Name string // Template name (e.g., "initiator_base", "initiator_interface")
Imports []Import // Required imports for this template
Template string // Template path in embedded FS
}
InitiatorTemplate defines a template for initiator (webhook/callback sender) generation.
type ParamTemplate ¶
type ParamTemplate struct {
Name string // Function name (e.g., "StyleSimpleParam")
Imports []Import // Required imports for this function
Template string // Template name in embedded FS (e.g., "params/style_simple.go.tmpl")
}
ParamTemplate defines a template for a parameter styling/binding function.
type ReceiverTemplate ¶
type ReceiverTemplate struct {
Name string // Template name (e.g., "receiver")
Imports []Import // Required imports for this template
Template string // Template path in embedded FS
}
ReceiverTemplate defines a template for receiver (webhook/callback) generation.
type ServerTemplate ¶
type ServerTemplate struct {
Name string // Template name (e.g., "interface", "handler")
Imports []Import // Required imports for this template
Template string // Template path in embedded FS
}
ServerTemplate defines a template for server generation.
type TypeTemplate ¶
type TypeTemplate struct {
Name string // Type name (e.g., "Email", "Date")
Imports []Import // Required imports for this type
Template string // Template name in embedded FS (e.g., "types/email.tmpl")
}
TypeTemplate defines a template for a custom type along with its required imports.
Directories
¶
| Path | Synopsis |
|---|---|
|
test
|
|
|
helpers/genhelpers
command
genhelpers generates Go files from helper and param templates.
|
genhelpers generates Go files from helper and param templates. |
|
types/gentypes
command
gentypes generates Go type files from templates.
|
gentypes generates Go type files from templates. |