Documentation ¶
Index ¶
- Variables
- type ContactBook
- func (*ContactBook) Descriptor() ([]byte, []int)
- func (m *ContactBook) GetPersons() []*Person
- func (*ContactBook) ProtoMessage()
- func (m *ContactBook) Reset()
- func (m *ContactBook) String() string
- func (m *ContactBook) XXX_DiscardUnknown()
- func (m *ContactBook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ContactBook) XXX_Merge(src proto.Message)
- func (m *ContactBook) XXX_Size() int
- func (m *ContactBook) XXX_Unmarshal(b []byte) error
- type Person
- func (*Person) Descriptor() ([]byte, []int)
- func (m *Person) GetId() int32
- func (m *Person) GetName() string
- func (m *Person) GetPhones() []*Phone
- func (*Person) ProtoMessage()
- func (m *Person) Reset()
- func (m *Person) String() string
- func (m *Person) XXX_DiscardUnknown()
- func (m *Person) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Person) XXX_Merge(src proto.Message)
- func (m *Person) XXX_Size() int
- func (m *Person) XXX_Unmarshal(b []byte) error
- type Phone
- func (*Phone) Descriptor() ([]byte, []int)
- func (m *Phone) GetNumber() string
- func (m *Phone) GetType() PhoneType
- func (*Phone) ProtoMessage()
- func (m *Phone) Reset()
- func (m *Phone) String() string
- func (m *Phone) XXX_DiscardUnknown()
- func (m *Phone) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Phone) XXX_Merge(src proto.Message)
- func (m *Phone) XXX_Size() int
- func (m *Phone) XXX_Unmarshal(b []byte) error
- type PhoneType
Constants ¶
This section is empty.
Variables ¶
View Source
var PhoneType_name = map[int32]string{
0: "HOME",
1: "WORK",
}
View Source
var PhoneType_value = map[string]int32{
"HOME": 0,
"WORK": 1,
}
Functions ¶
This section is empty.
Types ¶
type ContactBook ¶
type ContactBook struct { Persons []*Person `protobuf:"bytes,1,rep,name=persons,proto3" json:"persons,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
联系簿
func (*ContactBook) Descriptor ¶
func (*ContactBook) Descriptor() ([]byte, []int)
func (*ContactBook) GetPersons ¶
func (m *ContactBook) GetPersons() []*Person
func (*ContactBook) ProtoMessage ¶
func (*ContactBook) ProtoMessage()
func (*ContactBook) Reset ¶
func (m *ContactBook) Reset()
func (*ContactBook) String ¶
func (m *ContactBook) String() string
func (*ContactBook) XXX_DiscardUnknown ¶
func (m *ContactBook) XXX_DiscardUnknown()
func (*ContactBook) XXX_Marshal ¶
func (m *ContactBook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ContactBook) XXX_Merge ¶
func (m *ContactBook) XXX_Merge(src proto.Message)
func (*ContactBook) XXX_Size ¶
func (m *ContactBook) XXX_Size() int
func (*ContactBook) XXX_Unmarshal ¶
func (m *ContactBook) XXX_Unmarshal(b []byte) error
type Person ¶
type Person struct { //后面的数字表示标识号 Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //repeated表示可重复 //可以有多个手机 Phones []*Phone `protobuf:"bytes,3,rep,name=phones,proto3" json:"phones,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
人
func (*Person) Descriptor ¶
func (*Person) ProtoMessage ¶
func (*Person) ProtoMessage()
func (*Person) XXX_DiscardUnknown ¶
func (m *Person) XXX_DiscardUnknown()
func (*Person) XXX_Marshal ¶
func (*Person) XXX_Unmarshal ¶
type Phone ¶
type Phone struct { Type PhoneType `protobuf:"varint,1,opt,name=type,proto3,enum=test.PhoneType" json:"type,omitempty"` Number string `protobuf:"bytes,2,opt,name=number,proto3" json:"number,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
手机
func (*Phone) Descriptor ¶
func (*Phone) ProtoMessage ¶
func (*Phone) ProtoMessage()
func (*Phone) XXX_DiscardUnknown ¶
func (m *Phone) XXX_DiscardUnknown()
func (*Phone) XXX_Marshal ¶
func (*Phone) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.