encoding

package
v0.0.0-...-8d8ec1c Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JSON - JSON 인코딩 식별자
	JSON = "json"
)
View Source
const (
	// NOOP - 응답을 변환없이 반환하기 위한 식별자
	NOOP = "no-op"
)
View Source
const (
	// STRING - 단순 문자열 인코딩 식별자
	STRING = "string"
)

Variables

This section is empty.

Functions

func JSONCollectionDecoder

func JSONCollectionDecoder(r io.Reader, v *map[string]interface{}) error

JSONCollectionDecoder - 지정한 Reader의 JSON 데이터에 대한 Collection 으로 Decoder를 생성하고 Decode 처리 (최종 반환할 때 Array인 형태로 변횐해서 처리)

func JSONDecoder

func JSONDecoder(r io.Reader, v *map[string]interface{}) error

JSONDecoder - 지정한 Reader의 JSON 데이터에 대한 Decoder를 생성하고 Decode 처리

func JSONWrapedCollectionDecoder

func JSONWrapedCollectionDecoder(r io.Reader, v *map[string]interface{}) error

JSONWrapedCollectionDecoder - 지정한 Reader의 JSON 데이터에 대한 Collection 으로 Decoder를 생성하고 Decode 처리

func NewJSONDecoder

func NewJSONDecoder(isCollection bool, wrapCollectionToJSON bool) func(io.Reader, *map[string]interface{}) error

NewJSONDecoder - Collection 여부에 따라서 JSON Decoder 생성

func NewStringDecoder

func NewStringDecoder(_ bool, _ bool) func(io.Reader, *map[string]interface{}) error

NewStringDecoder - 단순 문자열을 위한 Decoder 생성

func NoOpDecoder

func NoOpDecoder(_ io.Reader, _ *map[string]interface{}) error

NoOpDecoder - NO-OP Decoder를 처리를 위한 Dummy 반환

func Register

func Register(name string, dec func(bool, bool) func(io.Reader, *map[string]interface{}) error) error

Register - 지정된 이름으로 Decoder 등록

func StringDecoder

func StringDecoder(r io.Reader, v *map[string]interface{}) error

StringDecoder - 지정한 Reader의 문자열 데이터를 기준으로 Decode 처리

Types

type Decoder

type Decoder func(io.Reader, *map[string]interface{}) error

Decoder - 지정된 Reader의 데이터를 읽어서 맵으로 Decode 처리 함수 형식

type DecoderFactory

type DecoderFactory func(bool, bool) func(io.Reader, *map[string]interface{}) error

DecoderFactory - CollectionDecoder나 EntityDecoder를 반환하는 함수 형식

func Get

func Get(name string) DecoderFactory

Get - 지정한 이름의 Decoder 반환

type DecoderRegister

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

DecoderRegister - 형식없는 맵 방식으로 Decoder를 관리하기 위한 등록 구조

func (*DecoderRegister) Get

func (r *DecoderRegister) Get(name string) func(bool, bool) func(io.Reader, *map[string]interface{}) error

Get - 지정한 이름에 해당하는 Decoder 반환

func (*DecoderRegister) Register

func (r *DecoderRegister) Register(name string, dec func(bool, bool) func(io.Reader, *map[string]interface{}) error) error

Register - 지정한 이름으로 Decorder 등록 구현

Jump to

Keyboard shortcuts

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