Documentation ¶
Index ¶
- Constants
- Variables
- func NewObjectID() string
- func Put_Test(i interface{})
- func Put_Test2(i interface{})
- func Put_User(i interface{})
- type E_Quest_Status
- 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) EnsureCounter(collection, id string) error
- func (sc *SimpleClient) EnsureIndexes(key []string) error
- func (sc *SimpleClient) EnsureUniqueIndex(collection string, key []string) error
- func (sc SimpleClient) FindOne_User(ctx context.Context, query interface{}, opts ...options.FindOptions) (one *User, err error)
- func (sc SimpleClient) FindSome_User(ctx context.Context, query interface{}, opts ...options.FindOptions) (some []*User, err error)
- func (sc *SimpleClient) Init(ctx context.Context, uri string, conf *qmgo.Config, o ...options.ClientOptions) (err error)
- func (sc *SimpleClient) NextSeq(id string) (int, error)
- func (sc *SimpleClient) Release()
- func (sc SimpleClient) UpdateSome_User(ctx context.Context, selector interface{}, update interface{}, ...) (result *qmgo.UpdateResult, err error)
- func (sc SimpleClient) UpsertByObjID_User(ctx context.Context, objID interface{}, update interface{}, ...) (result *qmgo.UpdateResult, err error)
- func (sc SimpleClient) Upsert_User(ctx context.Context, selector interface{}, update interface{}, ...) (result *qmgo.UpdateResult, err error)
- type Test
- func (m Test) Clone() *Test
- func (*Test) Descriptor() ([]byte, []int)
- 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 (m *Test) MarshalToSizedBuffer(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) ToMsg(n *msg.Test) *msg.Test
- 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 Test2
- func (m Test2) Clone() *Test2
- func (*Test2) Descriptor() ([]byte, []int)
- func (m *Test2) GetI32() int32
- func (m *Test2) GetTs() []*Test
- func (m *Test2) GetU32() uint32
- func (m Test2) JsonString() string
- func (m *Test2) Marshal() (dAtA []byte, err error)
- func (m *Test2) MarshalTo(dAtA []byte) (int, error)
- func (m *Test2) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Test2) ProtoMessage()
- func (m *Test2) Reset()
- func (m *Test2) ResetEx()
- func (m *Test2) Size() (n int)
- func (m *Test2) String() string
- func (m Test2) ToMsg(n *msg.Test2) *msg.Test2
- func (m *Test2) Unmarshal(dAtA []byte) error
- func (m *Test2) XXX_DiscardUnknown()
- func (m *Test2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Test2) XXX_Merge(src proto.Message)
- func (m *Test2) XXX_Size() int
- func (m *Test2) XXX_Unmarshal(b []byte) error
- type Test2Map
- func (m *Test2Map) Add(key int64) (value *Test2)
- func (m *Test2Map) Clear()
- func (m Test2Map) Clone() (n *Test2Map)
- func (m *Test2Map) Each(f func(key int64, value *Test2) (continued bool))
- func (m *Test2Map) Get(key int64) (value *Test2, ok bool)
- func (m *Test2Map) Remove(key int64) (removed bool)
- func (m *Test2Map) RemoveOne(fn func(key int64, value *Test2) (removed bool))
- func (m *Test2Map) RemoveSome(fn func(key int64, value *Test2) (removed bool))
- func (m *Test2Map) Set(key int64, value *Test2)
- func (m Test2Map) Size() int
- func (m Test2Map) ToMsg(n map[int64]*msg.Test2) map[int64]*msg.Test2
- type Test2Slice
- func (s *Test2Slice) Add() *Test2
- func (s *Test2Slice) AddOne(newOne *Test2) *Test2
- func (s *Test2Slice) Clear()
- func (s Test2Slice) Clone() (n *Test2Slice)
- func (s Test2Slice) Each(fn func(index int, element *Test2) (continued bool))
- func (s *Test2Slice) RemoveOne(fn func(index int, element *Test2) (removed bool))
- func (s *Test2Slice) RemoveSome(fn func(index int, element *Test2) (removed bool))
- func (s Test2Slice) Size() int
- func (s Test2Slice) ToMsg(n []*msg.Test2) []*msg.Test2
- type User
- func (m User) Clone() *User
- func (*User) Descriptor() ([]byte, []int)
- 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) GetObjID() string
- func (m *User) GetQuest() E_Quest_Status
- func (m *User) GetQuestMap() map[int64]E_Quest_Status
- func (m *User) GetQuestSlice() []E_Quest_Status
- 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) Insert(ctx context.Context, opts ...options.InsertOneOptions) (result *qmgo.InsertOneResult, err error)
- func (m User) JsonString() string
- func (m *User) Marshal() (dAtA []byte, err error)
- func (m *User) MarshalTo(dAtA []byte) (int, error)
- func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*User) ProtoMessage()
- func (m User) RemoveByObjID(ctx context.Context, opts ...options.RemoveOptions) error
- func (m *User) Reset()
- func (m *User) ResetEx()
- func (m *User) Size() (n int)
- func (m *User) String() string
- func (m User) ToMsg(n *msg.User) *msg.User
- func (m *User) Unmarshal(dAtA []byte) error
- func (m User) Update(ctx context.Context, selector interface{}, update interface{}, ...) (err error)
- func (m User) UpdateByObjID(ctx context.Context, opts ...options.UpdateOptions) (err error)
- func (m User) Upsert(ctx context.Context, selector interface{}, opts ...options.UpsertOptions) (result *qmgo.UpdateResult, err 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") ErrUnexpectedEndOfGroupUser = fmt.Errorf("proto: unexpected end of group") )
View Source
var E_Quest_Status_name = map[int32]string{
0: "Lock",
1: "Unlocked",
2: "Progress",
3: "Unclaimed",
4: "Claimed",
5: "Closed",
}
View Source
var E_Quest_Status_value = map[string]int32{
"Lock": 0,
"Unlocked": 1,
"Progress": 2,
"Unclaimed": 3,
"Claimed": 4,
"Closed": 5,
}
View Source
var SC = NewSimpleClient()
Functions ¶
func NewObjectID ¶
func NewObjectID() string
Types ¶
type E_Quest_Status ¶
type E_Quest_Status int32
/ 任务状态
const ( /// 未解锁 E_Quest_Status_Lock E_Quest_Status = 0 /// 已解锁 未接受 E_Quest_Status_Unlocked E_Quest_Status = 1 /// 已解锁 已接受 E_Quest_Status_Progress E_Quest_Status = 2 /// 已完成 奖励未领取 E_Quest_Status_Unclaimed E_Quest_Status = 3 /// 已完成 奖励已领取 E_Quest_Status_Claimed E_Quest_Status = 4 /// 已结束 E_Quest_Status_Closed E_Quest_Status = 5 )
func (E_Quest_Status) EnumDescriptor ¶
func (E_Quest_Status) EnumDescriptor() ([]byte, []int)
func (E_Quest_Status) String ¶
func (x E_Quest_Status) String() string
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) EnsureCounter ¶
func (sc *SimpleClient) EnsureCounter(collection, id string) error
func (*SimpleClient) EnsureIndexes ¶
func (sc *SimpleClient) EnsureIndexes(key []string) error
func (*SimpleClient) EnsureUniqueIndex ¶
func (sc *SimpleClient) EnsureUniqueIndex(collection string, key []string) error
func (SimpleClient) FindOne_User ¶
func (sc SimpleClient) FindOne_User(ctx context.Context, query interface{}, opts ...options.FindOptions) (one *User, err error)
func (SimpleClient) FindSome_User ¶
func (sc SimpleClient) FindSome_User(ctx context.Context, query interface{}, opts ...options.FindOptions) (some []*User, err error)
func (*SimpleClient) Init ¶
func (sc *SimpleClient) Init(ctx context.Context, uri string, conf *qmgo.Config, o ...options.ClientOptions) (err error)
func (*SimpleClient) Release ¶
func (sc *SimpleClient) Release()
func (SimpleClient) UpdateSome_User ¶
func (sc SimpleClient) UpdateSome_User(ctx context.Context, selector interface{}, update interface{}, opts ...options.UpdateOptions) (result *qmgo.UpdateResult, err error)
func (SimpleClient) UpsertByObjID_User ¶
func (sc SimpleClient) UpsertByObjID_User(ctx context.Context, objID interface{}, update interface{}, opts ...options.UpsertOptions) (result *qmgo.UpdateResult, err error)
func (SimpleClient) Upsert_User ¶
func (sc SimpleClient) Upsert_User(ctx context.Context, selector interface{}, update interface{}, opts ...options.UpsertOptions) (result *qmgo.UpdateResult, err error)
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"` }
/ 测试结构体
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 Test2 ¶
type Test2 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 Ts []*Test `protobuf:"bytes,3,rep,name=ts,proto3" json:"ts,omitempty"` }
/测试结构体 @map_key=int64 @slice
func Clone_Test2_Slice ¶
func (*Test2) Descriptor ¶
func (Test2) JsonString ¶
func (*Test2) ProtoMessage ¶
func (*Test2) ProtoMessage()
func (*Test2) XXX_DiscardUnknown ¶
func (m *Test2) XXX_DiscardUnknown()
func (*Test2) XXX_Marshal ¶
func (*Test2) XXX_Unmarshal ¶
type Test2Map ¶
func NewTest2Map ¶
func NewTest2Map() (m *Test2Map)
func ToTest2Map ¶
func (*Test2Map) RemoveSome ¶
type Test2Slice ¶
type Test2Slice []*Test2
func NewTest2Slice ¶
func NewTest2Slice() *Test2Slice
func ToTest2Slice ¶
func ToTest2Slice(s []*Test2) *Test2Slice
func (*Test2Slice) Add ¶
func (s *Test2Slice) Add() *Test2
func (*Test2Slice) AddOne ¶
func (s *Test2Slice) AddOne(newOne *Test2) *Test2
func (*Test2Slice) Clear ¶
func (s *Test2Slice) Clear()
func (Test2Slice) Clone ¶
func (s Test2Slice) Clone() (n *Test2Slice)
func (Test2Slice) Each ¶
func (s Test2Slice) Each(fn func(index int, element *Test2) (continued bool))
func (*Test2Slice) RemoveOne ¶
func (s *Test2Slice) RemoveOne(fn func(index int, element *Test2) (removed bool))
func (*Test2Slice) RemoveSome ¶
func (s *Test2Slice) RemoveSome(fn func(index int, element *Test2) (removed bool))
func (Test2Slice) Size ¶
func (s Test2Slice) Size() int
func (Test2Slice) ToMsg ¶
func (s Test2Slice) ToMsg(n []*msg.Test2) []*msg.Test2
type User ¶
type User struct { // / objid ObjID string `protobuf:"bytes,20,opt,name=ObjID,proto3" json:"ObjID,omitempty" json:"_id" bson:"_id"` // / 用户id // @msg ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty" json:"id" bson:"id"` // / 帐号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"` // / 测试整型map // @msg IMap map[int32]int32 `` /* 152-byte string literal not displayed */ // / 测试结构体map // @msg TestMap map[int32]*Test `` /* 157-byte string literal not displayed */ // / 测试枚举 // @msg Quest E_Quest_Status `protobuf:"varint,12,opt,name=Quest,proto3,enum=model.E_Quest_Status" json:"Quest,omitempty"` // / 测试枚举map // @msg QuestMap map[int64]E_Quest_Status `` /* 186-byte string literal not displayed */ // / 测试枚举slice // @msg QuestSlice []E_Quest_Status `protobuf:"varint,14,rep,packed,name=QuestSlice,proto3,enum=model.E_Quest_Status" json:"QuestSlice,omitempty"` }
/ 用户数据 @collection
func Clone_User_Slice ¶
func (*User) Descriptor ¶
func (*User) GetAccountID ¶
func (*User) GetCreateTime ¶
func (*User) GetQuest ¶
func (m *User) GetQuest() E_Quest_Status
func (*User) GetQuestMap ¶
func (m *User) GetQuestMap() map[int64]E_Quest_Status
func (*User) GetQuestSlice ¶
func (m *User) GetQuestSlice() []E_Quest_Status
func (*User) GetServerID ¶
func (*User) GetTestMap ¶
func (User) Insert ¶
func (m User) Insert(ctx context.Context, opts ...options.InsertOneOptions) (result *qmgo.InsertOneResult, err error)
func (User) JsonString ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (User) RemoveByObjID ¶
func (User) UpdateByObjID ¶
func (User) Upsert ¶
func (m User) Upsert(ctx context.Context, selector interface{}, opts ...options.UpsertOptions) (result *qmgo.UpdateResult, err error)
func (*User) XXX_DiscardUnknown ¶
func (m *User) XXX_DiscardUnknown()
func (*User) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.