Documentation
¶
Index ¶
- func DeleteAllSpace(str string) string
- func GetGuid() string
- func RandInt(n int) int
- func RandStringRunes(n int, t StringType) string
- func ReverseString(s string) string
- func StrToSlice(str string, split string) (result []string)
- type BuilderEx
- func (b *BuilderEx) Cap() int
- func (b *BuilderEx) Clear()
- func (b *BuilderEx) Grow(n int)
- func (b *BuilderEx) Len() int
- func (b *BuilderEx) Reset()
- func (b *BuilderEx) String() string
- func (b *BuilderEx) Write(p []byte) (int, error)
- func (b *BuilderEx) WriteByte(c byte) error
- func (b *BuilderEx) WriteRune(r rune) (int, error)
- func (b *BuilderEx) WriteString(s string) (int, error)
- type ObjectId
- type StringType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandStringRunes ¶
func RandStringRunes(n int, t StringType) string
func StrToSlice ¶
StrToSlice 将字符串按指定字符串打散成字符串切片
Types ¶
type BuilderEx ¶
type BuilderEx struct {
// contains filtered or unexported fields
}
A BuilderEx is used to efficiently build a string using Write methods. It minimizes memory copying. The zero value is ready to use. Do not copy a non-zero BuilderEx.
func (*BuilderEx) Cap ¶
Cap returns the capacity of the builder's underlying byte slice. It is the total space allocated for the string being built and includes any bytes already written.
func (*BuilderEx) Grow ¶
Grow grows b's capacity, if necessary, to guarantee space for another n bytes. After Grow(n), at least n bytes can be written to b without another allocation. If n is negative, Grow panics.
func (*BuilderEx) Write ¶
Write appends the contents of p to b's buffer. Write always returns len(p), nil.
func (*BuilderEx) WriteByte ¶
WriteByte appends the byte c to b's buffer. The returned error is always nil.
type ObjectId ¶
type ObjectId string
ObjectId is a unique ID identifying a BSON value. It must be exactly 12 bytes long. MongoDB objects by default have such a property set in their "_id" property.
http://www.mongodb.org/display/DOCS/Object+IDs
func NewObjectId ¶
func NewObjectId() ObjectId
NewObjectId returns a new unique ObjectId. 4byte 时间, 3byte 机器ID 2byte pid 3byte 自增ID