model

package
v0.0.0-...-bac99df Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 10 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")
)

Functions

func NewObjectID

func NewObjectID() string

func Put_Test

func Put_Test(i interface{})

func Put_User

func Put_User(i interface{})

Types

type Int32ToTestMap

type Int32ToTestMap map[int32]*Test

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

func (m *Int32ToTestMap) Get(key int32) (value *Test, ok bool)

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

type Int64ToTestMap map[int64]*Test

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

func (m *Int64ToTestMap) Get(key int64) (value *Test, ok bool)

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

func (sc *SimpleClient) NextSeq(id string) (int, 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 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) FromMsg

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

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

type TestSlice []*Test

func NewTestSlice

func NewTestSlice() *TestSlice

func ToTestSlice

func ToTestSlice(s []*Test) *TestSlice

func (*TestSlice) Add

func (s *TestSlice) Add() *Test

func (*TestSlice) AddOne

func (s *TestSlice) AddOne(newOne *Test) *Test

func (*TestSlice) Clear

func (s *TestSlice) Clear()

func (TestSlice) Clone

func (s TestSlice) Clone() (n *TestSlice)

func (TestSlice) Each

func (s TestSlice) Each(fn func(index int, element *Test) (continued bool))

func (*TestSlice) RemoveOne

func (s *TestSlice) RemoveOne(fn func(index int, element *Test) (removed bool))

func (*TestSlice) RemoveSome

func (s *TestSlice) RemoveSome(fn func(index int, element *Test) (removed bool))

func (TestSlice) Size

func (s TestSlice) Size() int

func (TestSlice) ToMsg

func (s TestSlice) ToMsg(n []*msg.Test) []*msg.Test

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

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

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

func (m *User) GetTests() []*Test

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

func (*User) ProtoMessage()

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

func (m *User) Unmarshal(dAtA []byte) 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