Documentation ¶
Index ¶
- Constants
- Variables
- func NewObjectID() string
- func Put_Test(i interface{})
- func Put_User(i interface{})
- type Int32ToTestMap
- func (m *Int32ToTestMap) Add(key int32) (value *Test)
- func (m *Int32ToTestMap) Clear()
- func (m Int32ToTestMap) Clone() (n *Int32ToTestMap)
- func (m *Int32ToTestMap) Each(f func(key int32, value *Test) (continued bool))
- func (m *Int32ToTestMap) FromMsg(n map[int32]*msg.Test) *Int32ToTestMap
- func (m *Int32ToTestMap) Get(key int32) (value *Test, ok bool)
- func (m *Int32ToTestMap) Remove(key int32) (removed bool)
- func (m *Int32ToTestMap) RemoveOne(fn func(key int32, value *Test) (removed bool))
- func (m *Int32ToTestMap) RemoveSome(fn func(key int32, value *Test) (removed bool))
- func (m *Int32ToTestMap) Set(key int32, value *Test)
- func (m Int32ToTestMap) Size() int
- type Int64ToTestMap
- func (m *Int64ToTestMap) Add(key int64) (value *Test)
- func (m *Int64ToTestMap) Clear()
- func (m Int64ToTestMap) Clone() (n *Int64ToTestMap)
- func (m *Int64ToTestMap) Each(f func(key int64, value *Test) (continued bool))
- func (m *Int64ToTestMap) FromMsg(n map[int64]*msg.Test) *Int64ToTestMap
- func (m *Int64ToTestMap) Get(key int64) (value *Test, ok bool)
- func (m *Int64ToTestMap) Remove(key int64) (removed bool)
- func (m *Int64ToTestMap) RemoveOne(fn func(key int64, value *Test) (removed bool))
- func (m *Int64ToTestMap) RemoveSome(fn func(key int64, value *Test) (removed bool))
- func (m *Int64ToTestMap) Set(key int64, value *Test)
- func (m Int64ToTestMap) Size() int
- type SimpleClient
- func (sc *SimpleClient) CreateUser(accountID int64, serverID int32, name string, sex int32) (m *User, err error)
- func (sc SimpleClient) DBName() string
- func (sc *SimpleClient) DialContext() *mongodb.DialContext
- func (sc *SimpleClient) GetSession() *mongodb.Session
- func (sc *SimpleClient) Init(url string, sessionNum int, dbName string) (err error)
- func (sc *SimpleClient) NextSeq(id string) (int, error)
- func (sc *SimpleClient) PutSession(session *mongodb.Session)
- func (sc *SimpleClient) Release()
- type Test
- func (m Test) Clone() *Test
- func (*Test) Descriptor() ([]byte, []int)
- func (m *Test) FromMsg(n *msg.Test) *Test
- func (m *Test) GetI32() int32
- func (m *Test) GetStr() string
- func (m *Test) GetU32() uint32
- func (m Test) JsonString() string
- func (m *Test) Marshal() (dAtA []byte, err error)
- func (m *Test) MarshalTo(dAtA []byte) (int, error)
- func (*Test) ProtoMessage()
- func (m *Test) Reset()
- func (m *Test) ResetEx()
- func (m *Test) Size() (n int)
- func (m *Test) String() string
- func (m *Test) Unmarshal(dAtA []byte) error
- func (m *Test) XXX_DiscardUnknown()
- func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Test) XXX_Merge(src proto.Message)
- func (m *Test) XXX_Size() int
- func (m *Test) XXX_Unmarshal(b []byte) error
- type TestSlice
- func (s *TestSlice) Add() *Test
- func (s *TestSlice) AddOne(newOne *Test) *Test
- func (s *TestSlice) Clear()
- func (s TestSlice) Clone() (n *TestSlice)
- func (s TestSlice) Each(fn func(index int, element *Test) (continued bool))
- func (s *TestSlice) RemoveOne(fn func(index int, element *Test) (removed bool))
- func (s *TestSlice) RemoveSome(fn func(index int, element *Test) (removed bool))
- func (s TestSlice) Size() int
- func (s TestSlice) ToMsg(n []*msg.Test) []*msg.Test
- type User
- func (m User) Clone() *User
- func (*User) Descriptor() ([]byte, []int)
- func (m *User) FromMsg(n *msg.User) *User
- func (m *User) GetAccountID() int64
- func (m *User) GetArr() []int32
- func (m *User) GetCreateTime() int64
- func (m *User) GetID() int64
- func (m *User) GetIMap() map[int32]int32
- func (m *User) GetName() string
- func (m *User) GetServerID() int32
- func (m *User) GetSex() int32
- func (m *User) GetStrArr() []string
- func (m *User) GetTest() *Test
- func (m *User) GetTestMap() map[int32]*Test
- func (m *User) GetTests() []*Test
- func (m User) JsonString() string
- func (m *User) Marshal() (dAtA []byte, err error)
- func (m *User) MarshalTo(dAtA []byte) (int, error)
- func (*User) ProtoMessage()
- func (m *User) Reset()
- func (m *User) ResetEx()
- func (m *User) Size() (n int)
- func (m *User) String() string
- func (m *User) Unmarshal(dAtA []byte) error
- func (m *User) XXX_DiscardUnknown()
- func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *User) XXX_Merge(src proto.Message)
- func (m *User) XXX_Size() int
- func (m *User) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const ( TblCounters = "counters" // 用来生成递增序列的表 TblUser = "user" // 角色表 )
Variables ¶
View Source
var ( ErrInvalidLengthUser = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowUser = fmt.Errorf("proto: integer overflow") )
View Source
var SC = NewSimpleClient()
Functions ¶
func NewObjectID ¶
func NewObjectID() string
Types ¶
type Int32ToTestMap ¶
func NewInt32ToTestMap ¶
func NewInt32ToTestMap() (m *Int32ToTestMap)
func ToInt32ToTestMap ¶
func ToInt32ToTestMap(m map[int32]*Test) *Int32ToTestMap
func (*Int32ToTestMap) Add ¶
func (m *Int32ToTestMap) Add(key int32) (value *Test)
func (*Int32ToTestMap) Clear ¶
func (m *Int32ToTestMap) Clear()
func (Int32ToTestMap) Clone ¶
func (m Int32ToTestMap) Clone() (n *Int32ToTestMap)
func (*Int32ToTestMap) Each ¶
func (m *Int32ToTestMap) Each(f func(key int32, value *Test) (continued bool))
func (*Int32ToTestMap) FromMsg ¶
func (m *Int32ToTestMap) FromMsg(n map[int32]*msg.Test) *Int32ToTestMap
func (*Int32ToTestMap) Remove ¶
func (m *Int32ToTestMap) Remove(key int32) (removed bool)
func (*Int32ToTestMap) RemoveOne ¶
func (m *Int32ToTestMap) RemoveOne(fn func(key int32, value *Test) (removed bool))
func (*Int32ToTestMap) RemoveSome ¶
func (m *Int32ToTestMap) RemoveSome(fn func(key int32, value *Test) (removed bool))
func (*Int32ToTestMap) Set ¶
func (m *Int32ToTestMap) Set(key int32, value *Test)
func (Int32ToTestMap) Size ¶
func (m Int32ToTestMap) Size() int
type Int64ToTestMap ¶
func NewInt64ToTestMap ¶
func NewInt64ToTestMap() (m *Int64ToTestMap)
func ToInt64ToTestMap ¶
func ToInt64ToTestMap(m map[int64]*Test) *Int64ToTestMap
func (*Int64ToTestMap) Add ¶
func (m *Int64ToTestMap) Add(key int64) (value *Test)
func (*Int64ToTestMap) Clear ¶
func (m *Int64ToTestMap) Clear()
func (Int64ToTestMap) Clone ¶
func (m Int64ToTestMap) Clone() (n *Int64ToTestMap)
func (*Int64ToTestMap) Each ¶
func (m *Int64ToTestMap) Each(f func(key int64, value *Test) (continued bool))
func (*Int64ToTestMap) FromMsg ¶
func (m *Int64ToTestMap) FromMsg(n map[int64]*msg.Test) *Int64ToTestMap
func (*Int64ToTestMap) Remove ¶
func (m *Int64ToTestMap) Remove(key int64) (removed bool)
func (*Int64ToTestMap) RemoveOne ¶
func (m *Int64ToTestMap) RemoveOne(fn func(key int64, value *Test) (removed bool))
func (*Int64ToTestMap) RemoveSome ¶
func (m *Int64ToTestMap) RemoveSome(fn func(key int64, value *Test) (removed bool))
func (*Int64ToTestMap) Set ¶
func (m *Int64ToTestMap) Set(key int64, value *Test)
func (Int64ToTestMap) Size ¶
func (m Int64ToTestMap) Size() int
type SimpleClient ¶
type SimpleClient struct {
// contains filtered or unexported fields
}
func NewSimpleClient ¶
func NewSimpleClient() (sc *SimpleClient)
func (*SimpleClient) CreateUser ¶
func (SimpleClient) DBName ¶
func (sc SimpleClient) DBName() string
func (*SimpleClient) DialContext ¶
func (sc *SimpleClient) DialContext() *mongodb.DialContext
func (*SimpleClient) GetSession ¶
func (sc *SimpleClient) GetSession() *mongodb.Session
func (*SimpleClient) Init ¶
func (sc *SimpleClient) Init(url string, sessionNum int, dbName string) (err error)
func (*SimpleClient) PutSession ¶
func (sc *SimpleClient) PutSession(session *mongodb.Session)
func (*SimpleClient) Release ¶
func (sc *SimpleClient) Release()
type Test ¶
type Test struct { //@msg=i I32 int32 `protobuf:"varint,1,opt,name=i32,proto3" json:"i32,omitempty"` //@msg U32 uint32 `protobuf:"varint,2,opt,name=u32,proto3" json:"u32,omitempty"` //@msg Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` }
/ 测试结构体 @map_key=int64 @map_key=int32 @slice
func Clone_Test_Slice ¶
func (*Test) Descriptor ¶
func (Test) JsonString ¶
func (*Test) ProtoMessage ¶
func (*Test) ProtoMessage()
func (*Test) XXX_DiscardUnknown ¶
func (m *Test) XXX_DiscardUnknown()
func (*Test) XXX_Unmarshal ¶
type TestSlice ¶
type TestSlice []*Test
func NewTestSlice ¶
func NewTestSlice() *TestSlice
func ToTestSlice ¶
func (*TestSlice) RemoveSome ¶
type User ¶
type User struct { /// 用户id //@bson=_id @msg ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` /// 帐号id // @msg AccountID int64 `protobuf:"varint,2,opt,name=AccountID,proto3" json:"AccountID,omitempty"` /// 服务器ID //@msg ServerID int32 `protobuf:"varint,3,opt,name=ServerID,proto3" json:"ServerID,omitempty"` /// 名字 //@msg Name string `protobuf:"bytes,4,opt,name=Name,proto3" json:"Name,omitempty"` /// 性别 //@msg Sex int32 `protobuf:"varint,5,opt,name=Sex,proto3" json:"Sex,omitempty"` /// 创建时刻 //@msg CreateTime int64 `protobuf:"varint,6,opt,name=CreateTime,proto3" json:"CreateTime,omitempty"` /// 测试数组 //@msg Arr []int32 `protobuf:"varint,7,rep,packed,name=Arr,proto3" json:"Arr,omitempty"` /// 测试字符串数组 //@msg StrArr []string `protobuf:"bytes,8,rep,name=StrArr,proto3" json:"StrArr,omitempty"` /// 测试结构体 //@msg Test *Test `protobuf:"bytes,9,opt,name=Test,proto3" json:"Test,omitempty"` /// 测试结构体切片 //@msg Tests []*Test `protobuf:"bytes,10,rep,name=Tests,proto3" json:"Tests,omitempty"` /// 测试整型map //@msg IMap map[int32]int32 `` /* 152-byte string literal not displayed */ /// 测试结构体map //@msg TestMap map[int32]*Test `` /* 157-byte string literal not displayed */ }
/ 用户数据
func Clone_User_Slice ¶
func (*User) Descriptor ¶
func (*User) GetAccountID ¶
func (*User) GetCreateTime ¶
func (*User) GetServerID ¶
func (*User) GetTestMap ¶
func (User) JsonString ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) XXX_DiscardUnknown ¶
func (m *User) XXX_DiscardUnknown()
func (*User) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.