Documentation ¶
Index ¶
- Constants
- type CSV
- type CSVConfig
- type Content
- func (c *Content) InitMarshaller(config *config.IOConfig, exclude []string, inputType, outputType reflect.Type) error
- func (c *Content) Marshal(format string, field string, response interface{}, options ...interface{}) ([]byte, error)
- func (c *Content) UnmarshalFunc(request *http.Request) shared.Unmarshal
- func (c *Content) UnmarshallerInterceptors() marshal.Transforms
- type JSON
- type Marshaller
- type TabularJSONConfig
- type Unmarshal
- type Unmarshaller
- type XLS
- type XLSConfig
- type XMLConfig
Constants ¶
View Source
const ( JSONFormat = "json" XMLFormat = "xml" XLSFormat = "xls" CSVFormat = "csv" JSONDataFormatTabular = "tabular" )
View Source
const ( XLSContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" CSVContentType = "text/csv" JSONContentType = "application/json" TabularJSONFormat = "application/json" XMLContentType = "application/xml" )
View Source
const (
HeaderContentType = "Content-Type"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSVConfig ¶
type CSVConfig struct { Separator string NullValue string InputMarshaller *csv.Marshaller OutputMarshaller *csv.Marshaller // contains filtered or unexported fields }
type Content ¶
type Content struct { Marshaller Marshaller `json:",omitempty"` DateFormat string `json:",omitempty"` CSV *CSVConfig `json:",omitempty"` XLS *XLSConfig `json:",omitempty"` XML *XMLConfig `json:",omitempty"` TabularJSON *TabularJSONConfig `json:",omitempty"` Transforms marshal.Transforms `json:"Transforms,omitempty" yaml:"Transforms,omitempty" ` // contains filtered or unexported fields }
func (*Content) InitMarshaller ¶
func (*Content) Marshal ¶
func (c *Content) Marshal(format string, field string, response interface{}, options ...interface{}) ([]byte, error)
Marshal marshals response TODO refactor it to take just a marshaller for format, marshaller should only deal with response (requiring field, reader data seems code design issue)
func (*Content) UnmarshalFunc ¶
func (*Content) UnmarshallerInterceptors ¶
func (c *Content) UnmarshallerInterceptors() marshal.Transforms
type JSON ¶
type JSON struct { Unmarshal JsonMarshaller *json.Marshaller }
type Marshaller ¶
func (*Marshaller) Init ¶
func (m *Marshaller) Init(lookupType xreflect.LookupType) error
type TabularJSONConfig ¶
type TabularJSONConfig struct { FloatPrecision string InputMarhsaller *tabjson.Marshaller OutputMarshaller *tabjson.Marshaller // contains filtered or unexported fields }
type Unmarshal ¶
type Unmarshal struct { TypeName string // contains filtered or unexported fields }
type Unmarshaller ¶
type XLS ¶
type XLS struct { Unmarshal XlsMarshaller *xlsy.Marshaller }
type XLSConfig ¶
type XMLConfig ¶
type XMLConfig struct { FloatPrecision string InputMarshaller *xmlify.Marshaller OutputMarshaller *xmlify.Marshaller // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.