msgpack.org[Crystal]
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec
src
.gitignore
.travis.yml
LICENSE
README.md
foo.msgpack
shard.yml

README.md

msgpack.cr

A low-level msgpack codec for Crystal

TODO

  • More specs
  • Mapping

Installation

Add this to your application's shard.yml:

dependencies:
  msgpack:
    github: steakknife/msgpack.cr

Usage

require "msgpack"

1.to_msgpack # => Slice[210, 0, 0, 0, 1]

# write 2_i32 to file foo.msgpack
File.open("foo.msgpack", "w") { |f| f.write(2.to_msgpack) }

Extending

Encoding

Any type can become encodable by including Msgpack::Encodable and defining to_msgpack(io : IO)

Decoding

Any type can become decodable by following the example

Development

Run tests

crystal spec

Alternate Implementations

Contributing

  1. Fork it ( https://github.com/steakknife/msgpack.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

License

MIT

Copyright

2016 (c) Copyright Barry Allard