Popularity
1.6
Declining
Activity
0.0
Declining
14
1
3
Programming language: Go
License: MIT License
Tags:
Serialization
Latest version: v0.0.1
fwencoder alternatives and similar packages
Based on the "Serialization" category.
Alternatively, view fwencoder alternatives based on common mentions on social networks and blogs.
-
goprotobuf
Go support, in the form of a library and protocol compiler plugin, for Google's protocol buffers. -
jsoniter
A high-performance 100% compatible drop-in replacement of "encoding/json" -
mapstructure
Go library for decoding generic map values into native Go structures. -
go-codec
High Performance, feature-Rich, idiomatic encode, decode and rpc library for msgpack, cbor and json, with runtime-based OR code-generation support -
csvutil
High Performance, idiomatic CSV record encoding and decoding to native Go structures. -
php_session_decoder
GoLang library for working with PHP session format and PHP Serialize/Unserialize functions -
structomap
Library to easily and dynamically generate maps from static structures. -
bel
Generate TypeScript interfaces from Go structs/interfaces. Useful for JSON RPC. -
go-serializer
Serialize custom types or content to []byte or string -
go-lctree
Provides a CLI and primitives to serialize and deserialize LeetCode binary trees. -
unitpacking
Library to pack unit vectors into as fewest bytes as possible.
Scout APM - Leading-edge performance monitoring starting at $39/month
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
Do you think we are missing an alternative of fwencoder or a related project?
README
Fixed width file parser (encoder/decoder) for GO (golang)
This library is using to parse fixed-width table data like:
Name Address Postcode Phone Credit Limit Birthday
Evan Whitehouse V4560 Camel Back Road 3122 (918) 605-5383 1000000.5 19870101
Chuck Norris P.O. Box 872 77868 (713) 868-6003 10909300 19651203
Install
To install the library use the following command:
$ go get -u github.com/o1egl/fwencoder
Decoding example
Parsing data from io.Reader:
type Person struct {
Name string
Address string
Postcode int
Phone string
CreditLimit float64 `json:"Credit Limit"`
Bday time.Time `column:"Birthday" format:"20060102"`
}
f, _ := os.Open("/path/to/file")
defer f.Close
var people []Person
err := fwencoder.UnmarshalReader(f, &people)
You can also parse data from byte array:
b, _ := ioutil.ReadFile("/path/to/file")
var people []Person
err := fwencoder.Unmarshal(b, &people)
Encoding example
people := []Person{
Name: "John",
Address: "P.O. Box 872",
Phone: "(713) 868-6003",
CreditLimit: 10909300,
Bday: "19651203"
}
b, err := Marshal(&people)
fmt.Println(string(b))
or you can directly write to io.Writer
people := []Person{
Name: "John",
Address: "P.O. Box 872",
Phone: "(713) 868-6003",
CreditLimit: 10909300,
Bday: "19651203"
}
err := MarshalWriter(os.Stdout, &people)
*Note that all licence references and agreements mentioned in the fwencoder README section above
are relevant to that project's source code only.