Documentation ¶
Index ¶
- Constants
- Variables
- func NewEncoder(pathPrefix string, opts ...Option) func(w io.Writer) *Encoder
- func NewEntityCodec(pathPrefix string, opts ...Option) encoding.Codec
- func NewEntityFormCodec(pathPrefix string, opts ...Option) encoding.Codec
- func NewFormEncoder(pathPrefix string, opts ...Option) func(w io.Writer) *FormEncoder
- type Decoder
- type Encoder
- type EncoderConfig
- type FormEncoder
- type Option
Constants ¶
View Source
const HXRequest = "Hx-Request" // it gets normalized by net/http from HX-Request to Hx-Request
Variables ¶
View Source
var FormMimeTypes = []string{
"application/x-www-form-urlencoded",
}
View Source
var MimeTypes = []string{
"text/html",
}
Functions ¶
func NewEntityCodec ¶ added in v0.5.0
NewEntityCodec creates a HTML codec that uses pathPrefix for links creation.
func NewEntityFormCodec ¶ added in v0.5.0
NewEntityFormCodec creates a HTML Form codec that uses pathPrefix for links creation. It will generate a form with editable inputs for each field of your github.com/dolanor/rip.Entity.
func NewFormEncoder ¶
func NewFormEncoder(pathPrefix string, opts ...Option) func(w io.Writer) *FormEncoder
Types ¶
type EncoderConfig ¶ added in v0.8.0
type EncoderConfig struct {
// contains filtered or unexported fields
}
type FormEncoder ¶
type FormEncoder struct {
// contains filtered or unexported fields
}
func (FormEncoder) Encode ¶
func (e FormEncoder) Encode(v interface{}) error
type Option ¶ added in v0.8.0
type Option func(cfg *EncoderConfig)
func WithTemplatesFS ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.