Sample Avro LogicalType
implementations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
"""JSON serialization with value expansion.""" | |
from json import JSONEncoder | |
import re | |
# Try 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = "s = %j; t = %j; print t % (t, s)"; t = "var util = require('util'); var s = %r; var t = %r; console.log(util.format(t, t, s));"; print t % (t, s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint node: true */ | |
'use strict'; | |
var avsc = require('avsc'); | |
/** | |
* Function returning an instrumented type. | |
* | |
* @param schema {Object} Schema to parse. |
Sample type hook implementations for avro.parse
.
Sample custom error hook usages for type.isValid
.
An Avro schema to describe Avro schemas.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"protocol": "Mail", | |
"namespace": "example.proto", | |
"doc": "From https://github.com/phunt/avro-rpc-quickstart/blob/master/src/main/avro/mail.avpr", | |
"types": [ | |
{ | |
"name": "Message", | |
"type": "record", | |
"fields": [ | |
{ |
I hereby claim:
- I am mtth on github.
- I am mtth (https://keybase.io/mtth) on keybase.
- I have a public key whose fingerprint is 5E58 F75A 5DA4 4C4B CD67 13A0 7800 266D A107 476A
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
"""Rest.li encode: a simpler way to encode Rest.Li query parameters. | |
Usage: | |
restli-encode.py [JSON] | |
Arguments: | |
JSON JSON string. Will read stdin if unspecified. |