Skip to content

Instantly share code, notes, and snippets.

@ctaggart
Created July 14, 2014 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctaggart/0fa68caadd4839a9d2de to your computer and use it in GitHub Desktop.
Save ctaggart/0fa68caadd4839a9d2de to your computer and use it in GitHub Desktop.
froto
using ProtoBuf;
using System.IO;
namespace Riak
{
[ProtoContract]
public sealed class RpbErrorResp
{
public byte[] errmsg { get; set; }
public uint errcode { get; set; }
}
[ProtoContract]
public sealed class RpbGetServerInfoResp
{
public byte[] node { get; set; }
public byte[] server_version { get; set; }
}
[ProtoContract]
public sealed class RpbPair
{
public byte[] key { get; set; }
public byte[] value { get; set; }
}
}
namespace Riak
{
using Riak;
public static class RiakProto
{
public static RpbErrorResp CreateRpbErrorResp()
{
return new RpbErrorResp();
}
public static void SerializeRpbErrorResp(Stream stream, RpbErrorResp instance)
{
Serializer.Serialize(stream, instance);
}
public static RpbErrorResp DeserializeRpbErrorResp(Stream stream)
{
return Serializer.Deserialize<RpbErrorResp>(stream);
}
public static RpbGetServerInfoResp CreateRpbGetServerInfoResp()
{
return new RpbGetServerInfoResp();
}
public static void SerializeRpbGetServerInfoResp(Stream stream, RpbGetServerInfoResp instance)
{
Serializer.Serialize(stream, instance);
}
public static RpbGetServerInfoResp DeserializeRpbGetServerInfoResp(Stream stream)
{
return Serializer.Deserialize<RpbGetServerInfoResp>(stream);
}
public static RpbPair CreateRpbPair()
{
return new RpbPair();
}
public static void SerializeRpbPair(Stream stream, RpbPair instance)
{
Serializer.Serialize(stream, instance);
}
public static RpbPair DeserializeRpbPair(Stream stream)
{
return Serializer.Deserialize<RpbPair>(stream);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment