coding

package
v1.1.2-pre Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package coding 编码相关的包

Index

Constants

View Source
const (
	EmptyAvroSchema = "EMPTY_AVRO_SCHEMA"
)

Variables

This section is empty.

Functions

func ToAvroObj

func ToAvroObj(params []interface{}) interface{}

ToAvroObj 将参数转化为适用于avro的结构

Types

type Coder

type Coder interface {
	Encode(data interface{}) ([]byte, error)
	Decode([]byte) (data interface{}, err error)
	DecodeIn([]byte, interface{}) error
}

Coder 编码器

func NewAvro

func NewAvro(rawSchema string) (c Coder, err error)

NewAvro 使用avro模式创建一个新的coder

type FunInfo

type FunInfo struct {
	Name       string
	InSchema   string
	OutSchema  string
	ParamTyp   []string
	ResultTyp  []string
	HasContext bool
}

FunInfo 函数信息

func Parse

func Parse(mode string, in interface{}, registerFunc []string) (fi []FunInfo, methods []reflect.Method, reSharps [][]ReSharpFunc)

Parse 将一个结构体的函数信息解析

type ReSharpFunc

type ReSharpFunc func(in interface{}) interface{}

Jump to

Keyboard shortcuts

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