Documentation ¶
Overview ¶
* Tencent is pleased to support the open source community by making 蓝鲸 available. * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * http://opensource.org/licenses/MIT * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func AddCommonFlags(cmdline *pflag.FlagSet) *bool
- func ArrayUnique(a interface{}) (ret []interface{})
- func CalSliceDiff(oldslice, newslice []string) (subs, plugs []string)
- func CalSliceInt64Diff(oldslice, newslice []int64) (subs, inter, plugs []int64)
- func CheckLen(sInput string, min, max int) bool
- func Contains(set []string, substr string) bool
- func ContainsInt(set []int, sub int) bool
- func ContainsInt64(set []int64, sub int64) bool
- func ConvParamsTime(data interface{}) interface{}
- func FileExists(name string) bool
- func FirstNotEmptyString(strs ...string) string
- func GetActionLanguage(req *restful.Request) string
- func GetActionLanguageByHTTPHeader(header http.Header) string
- func GetActionOnwerID(req *restful.Request) string
- func GetActionOnwerIDAndUser(req *restful.Request) (string, string)
- func GetActionOnwerIDByHTTPHeader(header http.Header) string
- func GetActionUser(req *restful.Request) string
- func GetCurrentTimeStr() string
- func GetDailAddress(URL string) (string, error)
- func GetInt64ByInterface(a interface{}) (int64, error)
- func GetIntByInterface(a interface{}) (int, error)
- func GetMapInterfaceByInerface(data interface{}) ([]interface{}, error)
- func GetObjIDByType(objType string) string
- func GetStrValsFromArrMapInterfaceByKey(arrI []interface{}, key string) []string
- func InArray(obj interface{}, target interface{}) bool
- func InStrArr(arr []string, key string) bool
- func InitFlags()
- func IntArrIntersection(slice1 []int, slice2 []int) []int
- func IntArrayUnique(a []int) (ret []int)
- func IsAssocateProperty(propertyType string) bool
- func IsChar(sInput string) bool
- func IsDate(sInput string) bool
- func IsInnerObject(objID string) bool
- func IsNumChar(sInput string) bool
- func IsStrProperty(propertyType string) bool
- func IsTime(sInput string) bool
- func IsTimeZone(sInput string) bool
- func MapMatch(src, tar interface{}) bool
- func NewMapFromJSON(data string) map[string]interface{}
- func RemoveDuplicatesAndEmpty(slice []string) (ret []string)
- func SliceStrToInt(sliceStr []string) ([]int, error)
- func Str2Time(timeStr string) time.Time
- func StrArrDiff(slice1 []string, slice2 []string) []string
- func StrArrayUnique(a []string) (ret []string)
- func ValidPropertyOption(propertyType string, option interface{}, errProxy errors.DefaultCCErrorIf) error
- func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
- func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
- type MapBuiler
- type ParseInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommonFlags ¶
AddCommonFlags add common flags that is needed by all modules
func ArrayUnique ¶
func ArrayUnique(a interface{}) (ret []interface{})
func CalSliceDiff ¶
func CalSliceInt64Diff ¶
func ContainsInt64 ¶
ContainsInt64 if int64 target in array
func ConvParamsTime ¶
func ConvParamsTime(data interface{}) interface{}
func FileExists ¶
func FirstNotEmptyString ¶
FirstNotEmptyString return the first string in slice strs that is not empty
func GetActionLanguage ¶
GetActionLanguage returns language form hender
func GetActionLanguageByHTTPHeader ¶
GetActionLanguageByHTTPHeader return language from http header
func GetActionOnwerID ¶
GetActionOnwerID returns owner_uin form hender
func GetActionOnwerIDAndUser ¶
GetActionOnwerIDAndUser returns owner_uin and user form hender
func GetActionOnwerIDByHTTPHeader ¶
GetActionOnwerIDByHTTPHeader return owner from http header
func GetActionUser ¶
GetActionLanguage returns user form hender
func GetCurrentTimeStr ¶
func GetCurrentTimeStr() string
func GetDailAddress ¶
GetDailAddress returns the address for net.Dail
func GetInt64ByInterface ¶
func GetIntByInterface ¶
func GetMapInterfaceByInerface ¶
func GetMapInterfaceByInerface(data interface{}) ([]interface{}, error)
func GetObjIDByType ¶
func GetStrValsFromArrMapInterfaceByKey ¶
GetStrValsFromArrMapInterfaceByKey get []string from []map[string]interface{}, Do not consider errors
func IntArrIntersection ¶
func IsAssocateProperty ¶
IsAssocateProperty is Assocate property
func MapMatch ¶
func MapMatch(src, tar interface{}) bool
MapMatch return whether src is partial match to tar, means src is smaller than tar
func NewMapFromJSON ¶
func SliceStrToInt ¶
SliceStrToInt: 将字符串切片转换为整型切片
func StrArrDiff ¶
func StrArrayUnique ¶
StrArrayUnique get unique string array
func ValidPropertyOption ¶
func ValidPropertyOption(propertyType string, option interface{}, errProxy errors.DefaultCCErrorIf) error
ValidPropertyOption valid property field option
func WarnWordSepNormalizeFunc ¶
func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators
func WordSepNormalizeFunc ¶
func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
WordSepNormalizeFunc changes all flags that contain "_" separators
Types ¶
type MapBuiler ¶
type MapBuiler struct {
// contains filtered or unexported fields
}
func NewMapBuilder ¶
func NewMapBuilder(kvpairs ...interface{}) *MapBuiler
type ParseInterface ¶
type ParseInterface struct {
// contains filtered or unexported fields
}
ParseInterface parse interface use struct
func NewParseInterface ¶
func NewParseInterface(data interface{}) *ParseInterface
NewParseInterface return a struct
func (*ParseInterface) ArrayInterface ¶
func (p *ParseInterface) ArrayInterface() ([]interface{}, error)
ArrayInterface return interface val
func (*ParseInterface) Get ¶
func (p *ParseInterface) Get(key string) *ParseInterface
Get get key from interface to ParseInterface
func (*ParseInterface) Interface ¶
func (p *ParseInterface) Interface() (interface{}, error)
Interface return interface val
func (*ParseInterface) String ¶
func (p *ParseInterface) String() (string, error)
String return string val