Documentation ¶
Index ¶
- Constants
- Variables
- func AlignNextTime(base time.Time, interval time.Duration, offset time.Duration) time.Time
- func Base64Decode(enc *base64.Encoding, data []byte) ([]byte, error)
- func Base64Encode(enc *base64.Encoding, data []byte) []byte
- func DayOf(t time.Time) time.Time
- func DereferenceReflectPointer(ptr reflect.Value) (result reflect.Value, ok bool)
- func DereferenceReflectPointerWithError(ptr reflect.Value) (result reflect.Value, err error)
- func GenerateRsaKey(bits int) (publicKey, privateKey []byte, err error)
- func GetYear2050() time.Time
- func GetYear3000() time.Time
- func GetYear5000() time.Time
- func HashData(hash crypto.Hash, datas ...[]byte) ([]byte, error)
- func HashDataSilently(hash crypto.Hash, datas ...[]byte) []byte
- func IteratorDataToTypelessSliceByReflect(data any) ([]any, error)
- func IteratorDataToTypelessSliceByReflectValue(data reflect.Value) ([]any, error)
- func MapKeyValuePairPtrsByReflect(m any) (stl.KeyValuePairPtrs[any, any], error)
- func MapKeyValuePairPtrsByReflectValue(m reflect.Value) stl.KeyValuePairPtrs[any, any]
- func MapKeyValuePairsByReflect(m any) (stl.KeyValuePairs[any, any], error)
- func MapKeyValuePairsByReflectValue(m reflect.Value) stl.KeyValuePairs[any, any]
- func MapListByReflect[T any](datas any, mapper func(data any) T) ([]T, error)
- func MapListByReflectValue[T any](datas reflect.Value, mapper func(data any) T) []T
- func MapListToAnysByReflect(datas any) ([]any, error)
- func MapListToAnysByReflectValue(datas reflect.Value) []any
- func MapMapWithReflect[T any](m any, mapper func(stl.KeyValuePair[any, any]) T) ([]T, error)
- func MapMapWithReflectValue[T any](m reflect.Value, mapper func(stl.KeyValuePair[any, any]) T) []T
- func MaxTime(times ...time.Time) time.Time
- func MinTime(times ...time.Time) time.Time
- func NewHash(hash crypto.Hash) (hash.Hash, error)
- func NewTimes(times ...time.Time) []time.Time
- func ParseJsonRawMessage[Data any](message JsonRawMessage) (data Data, err error)
- func ParseJsonRawMessageAsPointer[Ptr *Data, Data any](message JsonRawMessage) (Ptr, error)
- func ParseNetloc(loc string, defaultAddr string, defaultPort int) (addr string, port int, err error)
- func Pkcs5Padding(data []byte, blockSize int) []byte
- func Pkcs5Unpadding(data []byte) []byte
- func SortTimes(times ...time.Time) []time.Time
- func Today() time.Time
- func Tomorrow() time.Time
- func WrapTimeFields(data any, wrapper func(time.Time) time.Time) error
- func WrapTimeFieldsByReflectValue(value reflect.Value, wrapper func(time.Time) time.Time) error
- func Yesterday() time.Time
- type AesCipher
- type BadTypeError
- func (e BadTypeError) Error() string
- func (err BadTypeError) WithExpected(expected string) BadTypeError
- func (err BadTypeError) WithExpectedReflectType(expected reflect.Type) BadTypeError
- func (err BadTypeError) WithGiven(given string) BadTypeError
- func (err BadTypeError) WithGivenReflectType(given reflect.Type) BadTypeError
- type CookieNotFoundError
- type EnvironmentVariableNotFoundError
- type Errors
- type GenericNotFoundError
- type IntraDayTime
- type JsonAny
- type JsonArray
- type JsonMap
- type JsonObject
- type JsonRawMessage
- type JsonRawMessageMap
- type ListIteratorByReflect
- type MapIteratorByReflect
- type NilError
- type NotImplementedError
- type PrivateKeyCipher
- func (c *PrivateKeyCipher) Decrypt(ciphertext []byte) ([]byte, error)
- func (c *PrivateKeyCipher) DecryptPro(ciphertext []byte, decrypter RsaDecrypter, random io.Reader) ([]byte, error)
- func (c *PrivateKeyCipher) Sign(data []byte) ([]byte, error)
- func (c *PrivateKeyCipher) SignPro(data []byte, signer RsaSigner, random io.Reader, hash crypto.Hash) ([]byte, error)
- type PublicKeyCipher
- func (c *PublicKeyCipher) Encrypt(plaintext []byte) ([]byte, error)
- func (c *PublicKeyCipher) EncryptPro(plaintext []byte, encrypter RsaEncrypter, random io.Reader) ([]byte, error)
- func (c *PublicKeyCipher) Verify(data, sign []byte) error
- func (c *PublicKeyCipher) VerifyPro(data, sign []byte, verifier RsaVerifier, hash crypto.Hash) error
- type RsaDecrypter
- type RsaEncrypter
- type RsaSigner
- type RsaVerifier
Constants ¶
View Source
const ( DurationDay = time.Hour * 24 DurationMonth = DurationDay * 30 MaxDurationMonth = DurationDay * 31 DurationYear = DurationDay * 365 MaxDurationYear = DurationDay * 366 )
Variables ¶
View Source
var ReflectTimeType = stl.ReflectType[time.Time]()
Functions ¶
func AlignNextTime ¶ added in v1.0.8
func Base64Decode ¶ added in v1.0.6
func DereferenceReflectPointer ¶ added in v1.0.35
func DereferenceReflectPointerWithError ¶ added in v1.0.35
func GenerateRsaKey ¶ added in v1.0.6
func GetYear2050 ¶ added in v1.0.58
func GetYear3000 ¶ added in v1.0.58
func GetYear5000 ¶ added in v1.0.58
func HashDataSilently ¶ added in v1.0.6
func IteratorDataToTypelessSliceByReflect ¶ added in v1.0.35
func IteratorDataToTypelessSliceByReflectValue ¶ added in v1.0.35
func MapKeyValuePairPtrsByReflect ¶ added in v1.0.35
func MapKeyValuePairPtrsByReflectValue ¶ added in v1.0.35
func MapKeyValuePairsByReflect ¶ added in v1.0.35
func MapKeyValuePairsByReflectValue ¶ added in v1.0.35
func MapListByReflect ¶ added in v1.0.35
func MapListByReflectValue ¶ added in v1.0.35
func MapListToAnysByReflect ¶ added in v1.0.35
func MapListToAnysByReflectValue ¶ added in v1.0.35
func MapMapWithReflect ¶ added in v1.0.35
func MapMapWithReflectValue ¶ added in v1.0.35
func ParseJsonRawMessage ¶ added in v1.0.24
func ParseJsonRawMessage[Data any](message JsonRawMessage) (data Data, err error)
func ParseJsonRawMessageAsPointer ¶ added in v1.0.24
func ParseJsonRawMessageAsPointer[Ptr *Data, Data any](message JsonRawMessage) (Ptr, error)
func ParseNetloc ¶ added in v1.0.11
func Pkcs5Padding ¶ added in v1.0.6
func Pkcs5Unpadding ¶ added in v1.0.6
func WrapTimeFields ¶ added in v1.0.48
func WrapTimeFieldsByReflectValue ¶ added in v1.0.48
Types ¶
type AesCipher ¶ added in v1.0.6
type AesCipher struct {
// contains filtered or unexported fields
}
type BadTypeError ¶ added in v1.0.35
type BadTypeError struct {
// contains filtered or unexported fields
}
func NewBadTypeError ¶ added in v1.0.35
func NewBadTypeError(expected, given string) BadTypeError
func NewBadTypeErrorWithGivenReflectType ¶ added in v1.0.35
func NewBadTypeErrorWithGivenReflectType(expected, given reflect.Type) BadTypeError
func NewBlankBadTypeError ¶ added in v1.0.35
func NewBlankBadTypeError() BadTypeError
func (BadTypeError) Error ¶ added in v1.0.35
func (e BadTypeError) Error() string
func (BadTypeError) WithExpected ¶ added in v1.0.35
func (err BadTypeError) WithExpected(expected string) BadTypeError
func (BadTypeError) WithExpectedReflectType ¶ added in v1.0.35
func (err BadTypeError) WithExpectedReflectType(expected reflect.Type) BadTypeError
func (BadTypeError) WithGiven ¶ added in v1.0.35
func (err BadTypeError) WithGiven(given string) BadTypeError
func (BadTypeError) WithGivenReflectType ¶ added in v1.0.35
func (err BadTypeError) WithGivenReflectType(given reflect.Type) BadTypeError
type CookieNotFoundError ¶
type CookieNotFoundError struct {
// contains filtered or unexported fields
}
func NewCookieNotFoundError ¶
func NewCookieNotFoundError(name string) CookieNotFoundError
func (CookieNotFoundError) Error ¶
func (e CookieNotFoundError) Error() string
func (CookieNotFoundError) Name ¶
func (e CookieNotFoundError) Name() string
type EnvironmentVariableNotFoundError ¶
type EnvironmentVariableNotFoundError struct {
// contains filtered or unexported fields
}
func NewEnvironmentVariableNotFoundError ¶
func NewEnvironmentVariableNotFoundError(name string) EnvironmentVariableNotFoundError
func (EnvironmentVariableNotFoundError) Error ¶
func (e EnvironmentVariableNotFoundError) Error() string
func (EnvironmentVariableNotFoundError) Name ¶
func (e EnvironmentVariableNotFoundError) Name() string
type GenericNotFoundError ¶ added in v1.0.25
type GenericNotFoundError struct {
// contains filtered or unexported fields
}
func NewGenericNotFoundError ¶ added in v1.0.25
func NewGenericNotFoundError(t, name string) GenericNotFoundError
func (GenericNotFoundError) Error ¶ added in v1.0.25
func (e GenericNotFoundError) Error() string
func (GenericNotFoundError) Name ¶ added in v1.0.25
func (e GenericNotFoundError) Name() string
func (GenericNotFoundError) Type ¶ added in v1.0.25
func (e GenericNotFoundError) Type() string
type IntraDayTime ¶ added in v1.0.58
func MustParseFormattedIntraDayTime ¶ added in v1.0.58
func MustParseFormattedIntraDayTime(layout, value string) IntraDayTime
func MustParseIntraDayTime ¶ added in v1.0.58
func MustParseIntraDayTime(s string) IntraDayTime
func ParseFormattedIntraDayTime ¶ added in v1.0.58
func ParseFormattedIntraDayTime(layout, value string) (IntraDayTime, error)
func ParseIntraDayTime ¶ added in v1.0.58
func ParseIntraDayTime(s string) (IntraDayTime, error)
func (IntraDayTime) Duration ¶ added in v1.0.58
func (t IntraDayTime) Duration() time.Duration
func (IntraDayTime) Format ¶ added in v1.0.58
func (t IntraDayTime) Format(layout string) string
func (IntraDayTime) MarshalJSON ¶ added in v1.0.58
func (t IntraDayTime) MarshalJSON() ([]byte, error)
func (IntraDayTime) String ¶ added in v1.0.58
func (t IntraDayTime) String() string
func (*IntraDayTime) UnmarshalJSON ¶ added in v1.0.58
func (t *IntraDayTime) UnmarshalJSON(data []byte) error
type JsonMap ¶ added in v1.0.24
type JsonMap = JsonObject
type JsonObject ¶ added in v1.0.24
type JsonRawMessage ¶ added in v1.0.24
type JsonRawMessage struct {
json.RawMessage
}
func (JsonRawMessage) UnmarshalAsInt ¶ added in v1.0.24
func (message JsonRawMessage) UnmarshalAsInt() (int, error)
func (JsonRawMessage) UnmarshalAsString ¶ added in v1.0.24
func (message JsonRawMessage) UnmarshalAsString() (string, error)
func (JsonRawMessage) UnmarshalTo ¶ added in v1.0.24
func (message JsonRawMessage) UnmarshalTo(dst interface{}) error
type JsonRawMessageMap ¶ added in v1.0.24
type JsonRawMessageMap map[string]JsonRawMessage
func (JsonRawMessageMap) Lookup ¶ added in v1.0.24
func (m JsonRawMessageMap) Lookup(key string) (JsonRawMessage, bool)
type ListIteratorByReflect ¶ added in v1.0.35
type ListIteratorByReflect struct {
// contains filtered or unexported fields
}
func NewSliceIteratorByReflectValue ¶ added in v1.0.35
func NewSliceIteratorByReflectValue(slice reflect.Value) *ListIteratorByReflect
func (*ListIteratorByReflect) Data ¶ added in v1.0.35
func (it *ListIteratorByReflect) Data() any
func (*ListIteratorByReflect) Len ¶ added in v1.0.35
func (it *ListIteratorByReflect) Len() int
func (*ListIteratorByReflect) Next ¶ added in v1.0.35
func (it *ListIteratorByReflect) Next() bool
type MapIteratorByReflect ¶ added in v1.0.35
type MapIteratorByReflect struct {
// contains filtered or unexported fields
}
func NewMapIteratorByReflect ¶ added in v1.0.35
func NewMapIteratorByReflect(m reflect.Value) *MapIteratorByReflect
func (*MapIteratorByReflect) Data ¶ added in v1.0.35
func (it *MapIteratorByReflect) Data() stl.KeyValuePair[any, any]
func (*MapIteratorByReflect) Len ¶ added in v1.0.35
func (it *MapIteratorByReflect) Len() int
func (*MapIteratorByReflect) Next ¶ added in v1.0.35
func (it *MapIteratorByReflect) Next() bool
type NilError ¶ added in v1.0.57
type NilError struct {
// contains filtered or unexported fields
}
func NewNilError ¶ added in v1.0.57
func NewNilErrorFromNames ¶ added in v1.0.57
type NotImplementedError ¶
type NotImplementedError struct {
// contains filtered or unexported fields
}
func NewNotImplementedError ¶
func NewNotImplementedError(hint string) NotImplementedError
func (NotImplementedError) Error ¶
func (e NotImplementedError) Error() string
type PrivateKeyCipher ¶ added in v1.0.6
type PrivateKeyCipher struct { PublicKeyCipher // contains filtered or unexported fields }
func NewPrivateKeyCipher ¶ added in v1.0.6
func NewPrivateKeyCipher(key *rsa.PrivateKey) *PrivateKeyCipher
func (*PrivateKeyCipher) Decrypt ¶ added in v1.0.6
func (c *PrivateKeyCipher) Decrypt(ciphertext []byte) ([]byte, error)
func (*PrivateKeyCipher) DecryptPro ¶ added in v1.0.6
func (c *PrivateKeyCipher) DecryptPro(ciphertext []byte, decrypter RsaDecrypter, random io.Reader) ([]byte, error)
type PublicKeyCipher ¶ added in v1.0.6
type PublicKeyCipher struct {
// contains filtered or unexported fields
}
func NewPublicKeyCipher ¶ added in v1.0.6
func NewPublicKeyCipher(key *rsa.PublicKey) *PublicKeyCipher
func (*PublicKeyCipher) Encrypt ¶ added in v1.0.6
func (c *PublicKeyCipher) Encrypt(plaintext []byte) ([]byte, error)
func (*PublicKeyCipher) EncryptPro ¶ added in v1.0.6
func (c *PublicKeyCipher) EncryptPro(plaintext []byte, encrypter RsaEncrypter, random io.Reader) ([]byte, error)
func (*PublicKeyCipher) Verify ¶ added in v1.0.6
func (c *PublicKeyCipher) Verify(data, sign []byte) error
func (*PublicKeyCipher) VerifyPro ¶ added in v1.0.6
func (c *PublicKeyCipher) VerifyPro(data, sign []byte, verifier RsaVerifier, hash crypto.Hash) error
type RsaDecrypter ¶ added in v1.0.6
type RsaEncrypter ¶ added in v1.0.6
Source Files ¶
Click to show internal directories.
Click to hide internal directories.