Documentation
¶
Index ¶
- Constants
- Variables
- func BeginningOfDay() time.Time
- func BeginningOfHour() time.Time
- func BeginningOfMinute() time.Time
- func BeginningOfMonth() time.Time
- func BeginningOfQuarter() time.Time
- func BeginningOfWeek() time.Time
- func BeginningOfYear() time.Time
- func Between(time1, time2 string) bool
- func CheckMobilePhoneValid(phone string) bool
- func CheckPriceFormat(fee string) error
- func ConvertFTOY(fen string) (yuan string, err error)
- func ConvertGBK2UTF(gbk string) (utf string)
- func ConvertUTF2GBK(utf string) (gbk string)
- func ConvertYTOF(yuan string) (fen string, err error)
- func EndOfDay() time.Time
- func EndOfHour() time.Time
- func EndOfMinute() time.Time
- func EndOfMonth() time.Time
- func EndOfQuarter() time.Time
- func EndOfSunday() time.Time
- func EndOfWeek() time.Time
- func EndOfYear() time.Time
- func Equal(u1 UUID, u2 UUID) bool
- func GeoCodes(address string) (string, error)
- func GetLocalIp() string
- func HMAC_SHA1(data, KEY string) string
- func IsEmail(str ...string) bool
- func IsStructPtr(t reflect.Type) bool
- func JsonToMap(a interface{}) map[string]interface{}
- func MD5(data string) string
- func Monday() time.Time
- func MustParse(strs ...string) time.Time
- func Parse(strs ...string) (time.Time, error)
- func ParseFormToJsonBean(form url.Values, obj interface{}) error
- func RandomAlphaOrNumeric(count uint, letters, numbers bool) string
- func RandomAlphabetic(count uint) string
- func RandomAlphanumeric(count uint) string
- func RandomAscii(count uint) string
- func RandomNumeric(count uint) string
- func RandomSpec0(count uint, start, end int, letters, numbers bool, chars []rune, ...) string
- func RandomSpec1(count uint, start, end int, letters, numbers bool) string
- func RandomString(count uint) string
- func RandomStringSpec0(count uint, set []rune) string
- func RandomStringSpec1(count uint, set string) string
- func SHA1(data string) string
- func Sunday() time.Time
- type Now
- func (now *Now) BeginningOfDay() time.Time
- func (now *Now) BeginningOfHour() time.Time
- func (now *Now) BeginningOfMinute() time.Time
- func (now *Now) BeginningOfMonth() time.Time
- func (now *Now) BeginningOfQuarter() time.Time
- func (now *Now) BeginningOfWeek() time.Time
- func (now *Now) BeginningOfYear() time.Time
- func (now *Now) Between(time1, time2 string) bool
- func (now *Now) EndOfDay() time.Time
- func (now *Now) EndOfHour() time.Time
- func (now *Now) EndOfMinute() time.Time
- func (now *Now) EndOfMonth() time.Time
- func (now *Now) EndOfQuarter() time.Time
- func (now *Now) EndOfSunday() time.Time
- func (now *Now) EndOfWeek() time.Time
- func (now *Now) EndOfYear() time.Time
- func (now *Now) Monday() time.Time
- func (now *Now) MustParse(strs ...string) (t time.Time)
- func (now *Now) Parse(strs ...string) (t time.Time, err error)
- func (now *Now) Sunday() time.Time
- type NullUUID
- type UUID
- func And(u1 UUID, u2 UUID) UUID
- func FromBytes(input []byte) (u UUID, err error)
- func FromBytesOrNil(input []byte) UUID
- func FromString(input string) (u UUID, err error)
- func FromStringOrNil(input string) UUID
- func Or(u1 UUID, u2 UUID) UUID
- func UUID_NewV1() UUID
- func UUID_NewV2(domain byte) UUID
- func UUID_NewV3(ns UUID, name string) UUID
- func UUID_NewV4() UUID
- func UUID_NewV5(ns UUID, name string) UUID
- func (u UUID) Bytes() []byte
- func (u UUID) MarshalBinary() (data []byte, err error)
- func (u UUID) MarshalText() (text []byte, err error)
- func (u *UUID) Scan(src interface{}) error
- func (u *UUID) SetVariant()
- func (u *UUID) SetVersion(v byte)
- func (u UUID) String() string
- func (u *UUID) UnmarshalBinary(data []byte) (err error)
- func (u *UUID) UnmarshalText(text []byte) (err error)
- func (u UUID) Value() (driver.Value, error)
- func (u UUID) Variant() uint
- func (u UUID) Version() uint
Constants ¶
const ( VariantNCS = iota VariantRFC4122 VariantMicrosoft VariantFuture )
UUID layout variants.
const ( DomainPerson = iota DomainGroup DomainOrg )
UUID DCE domains.
Variables ¶
var (
NamespaceDNS, _ = FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
NamespaceURL, _ = FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8")
NamespaceOID, _ = FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8")
NamespaceX500, _ = FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")
)
Predefined namespace UUIDs.
var FirstDayMonday bool
var Nil = UUID{}
The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.
var TimeFormats = []string{"1/2/2006", "1/2/2006 15:4:5", "2006-1-2 15:4:5", "2006-1-2 15:4", "2006-1-2", "1-2", "15:4:5", "15:4", "15", "15:4:5 Jan 2, 2006 MST", "2006-01-02 15:04:05.999999999 -0700 MST"}
Functions ¶
func BeginningOfDay ¶
func BeginningOfHour ¶
func BeginningOfMinute ¶
func BeginningOfMonth ¶
func BeginningOfQuarter ¶
func BeginningOfWeek ¶
func BeginningOfYear ¶
func CheckPriceFormat ¶
func ConvertFTOY ¶
func ConvertYTOF ¶
func EndOfMinute ¶
func EndOfMonth ¶
func EndOfQuarter ¶
func EndOfSunday ¶
func GetLocalIp ¶
func GetLocalIp() string
func RandomAlphaOrNumeric ¶
Creates a random string whose length is the number of characters specified.
Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments.
Param count - the length of random string to create Param letters - if true, generated string will include
alphabetic characters
Param numbers - if true, generated string will include
numeric characters
func RandomAlphabetic ¶
Creates a random string whose length is the number of characters specified. Characters will be chosen from the set of alphabetic characters.
func RandomAlphanumeric ¶
Creates a random string whose length is the number of characters specified. Characters will be chosen from the set of alpha-numeric characters.
func RandomAscii ¶
Creates a random string whose length is the number of characters specified.
Characters will be chosen from the set of characters whose ASCII value is between 32 and 126 (inclusive).
func RandomNumeric ¶
Creates a random string whose length is the number of characters specified. Characters will be chosen from the set of numeric characters.
func RandomSpec0 ¶
func RandomSpec0(count uint, start, end int, letters, numbers bool, chars []rune, rand *rand.Rand) string
Creates a random string based on a variety of options, using supplied source of randomness.
If start and end are both 0, start and end are set to ' ' and 'z', the ASCII printable characters, will be used, unless letters and numbers are both false, in which case, start and end are set to 0 and math.MaxInt32.
If set is not nil, characters between start and end are chosen.
This method accepts a user-supplied rand.Rand instance to use as a source of randomness. By seeding a single rand.Rand instance with a fixed seed and using it for each call, the same random sequence of strings can be generated repeatedly and predictably.
func RandomSpec1 ¶
Creates a random string whose length is the number of characters specified.
Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments.
Param count - the length of random string to create Param start - the position in set of chars to start at Param end - the position in set of chars to end before Param letters - if true, generated string will include
alphabetic characters
Param numbers - if true, generated string will include
numeric characters
func RandomString ¶
func RandomStringSpec0 ¶
func RandomStringSpec1 ¶
Types ¶
type Now ¶
func (*Now) BeginningOfDay ¶
func (*Now) BeginningOfHour ¶
func (*Now) BeginningOfMinute ¶
func (*Now) BeginningOfMonth ¶
func (*Now) BeginningOfQuarter ¶
func (*Now) BeginningOfWeek ¶
func (*Now) BeginningOfYear ¶
func (*Now) EndOfMinute ¶
func (*Now) EndOfMonth ¶
func (*Now) EndOfQuarter ¶
func (*Now) EndOfSunday ¶
type NullUUID ¶
NullUUID can be used with the standard sql package to represent a UUID value that can be NULL in the database
type UUID ¶
type UUID [16]byte
UUID representation compliant with specification described in RFC 4122.
func FromBytes ¶
FromBytes returns UUID converted from raw byte slice input. It will return error if the slice isn't 16 bytes long.
func FromBytesOrNil ¶
FromBytesOrNil returns UUID converted from raw byte slice input. Same behavior as FromBytes, but returns a Nil UUID on error.
func FromString ¶
FromString returns UUID parsed from string input. Input is expected in a form accepted by UnmarshalText.
func FromStringOrNil ¶
FromStringOrNil returns UUID parsed from string input. Same behavior as FromString, but returns a Nil UUID on error.
func UUID_NewV1 ¶
func UUID_NewV1() UUID
NewV1 returns UUID based on current timestamp and MAC address.
func UUID_NewV2 ¶
NewV2 returns DCE Security UUID based on POSIX UID/GID.
func UUID_NewV3 ¶
NewV3 returns UUID based on MD5 hash of namespace UUID and name.
func UUID_NewV5 ¶
NewV5 returns UUID based on SHA-1 hash of namespace UUID and name.
func (UUID) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (UUID) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface. The encoding is the same as returned by String.
func (*UUID) Scan ¶
Scan implements the sql.Scanner interface. A 16-byte slice is handled by UnmarshalBinary, while a longer byte slice or a string is handled by UnmarshalText.
func (*UUID) SetVariant ¶
func (u *UUID) SetVariant()
SetVariant sets variant bits as described in RFC 4122.
func (UUID) String ¶
Returns canonical string representation of UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
func (*UUID) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. It will return error if the slice isn't 16 bytes long.
func (*UUID) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface. Following formats are supported: "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8"
Directories
¶
Path | Synopsis |
---|---|
code.google.com
|
|
p/mahonia
This package is a character-set conversion library for Go.
|
This package is a character-set conversion library for Go. |
Package httplib is used as http.Client Usage: import "github.com/astaxie/beego/httplib" b := httplib.Post("http://beego.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "httplib.txt") str, err := b.String() if err != nil { t.Fatal(err) } fmt.Println(str) more docs http://beego.me/docs/module/httplib.md
|
Package httplib is used as http.Client Usage: import "github.com/astaxie/beego/httplib" b := httplib.Post("http://beego.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "httplib.txt") str, err := b.String() if err != nil { t.Fatal(err) } fmt.Println(str) more docs http://beego.me/docs/module/httplib.md |