Created
July 14, 2014 16:16
-
-
Save ctaggart/0fa68caadd4839a9d2de to your computer and use it in GitHub Desktop.
froto
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
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