github.com/zignig/go-ipfs@v0.0.0-20141111235910-c9e5fdf55a52/net/mux/internal/pb/mux.pb.go (about)

     1  // Code generated by protoc-gen-gogo.
     2  // source: mux.proto
     3  // DO NOT EDIT!
     4  
     5  /*
     6  Package mux_pb is a generated protocol buffer package.
     7  
     8  It is generated from these files:
     9  	mux.proto
    10  
    11  It has these top-level messages:
    12  	PBProtocolMessage
    13  */
    14  package mux_pb
    15  
    16  import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/gogoprotobuf/proto"
    17  import math "math"
    18  
    19  // Reference imports to suppress errors if they are not otherwise used.
    20  var _ = proto.Marshal
    21  var _ = math.Inf
    22  
    23  type ProtocolID int32
    24  
    25  const (
    26  	ProtocolID_Test       ProtocolID = 0
    27  	ProtocolID_Identify   ProtocolID = 1
    28  	ProtocolID_Routing    ProtocolID = 2
    29  	ProtocolID_Exchange   ProtocolID = 3
    30  	ProtocolID_Diagnostic ProtocolID = 4
    31  )
    32  
    33  var ProtocolID_name = map[int32]string{
    34  	0: "Test",
    35  	1: "Identify",
    36  	2: "Routing",
    37  	3: "Exchange",
    38  	4: "Diagnostic",
    39  }
    40  var ProtocolID_value = map[string]int32{
    41  	"Test":       0,
    42  	"Identify":   1,
    43  	"Routing":    2,
    44  	"Exchange":   3,
    45  	"Diagnostic": 4,
    46  }
    47  
    48  func (x ProtocolID) Enum() *ProtocolID {
    49  	p := new(ProtocolID)
    50  	*p = x
    51  	return p
    52  }
    53  func (x ProtocolID) String() string {
    54  	return proto.EnumName(ProtocolID_name, int32(x))
    55  }
    56  func (x *ProtocolID) UnmarshalJSON(data []byte) error {
    57  	value, err := proto.UnmarshalJSONEnum(ProtocolID_value, data, "ProtocolID")
    58  	if err != nil {
    59  		return err
    60  	}
    61  	*x = ProtocolID(value)
    62  	return nil
    63  }
    64  
    65  type PBProtocolMessage struct {
    66  	ProtocolID       *ProtocolID `protobuf:"varint,1,req,enum=mux.pb.ProtocolID" json:"ProtocolID,omitempty"`
    67  	Data             []byte      `protobuf:"bytes,2,req" json:"Data,omitempty"`
    68  	XXX_unrecognized []byte      `json:"-"`
    69  }
    70  
    71  func (m *PBProtocolMessage) Reset()         { *m = PBProtocolMessage{} }
    72  func (m *PBProtocolMessage) String() string { return proto.CompactTextString(m) }
    73  func (*PBProtocolMessage) ProtoMessage()    {}
    74  
    75  func (m *PBProtocolMessage) GetProtocolID() ProtocolID {
    76  	if m != nil && m.ProtocolID != nil {
    77  		return *m.ProtocolID
    78  	}
    79  	return ProtocolID_Test
    80  }
    81  
    82  func (m *PBProtocolMessage) GetData() []byte {
    83  	if m != nil {
    84  		return m.Data
    85  	}
    86  	return nil
    87  }
    88  
    89  func init() {
    90  	proto.RegisterEnum("mux.pb.ProtocolID", ProtocolID_name, ProtocolID_value)
    91  }