encoder

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EncodeThrough

func EncodeThrough(app inter.App, content interface{}, encoders []inter.Encoder) (string, error)

func JsonToValue

func JsonToValue(json string) support.Value

func RequestWithFormToValue

func RequestWithFormToValue(request inter.Request) support.Value

func RequestWithJsonToValue

func RequestWithJsonToValue(request inter.Request) support.Value

Types

type Error

type Error struct {
	Title string `json:"title"`
}

type ErrorsToHtml

type ErrorsToHtml struct {
	View func(app inter.App, err error) inter.View
}

func (ErrorsToHtml) EncodeThrough

func (e ErrorsToHtml) EncodeThrough(app inter.App, object interface{}, _ []inter.Encoder) (string, error)

func (ErrorsToHtml) IsAble

func (e ErrorsToHtml) IsAble(object interface{}) bool

type ErrorsToJson

type ErrorsToJson struct {
	Jsonapi map[string]string `json:"jsonapi"`
	Errors  []Error           `json:"errors"`
}

func (ErrorsToJson) EncodeThrough

func (e ErrorsToJson) EncodeThrough(app inter.App, object interface{}, encoders []inter.Encoder) (string, error)

func (ErrorsToJson) IsAble

func (e ErrorsToJson) IsAble(object interface{}) bool

type InterfaceToHtml

type InterfaceToHtml struct{}

func (InterfaceToHtml) EncodeThrough

func (j InterfaceToHtml) EncodeThrough(_ inter.App, object interface{}, _ []inter.Encoder) (string, error)

func (InterfaceToHtml) IsAble

func (j InterfaceToHtml) IsAble(object interface{}) bool

type InterfaceToJson

type InterfaceToJson struct{}

func (InterfaceToJson) EncodeThrough

func (j InterfaceToJson) EncodeThrough(_ inter.App, object interface{}, _ []inter.Encoder) (string, error)

func (InterfaceToJson) IsAble

func (j InterfaceToJson) IsAble(_ interface{}) bool

type JsonReaderToJson

type JsonReaderToJson struct{}

func (JsonReaderToJson) EncodeThrough

func (j JsonReaderToJson) EncodeThrough(app inter.App, object interface{}, encoders []inter.Encoder) (string, error)

func (JsonReaderToJson) IsAble

func (j JsonReaderToJson) IsAble(object interface{}) bool

type JsonToJson

type JsonToJson struct{}

func (JsonToJson) EncodeThrough

func (j JsonToJson) EncodeThrough(_ inter.App, object interface{}, _ []inter.Encoder) (string, error)

func (JsonToJson) IsAble

func (j JsonToJson) IsAble(object interface{}) bool

Determine if json is already valid

type RawToHtml

type RawToHtml struct{}

func (RawToHtml) EncodeThrough

func (v RawToHtml) EncodeThrough(_ inter.App, object interface{}, encoders []inter.Encoder) (string, error)

func (RawToHtml) IsAble

func (v RawToHtml) IsAble(object interface{}) bool

type RawToJson

type RawToJson struct{}

func (RawToJson) EncodeThrough

func (v RawToJson) EncodeThrough(app inter.App, object interface{}, encoders []inter.Encoder) (string, error)

func (RawToJson) IsAble

func (v RawToJson) IsAble(object interface{}) bool

type StringToString

type StringToString struct{}

func (StringToString) EncodeThrough

func (j StringToString) EncodeThrough(_ inter.App, object interface{}, _ []inter.Encoder) (string, error)

func (StringToString) IsAble

func (j StringToString) IsAble(object interface{}) bool

type StringerToHtml

type StringerToHtml struct{}

func (StringerToHtml) EncodeThrough

func (h StringerToHtml) EncodeThrough(_ inter.App, object interface{}, _ []inter.Encoder) (string, error)

func (StringerToHtml) IsAble

func (h StringerToHtml) IsAble(object interface{}) bool

type ViewToHtml

type ViewToHtml struct{}

func (ViewToHtml) EncodeThrough

func (v ViewToHtml) EncodeThrough(app inter.App, object interface{}, _ []inter.Encoder) (string, error)

func (ViewToHtml) IsAble

func (v ViewToHtml) IsAble(object interface{}) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL