xml

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ContentType the custom key for the serializer, when used inside iris, Q web frameworks or simply net/http
	ContentType = "text/xml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Indent bool
	Prefix []byte
}

Config is the configuration for this serializer

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for this serializer

func (Config) Merge

func (c Config) Merge(cfg []Config) (config Config)

Merge merges the default with the given config and returns the result

func (Config) MergeSingle

func (c Config) MergeSingle(cfg Config) (config Config)

MergeSingle merges the default with the given config and returns the result

type Serializer

type Serializer struct {
	// contains filtered or unexported fields
}

Serializer the serializer which renders an XML 'object'

func New

func New(cfg ...Config) *Serializer

New returns a new xml serializer

func (*Serializer) Serialize

func (e *Serializer) Serialize(val interface{}, options ...map[string]interface{}) ([]byte, error)

Serialize accepts the 'object' value and converts it to bytes in order to be 'renderable' implements the go-serializer.Serializer interface

Jump to

Keyboard shortcuts

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