ditto

package module
v0.0.0-...-b525d5d Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

README

ditto

Documentation

Overview

Package ditto Copyright © 2021 zc2638 <zc2638@qq.com>.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	FormatJSON = "json"
	FormatYaml = "yaml"
	FormatXML  = "xml"
	FormatTOML = "toml"
)

Variables

This section is empty.

Functions

func Marshal

func Marshal(name string, v interface{}) ([]byte, error)

func Register

func Register(name string, m MarshalFunc, um UnmarshalFunc)

func RegisterED

func RegisterED(name string, eFunc EncoderFunc, dFunc DecoderFunc)

func Unmarshal

func Unmarshal(name string, data []byte, v interface{}) error

Types

type Decoder

type Decoder interface {
	Decode(v interface{}) error
}

type DecoderFunc

type DecoderFunc func(r io.Reader) Decoder

type Encoder

type Encoder interface {
	Encode(v interface{}) error
}

type EncoderFunc

type EncoderFunc func(w io.Writer) Encoder

type Engine

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

type MarshalFunc

type MarshalFunc func(v interface{}) ([]byte, error)

type Transfer

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

func NewTransfer

func NewTransfer(in, out string) *Transfer

func (*Transfer) Exchange

func (t *Transfer) Exchange(data []byte) ([]byte, error)

func (*Transfer) ExchangeED

func (t *Transfer) ExchangeED(r io.Reader, w io.Writer) error

type UnmarshalFunc

type UnmarshalFunc func(data []byte, v interface{}) error

Directories

Path Synopsis
Package json Copyright © 2021 zc2638 <zc2638@qq.com>.
Package json Copyright © 2021 zc2638 <zc2638@qq.com>.
Package xml Copyright © 2021 zc2638 <zc2638@qq.com>.
Package xml Copyright © 2021 zc2638 <zc2638@qq.com>.

Jump to

Keyboard shortcuts

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