All Projects → shamaton → zeroformatter

shamaton / zeroformatter

Licence: MIT license
golang version zeroformatter

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to zeroformatter

Hprose Js
Hprose is a cross-language RPC. This project is Hprose 2.0 RPC for JavaScript
Stars: ✭ 133 (+358.62%)
Mutual labels:  serializer
Jld.jl
Saving and loading julia variables while preserving native types
Stars: ✭ 188 (+548.28%)
Mutual labels:  serializer
Simpleams
Fast modern plain Ruby serializers using zero dependencies
Stars: ✭ 230 (+693.1%)
Mutual labels:  serializer
Djangorestframework Dataclasses
Dataclasses serializer for Django REST framework
Stars: ✭ 138 (+375.86%)
Mutual labels:  serializer
Zeroformatter
Infinitely Fast Deserializer for .NET, .NET Core and Unity.
Stars: ✭ 2,216 (+7541.38%)
Mutual labels:  serializer
Binaryserializer
A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
Stars: ✭ 197 (+579.31%)
Mutual labels:  serializer
Adonis Bumblebee
Api Transformer for AdonisJs Framework
Stars: ✭ 125 (+331.03%)
Mutual labels:  serializer
Rdflib Jsonld
JSON-LD parser and serializer plugins for RDFLib (Python 2.6+)
Stars: ✭ 250 (+762.07%)
Mutual labels:  serializer
Activej
ActiveJ is an alternative Java platform built from the ground up. ActiveJ redefines web, high load, and cloud programming in Java, featuring ultimate performance and scalability!
Stars: ✭ 183 (+531.03%)
Mutual labels:  serializer
Hyperion
Polymorphic serialization for .NET
Stars: ✭ 225 (+675.86%)
Mutual labels:  serializer
Django Simple Serializer
serialize django data in a simple way
Stars: ✭ 157 (+441.38%)
Mutual labels:  serializer
Hprose Php
Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP
Stars: ✭ 1,952 (+6631.03%)
Mutual labels:  serializer
Home
A configurable and eXtensible Xml serializer for .NET.
Stars: ✭ 208 (+617.24%)
Mutual labels:  serializer
Flatsharp
Fast, idiomatic C# implementation of Flatbuffers
Stars: ✭ 133 (+358.62%)
Mutual labels:  serializer
Parse5
HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.
Stars: ✭ 2,778 (+9479.31%)
Mutual labels:  serializer
Swiftmsgpack
💬 Fast & Lightweight MsgPack Serializer & Deserializer for Swift
Stars: ✭ 128 (+341.38%)
Mutual labels:  serializer
Jsonapi Utils
Build JSON API-compliant APIs on Rails with no (or less) learning curve.
Stars: ✭ 191 (+558.62%)
Mutual labels:  serializer
vdf
📜 Package for working with Valve's text and binary KeyValue format
Stars: ✭ 146 (+403.45%)
Mutual labels:  serializer
Pxi
🧚 pxi (pixie) is a small, fast, and magical command-line data processor similar to jq, mlr, and awk.
Stars: ✭ 248 (+755.17%)
Mutual labels:  serializer
Hagar
Fast, flexible, and version-tolerant serializer for .NET
Stars: ✭ 216 (+644.83%)
Mutual labels:  serializer

zeroformatter

GoDoc Build Status Coverage Status Releases

golang version zeroformatter

Usage

Installation

go get github.com/shamaton/zeroformatter

How to use

use simply

package main;

import (
  "github.com/shamaton/zeroformatter"
  "log"
)

func main() {
	type Struct struct {
		String string
	}
	h := Struct{String: "zeroformatter"}

	d, err := zeroformatter.Serialize(h)
	if err != nil {
		log.Fatal(err)
	}
	r := Struct{}
	err = zeroformatter.Deserialize(&r, d)
	if err != nil {
		log.Fatal(err)
	}
}

delay

package main;

import (
  "github.com/shamaton/zeroformatter"
  "log"
)

func how_to_use(b []byte) {
	type Struct struct {
		String string
	}
	
	r := Struct{}
	dds, _ := zeroformatter.DelayDeserialize(&r, b)
	
	// by element
	if err := dds.DeserializeByElement(&r.String); err != nil {
		log.Fatal(err)
	}
	
	// or by index
	if err := dds.DeserializeByIndex(0); err != nil {
	  log.Fatal(err)
	}
}

Supported type

Primitive

C# Go
Int16 int16
Int32 int32, int
Int64 int64
UInt16 uint16
UInt32 uint32, uint
UInt64 uint64
Single float32
Double float64
Boolean bool
Byte uint8
SByte int8
TimeSpan time.Duration
DateTime time.Time
String string

Extension within golang

As these types can not convert with primitive type, I defined parent classes in golang. These are only wrapping. please see codes.

C# Go
Char zeroformatter.Char(rune)
DateTimeOffset zeroformatter.DateTimeOffset(time.Time)

Array/Slice

C# Go
T[], List []T, [N]T

Map

C# Go
Dictionary<K, V> map[K]V

Object

C# Go
Struct struct

Not supported

type? is not supported, because golang doen't allow null in primitve types.

License

This library is under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].