Documentation ¶
Index ¶
- Constants
- Variables
- func IndexName(tableName, idxName string) string
- func IndexNoCase(s, sep string) int
- func IsArrayZero(v reflect.Value) bool
- func IsStructZero(v reflect.Value) bool
- func IsSubQuery(tbName string) bool
- func IsTimeZero(t time.Time) bool
- func IsValueZero(v reflect.Value) bool
- func IsZero(k interface{}) bool
- func ReflectValue(bean interface{}) reflect.Value
- func SliceEq(left, right []string) bool
- func SplitNNoCase(s, sep string, n int) []string
- func SplitNoCase(s, sep string) []string
- type ShortUUID
- type StringSet
- func (set *StringSet) Add(i string) bool
- func (set *StringSet) Contains(i string) bool
- func (set *StringSet) Index(c string) int
- func (set *StringSet) ItemByIndex(idx int) string
- func (set *StringSet) Len() int
- func (set *StringSet) Remove(i string)
- func (set *StringSet) Sort()
- func (set *StringSet) String() string
- type UUID
- type Zeroable
Constants ¶
const ( ZeroTime0 = "0000-00-00 00:00:00" ZeroTime1 = "0001-01-01 00:00:00" )
const (
DEFAULT_ALPHABET = "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
)
Variables ¶
var ( // NIL is defined in RFC 4122 section 4.1.7. // The nil UUID is special form of UUID that is specified to have all 128 bits set to zero. NIL = &UUID{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } // NameSpaceDNS assume name to be a fully-qualified domain name. // Declared in RFC 4122 Appendix C. NameSpaceDNS = &UUID{ 0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } // NameSpaceURL assume name to be a URL. // Declared in RFC 4122 Appendix C. NameSpaceURL = &UUID{ 0x6b, 0xa7, 0xb8, 0x11, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } // NameSpaceOID assume name to be an ISO OID. // Declared in RFC 4122 Appendix C. NameSpaceOID = &UUID{ 0x6b, 0xa7, 0xb8, 0x12, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } // NameSpaceX500 assume name to be a X.500 DN (in DER or a text output format). // Declared in RFC 4122 Appendix C. NameSpaceX500 = &UUID{ 0x6b, 0xa7, 0xb8, 0x14, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8, } )
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")
)
Functions ¶
func IndexNoCase ¶
func IsArrayZero ¶
func IsStructZero ¶
func IsSubQuery ¶
func IsTimeZero ¶
func IsValueZero ¶
func ReflectValue ¶
func SplitNNoCase ¶
func SplitNoCase ¶
Types ¶
type ShortUUID ¶
type ShortUUID struct {
// contains filtered or unexported fields
}
func NewShortUUID ¶
func NewShortUUID() *ShortUUID
func (*ShortUUID) Encode ¶
Encodes a UUID into a string (LSB first) according to the alphabet If leftmost (MSB) bits 0, string might be shorter
func (*ShortUUID) SetAlphabet ¶
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
func NewStringSet ¶
func NewStringSet() *StringSet
func (*StringSet) ItemByIndex ¶
type UUID ¶
type UUID [16]byte
The UUID represents Universally Unique IDentifier (which is 128 bit long).
func FromString ¶
FromString returns UUID parsed from string input. Input is expected in a form accepted by UnmarshalText.
func NewNamespaceUUID ¶
NewNamespaceUUID creates a namespace UUID by using the namespace name in the NIL name space. This is a different approach as the 4 "standard" namespace UUIDs which are timebased UUIDs (V1).
func NewV1 ¶
func NewV1() *UUID
NewV1 creates a new UUID with variant 1 as described in RFC 4122. Variant 1 is based on hosts MAC address and actual timestamp (as count of 100-nanosecond intervals since 00:00:00.00, 15 October 1582 (the date of Gregorian reform to the Christian calendar).
func NewV3 ¶
NewV3 creates a new UUID with variant 3 as described in RFC 4122. Variant 3 based namespace-uuid and name and MD-5 hash calculation.
func NewV4 ¶
func NewV4() *UUID
NewV4 creates a new UUID with variant 4 as described in RFC 4122. Variant 4 based on pure random bytes.
func NewV5 ¶
NewV5 creates a new UUID with variant 5 as described in RFC 4122. Variant 5 based namespace-uuid and name and SHA-1 hash calculation.