model

package
v0.0.0-...-2d88998 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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,
}

Functions

func NewObjectID

func NewObjectID() string

func Put_Test

func Put_Test(i interface{})

func Put_Test2

func Put_Test2(i interface{})

func Put_User

func Put_User(i interface{})

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 (sc *SimpleClient) CreateUser(accountID int64, serverID int32, name string, sex int32) (m *User, err error)

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) NextSeq

func (sc *SimpleClient) NextSeq(id string) (int, 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 Clone_Test_Slice(dst []*Test, src []*Test) []*Test

func Get_Test

func Get_Test() *Test

func New_Test

func New_Test() *Test

func (Test) Clone

func (m Test) Clone() *Test

func (*Test) Descriptor

func (*Test) Descriptor() ([]byte, []int)

func (*Test) GetI32

func (m *Test) GetI32() int32

func (*Test) GetStr

func (m *Test) GetStr() string

func (*Test) GetU32

func (m *Test) GetU32() uint32

func (Test) JsonString

func (m Test) JsonString() string

func (*Test) Marshal

func (m *Test) Marshal() (dAtA []byte, err error)

func (*Test) MarshalTo

func (m *Test) MarshalTo(dAtA []byte) (int, error)

func (*Test) MarshalToSizedBuffer

func (m *Test) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Test) ProtoMessage

func (*Test) ProtoMessage()

func (*Test) Reset

func (m *Test) Reset()

func (*Test) ResetEx

func (m *Test) ResetEx()

func (*Test) Size

func (m *Test) Size() (n int)

func (*Test) String

func (m *Test) String() string

func (Test) ToMsg

func (m Test) ToMsg(n *msg.Test) *msg.Test

func (*Test) Unmarshal

func (m *Test) Unmarshal(dAtA []byte) error

func (*Test) XXX_DiscardUnknown

func (m *Test) XXX_DiscardUnknown()

func (*Test) XXX_Marshal

func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Test) XXX_Merge

func (m *Test) XXX_Merge(src proto.Message)

func (*Test) XXX_Size

func (m *Test) XXX_Size() int

func (*Test) XXX_Unmarshal

func (m *Test) XXX_Unmarshal(b []byte) error

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 Clone_Test2_Slice(dst []*Test2, src []*Test2) []*Test2

func Get_Test2

func Get_Test2() *Test2

func New_Test2

func New_Test2() *Test2

func (Test2) Clone

func (m Test2) Clone() *Test2

func (*Test2) Descriptor

func (*Test2) Descriptor() ([]byte, []int)

func (*Test2) GetI32

func (m *Test2) GetI32() int32

func (*Test2) GetTs

func (m *Test2) GetTs() []*Test

func (*Test2) GetU32

func (m *Test2) GetU32() uint32

func (Test2) JsonString

func (m Test2) JsonString() string

func (*Test2) Marshal

func (m *Test2) Marshal() (dAtA []byte, err error)

func (*Test2) MarshalTo

func (m *Test2) MarshalTo(dAtA []byte) (int, error)

func (*Test2) MarshalToSizedBuffer

func (m *Test2) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Test2) ProtoMessage

func (*Test2) ProtoMessage()

func (*Test2) Reset

func (m *Test2) Reset()

func (*Test2) ResetEx

func (m *Test2) ResetEx()

func (*Test2) Size

func (m *Test2) Size() (n int)

func (*Test2) String

func (m *Test2) String() string

func (Test2) ToMsg

func (m Test2) ToMsg(n *msg.Test2) *msg.Test2

func (*Test2) Unmarshal

func (m *Test2) Unmarshal(dAtA []byte) error

func (*Test2) XXX_DiscardUnknown

func (m *Test2) XXX_DiscardUnknown()

func (*Test2) XXX_Marshal

func (m *Test2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Test2) XXX_Merge

func (m *Test2) XXX_Merge(src proto.Message)

func (*Test2) XXX_Size

func (m *Test2) XXX_Size() int

func (*Test2) XXX_Unmarshal

func (m *Test2) XXX_Unmarshal(b []byte) error

type Test2Map

type Test2Map map[int64]*Test2

func NewTest2Map

func NewTest2Map() (m *Test2Map)

func ToTest2Map

func ToTest2Map(m map[int64]*Test2) *Test2Map

func (*Test2Map) Add

func (m *Test2Map) Add(key int64) (value *Test2)

func (*Test2Map) Clear

func (m *Test2Map) Clear()

func (Test2Map) Clone

func (m Test2Map) Clone() (n *Test2Map)

func (*Test2Map) Each

func (m *Test2Map) Each(f func(key int64, value *Test2) (continued bool))

func (*Test2Map) Get

func (m *Test2Map) Get(key int64) (value *Test2, ok bool)

func (*Test2Map) Remove

func (m *Test2Map) Remove(key int64) (removed bool)

func (*Test2Map) RemoveOne

func (m *Test2Map) RemoveOne(fn func(key int64, value *Test2) (removed bool))

func (*Test2Map) RemoveSome

func (m *Test2Map) RemoveSome(fn func(key int64, value *Test2) (removed bool))

func (*Test2Map) Set

func (m *Test2Map) Set(key int64, value *Test2)

func (Test2Map) Size

func (m Test2Map) Size() int

func (Test2Map) ToMsg

func (m Test2Map) ToMsg(n map[int64]*msg.Test2) map[int64]*msg.Test2

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 Clone_User_Slice(dst []*User, src []*User) []*User

func Get_User

func Get_User() *User

func New_User

func New_User() *User

func (User) Clone

func (m User) Clone() *User

func (*User) Descriptor

func (*User) Descriptor() ([]byte, []int)

func (*User) GetAccountID

func (m *User) GetAccountID() int64

func (*User) GetArr

func (m *User) GetArr() []int32

func (*User) GetCreateTime

func (m *User) GetCreateTime() int64

func (*User) GetID

func (m *User) GetID() int64

func (*User) GetIMap

func (m *User) GetIMap() map[int32]int32

func (*User) GetName

func (m *User) GetName() string

func (*User) GetObjID

func (m *User) GetObjID() string

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 (m *User) GetServerID() int32

func (*User) GetSex

func (m *User) GetSex() int32

func (*User) GetStrArr

func (m *User) GetStrArr() []string

func (*User) GetTest

func (m *User) GetTest() *Test

func (*User) GetTestMap

func (m *User) GetTestMap() map[int32]*Test

func (User) Insert

func (m User) Insert(ctx context.Context, opts ...options.InsertOneOptions) (result *qmgo.InsertOneResult, err error)

func (User) JsonString

func (m User) JsonString() string

func (*User) Marshal

func (m *User) Marshal() (dAtA []byte, err error)

func (*User) MarshalTo

func (m *User) MarshalTo(dAtA []byte) (int, error)

func (*User) MarshalToSizedBuffer

func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (User) RemoveByObjID

func (m User) RemoveByObjID(ctx context.Context, opts ...options.RemoveOptions) error

func (*User) Reset

func (m *User) Reset()

func (*User) ResetEx

func (m *User) ResetEx()

func (*User) Size

func (m *User) Size() (n int)

func (*User) String

func (m *User) String() string

func (User) ToMsg

func (m User) ToMsg(n *msg.User) *msg.User

func (*User) Unmarshal

func (m *User) Unmarshal(dAtA []byte) error

func (User) Update

func (m User) Update(ctx context.Context, selector interface{}, update interface{}, opts ...options.UpdateOptions) (err error)

func (User) UpdateByObjID

func (m User) UpdateByObjID(ctx context.Context, opts ...options.UpdateOptions) (err error)

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_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL