Documentation ¶
Overview ¶
Package uuid provides implementation of Universally Unique Identifier (UUID). Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and version 2 (as specified in DCE 1.1).
Index ¶
- Constants
- Variables
- func Compress(data []byte) []byte
- func CompressFile(srcFile, destFile string) error
- func ConvertFileSize(fsize int64) string
- func ConvertToTree(params *[]orm.Params) []orm.Params
- func CreateModel(name string) interface{}
- func CreateModels(name string) interface{}
- func DeCompress(data []byte) []byte
- func DeCompressFile(srcFile, destFile string) error
- func DeCompressZip(zipFile, dest string) error
- func DeSqlInject(paramVal string) string
- func DeSqlInject2(paramVal string) string
- func DesDecrypt(data, key string) (string, error)
- func DesEncrypt(data, key string) (string, error)
- func Equal(u1 UUID, u2 UUID) bool
- func FileExist(filename string) bool
- func FindStrArray(arr []string, f string) int
- func GBK2UTF8(s []byte) ([]byte, error)
- func GetCurrPath() string
- func GetDeltaFileTmpDir() string
- func GetDocsPathConf() string
- func GetDownloadFileTmpDir() string
- func GetImagesPathConf() string
- func GetModelNames() []string
- func GetParentDirectory(dirctory string) string
- func GetRealPath(basePath, urlPath, name string) string
- func GetRedisConf() (string, string, string, int)
- func GetRegModel(name string) interface{}
- func GetRegModelType(modelName string) reflect.Type
- func GetRegModels() []interface{}
- func GetUserImgUrl(userId string, pictrueId string) string
- func IsModelHasField(modelName string, fieldName string) bool
- func IsNil(d interface{}) bool
- func IsNotBlank(str string) bool
- func Md5Hash(content string) string
- func Md5HashEncrypt(password string, salt string) string
- func NewGuid() string
- func ObjContains(obj interface{}, target interface{}) (bool, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func ReadBytes(reader io.Reader) []byte
- func ReadImage(filePath string) (image.Image, error)
- func ReflectSetEntity(entType reflect.Type, dbentv reflect.Value, entMap map[string]interface{}, ...)
- func ReflectSetValue(entType reflect.Type, entObj reflect.Value, filedName string, v interface{})
- func RegisterModels(models ...interface{})
- func Round2(f float64, n int) float64
- func SaveImage(c *gin.Context, file *multipart.FileHeader, ownerId string) string
- func SendEmail(receivers []string, subject string, body string) bool
- func SetCRUDStruct(h gin.H, err error, op string, entity interface{}, retentity bool)
- func SetPageToken(c *gin.Context, h gin.H)
- func Sha256HashEncrypt(password string, salt string) string
- func StrArrayContains(s []string, e string) (bool, int)
- func StrArrayDelete(ss []string, index int) []string
- func Substr(s string, pos, length int) string
- func ToFsPath(urlPath string) string
- func ToUrlPath(urlPath string) string
- func UTF82GBK(s []byte) ([]byte, error)
- func WriteImage(img image.Image, filePath string) error
- func ZipFile(srcFilePath, destFilePath string) error
- type HttpResult
- type UUID
- func And(u1 UUID, u2 UUID) UUID
- func FromBytes(input []byte) (u UUID, err error)
- func FromString(input string) (u UUID, err error)
- func NewV1() UUID
- func NewV2(domain byte) UUID
- func NewV3(ns UUID, name string) UUID
- func NewV4() UUID
- func NewV5(ns UUID, name string) UUID
- func Or(u1 UUID, u2 UUID) 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) 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.
const ClientType = "clientType"
const ClientTypeMobile = "mobile"
const GDbName string = "default"
const JPushAppKey = "9334d4c6e72e4b8ee562cd10"
const JPushSecret = "02acf03c7fa4a5da8d091673"
const JwtKey = "Dv12NpJfAr5WQ2St93r73UrAw5I2GHfVAy7MRgbqpknBxfB8LUdboIQGVI3KWIGw"
const JwtSecret string = "secret"
const KBatchPostCount = 500
const KDeltaFilesDir string = "deltas"
const KDownloadFilesDir string = "download"
const KSrvDocsDir = "static/upload/docs"
const KSrvImagesDir = "static/upload/images"
const PageCaptchaCode = "__captchaCode"
const PageCaptchaId = "__captchaId"
const PageRespContent = "data"
const PageRespCreate = "isCreate"
const PageRespEdit = "isEdit"
const PageRespInputTag = "inputTag"
const PageRespMsg = "msg"
const PageRespOk = "isOk"
page
const ProjectId string = "projectId"
const ProjectName string = "projectName"
const ReqData = "Data"
ajax
const ReqMobileSecret = "__secret"
const ReqProjectId = "ProjectId"
const ReqRelateModels = "RelateModels"
const ReqUpdateCol = "DataUpdateColumn"
const RespCode = "Code"
const RespContent = "Content"
const RespMsg = "Msg"
const RoleIdStr string = "roleIdStr"
const RongCloudToken string = "rongCloudToken"
const SessionUpdateTag string = "_sut_"
const SuperAdminId = "admin0000"
const TreeRootId = "__root__"
const UserId string = "userId"
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 Nil = UUID{}
The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.
Functions ¶
func CompressFile ¶
func ConvertFileSize ¶
func CreateModel ¶
func CreateModel(name string) interface{}
func DeCompress ¶
func DeCompressFile ¶
func DeCompressZip ¶
func DeSqlInject ¶
func DeSqlInject2 ¶
func DesDecrypt ¶
func DesEncrypt ¶
func FindStrArray ¶
func GetDeltaFileTmpDir ¶
func GetDeltaFileTmpDir() string
func GetDocsPathConf ¶
func GetDocsPathConf() string
func GetDownloadFileTmpDir ¶
func GetDownloadFileTmpDir() string
func GetImagesPathConf ¶
func GetImagesPathConf() string
func GetModelNames ¶
func GetModelNames() []string
func GetParentDirectory ¶
func GetRealPath ¶
func GetRegModel ¶
func GetRegModel(name string) interface{}
func GetRegModelType ¶
func GetRegModels ¶
func GetRegModels() []interface{}
func GetUserImgUrl ¶
func IsModelHasField ¶
func IsNotBlank ¶
func Md5HashEncrypt ¶
func ObjContains ¶
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func ReflectSetEntity ¶
func ReflectSetValue ¶
func RegisterModels ¶
func RegisterModels(models ...interface{})
func SetCRUDStruct ¶
func Sha256HashEncrypt ¶
func StrArrayDelete ¶
Types ¶
type HttpResult ¶
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 FromString ¶
FromString returns UUID parsed from string input. Input is expected in a form accepted by UnmarshalText.
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"