iris_extend_helper

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 48 Imported by: 2

README

iris-extend-helper

basic utils for iris framework (golang)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessId

func AccessId(id string, key string) string

func AccessKey

func AccessKey() string

func AesDecrypt

func AesDecrypt(text string, key string) (string, bool)

func AesEncrypt

func AesEncrypt(text string, key string) (string, bool)

func AliyunRequestSign

func AliyunRequestSign(request iris.Map) iris.Map

func Base64Decode

func Base64Decode(str string) string

func Base64Encode

func Base64Encode(str string) string

func CheckIPWhitelist

func CheckIPWhitelist(whitelist []string, addr string) bool

func CheckId

func CheckId(s string) bool

func CheckMapFields

func CheckMapFields(object iris.Map, fields []string) ([]string, bool)

func CheckMapKeys

func CheckMapKeys(object iris.Map, keys []string) bool

func CheckMapValue

func CheckMapValue(value interface{}, rule iris.Map) (interface{}, bool)

func CheckRequestParams

func CheckRequestParams(request iris.Map, params []string) ([]string, bool)

func CheckResponseResult

func CheckResponseResult(result []byte) ([]byte, bool)

func Compare

func Compare(a, b interface{}) int

func ConcatRequestParams

func ConcatRequestParams(request iris.Map, params []string) string

func ContainsPrefix

func ContainsPrefix(s string, values []string) bool

func ContainsSuffix

func ContainsSuffix(s string, values []string) bool

func ExportMapValue

func ExportMapValue(value interface{}, rule iris.Map) interface{}

func ExtendMap

func ExtendMap(source iris.Map, target interface{}) iris.Map

func ExtendRecordset

func ExtendRecordset(recordset interface{}, records ...iris.Map) []iris.Map

func ExtractToken

func ExtractToken(req *http.Request, config *toml.Tree) string

func FilterRecordset

func FilterRecordset(recordset []iris.Map, fn func(iris.Map) bool) []iris.Map

func FilterStringArray

func FilterStringArray(array []string, fn func(string) bool) []string

func FilterUint64Array

func FilterUint64Array(array []uint64, fn func(uint64) bool) []uint64

func FormatString

func FormatString(s string, params iris.Map) string

func GetBool

func GetBool(tree *toml.Tree, key string, values ...bool) bool

func GetCSV

func GetCSV(value interface{}) []byte

func GetClaims

func GetClaims(str string) jwt.MapClaims

func GetData

func GetData(request iris.Map) ([]byte, bool)

func GetDuration

func GetDuration(tree *toml.Tree, key string, values ...time.Duration) time.Duration

func GetFloat64

func GetFloat64(tree *toml.Tree, key string, values ...float64) float64

func GetInt

func GetInt(tree *toml.Tree, key string, values ...int) int

func GetInt64

func GetInt64(tree *toml.Tree, key string, values ...int64) int64

func GetJSON

func GetJSON(value interface{}) []byte

func GetMapRule

func GetMapRule(schema iris.Map, field string) (string, iris.Map)

func GetMapValueTypes

func GetMapValueTypes(value interface{}) []string

func GetMimeType

func GetMimeType(rawurl string) string

func GetString

func GetString(tree *toml.Tree, key string, values ...string) string

func GetStringArray

func GetStringArray(tree *toml.Tree, key string, values ...[]string) []string

func GetTree

func GetTree(tree *toml.Tree, key string) *toml.Tree

func GetUint64

func GetUint64(tree *toml.Tree, key string, values ...uint64) uint64

func HS256

func HS256(str string, key string) string

func HS384

func HS384(str string, key string) string

func HS512

func HS512(str string, key string) string

func Hash

func Hash(str string, config *toml.Tree, flag bool) string

func HexDecode

func HexDecode(str string) string

func HexEncode

func HexEncode(str string) string

func Id

func Id() string

func Integrity

func Integrity(value interface{}, config *toml.Tree) string

func Key

func Key(phrase string) string

func MD5

func MD5(str string) string

func MapIntersects

func MapIntersects(source iris.Map, target iris.Map) bool

func MergeStringValues

func MergeStringValues(value interface{}, values ...string) []string

func MergeUint64Values

func MergeUint64Values(value interface{}, values ...uint64) []uint64

func NormalizeId

func NormalizeId(id string) string

func NormalizeMap

func NormalizeMap(value interface{}) iris.Map

func NormalizeName

func NormalizeName(s string) string

func ParseBool

func ParseBool(value interface{}, values ...bool) bool

func ParseErrorSource

func ParseErrorSource(str string) (string, string, bool)

func ParseFloat64

func ParseFloat64(value interface{}, values ...float64) float64

func ParseInt

func ParseInt(value interface{}, values ...int) int

func ParseInt64

func ParseInt64(value interface{}, values ...int64) int64

func ParseMap

func ParseMap(value interface{}) iris.Map

func ParseMegabytes

func ParseMegabytes(value interface{}) int

func ParseMilliseconds

func ParseMilliseconds(value interface{}) float64

func ParseRecordset

func ParseRecordset(value interface{}) []iris.Map

func ParseRows

func ParseRows(rows *sql.Rows, offset int, limit int) ([]iris.Map, int)

func ParseSchedule

func ParseSchedule(expr string) (cron.Schedule, bool)

func ParseString

func ParseString(value interface{}, values ...string) string

func ParseStringArray

func ParseStringArray(value interface{}, values ...[]string) []string

func ParseTime

func ParseTime(value interface{}, values ...time.Time) time.Time

func ParseTimestamp

func ParseTimestamp(value string) (time.Time, bool)

func ParseToken

func ParseToken(str string, key string) (jwt.MapClaims, bool)

func ParseURL

func ParseURL(rawurl string) (*url.URL, bool)

func ParseUint

func ParseUint(value interface{}, values ...uint) uint

func ParseUint64

func ParseUint64(value interface{}, values ...uint64) uint64

func ParseUint64Array

func ParseUint64Array(value interface{}, values ...[]uint64) []uint64

func Plural

func Plural(s string) string

func PostData

func PostData(request iris.Map) ([]byte, bool)

func PrivateKeyDecodeString

func PrivateKeyDecodeString(str string) *rsa.PrivateKey

func PrivateKeyEncodeString

func PrivateKeyEncodeString(key *rsa.PrivateKey) string

func PublicKeyDecodeString

func PublicKeyDecodeString(str string) *rsa.PublicKey

func PublicKeyEncodeString

func PublicKeyEncodeString(key *rsa.PublicKey) string

func RecordsetContains

func RecordsetContains(array []iris.Map, record iris.Map) bool

func RecordsetIndexOf

func RecordsetIndexOf(array []iris.Map, record iris.Map) int

func RegisterErrorHandlers

func RegisterErrorHandlers(app *iris.Application, codes iris.Map)

func RegisterMacros

func RegisterMacros(app *iris.Application)

func RegisterParties

func RegisterParties(app *iris.Application, parties iris.Map)

func RegisterScheduledTasks

func RegisterScheduledTasks(app *iris.Application, jobs []Job)

func RetryGetData

func RetryGetData(request iris.Map, config *toml.Tree) ([]byte, bool)

func RetryPostData

func RetryPostData(request iris.Map, config *toml.Tree) ([]byte, bool)

func RouteResources

func RouteResources(route context.RouteReadOnly, resource string) []string

func RsaDecrypt

func RsaDecrypt(text string, key *rsa.PrivateKey) (string, bool)

func RsaEncrypt

func RsaEncrypt(text string, key *rsa.PublicKey) (string, bool)

func ServeStaticFiles

func ServeStaticFiles(app *iris.Application, path string)

func Sha256

func Sha256(str string) string

func Sha384

func Sha384(str string) string

func Sha512

func Sha512(str string) string

func Sign256

func Sign256(claims jwt.Claims, secret string) string

func Sign384

func Sign384(claims jwt.Claims, secret string) string

func Sign512

func Sign512(claims jwt.MapClaims, secret string) string

func SignClaims

func SignClaims(claims jwt.MapClaims, config *toml.Tree, key ...string) string

func Signature

func Signature(signature string, digest string, config *toml.Tree) string

func StringArrayContains

func StringArrayContains(array []string, value string) bool

func StringArrayIndexOf

func StringArrayIndexOf(array []string, value string) int

func StringifyTime

func StringifyTime(t time.Time) string

func StripKeywords

func StripKeywords(s string, values []string) string

func Timestamp

func Timestamp(milliseconds float64) time.Time

func Token

func Token(header string, signature string) string

func TransformMap

func TransformMap(input iris.Map, transform iris.Map) iris.Map

func TransformRecordset

func TransformRecordset(recordset []iris.Map, transform iris.Map) []iris.Map

func TransformRecordsetArray

func TransformRecordsetArray(inputs [][]iris.Map, transform iris.Map) [][]iris.Map

func Uint64ArrayContains

func Uint64ArrayContains(array []uint64, value uint64) bool

func Uint64ArrayIndexOf

func Uint64ArrayIndexOf(array []uint64, value uint64) int

func WrapError

func WrapError(err error) error

Types

type Job

type Job struct {
	Schedule string
	Task     func()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL