Documentation
¶
Index ¶
- func Compare(x, y any, ignores ...any) (bool, error)
- func Diff(x, y any, ignores ...any) (string, error)
- func File(root string) func(string) (any, error)
- func Intersect(x, y any) any
- func Merge(x ...any) (any, error)
- func Omit(x any, keys ...string) (any, error)
- func Pick(x any, keys ...string) (any, error)
- func Time(v any) (time.Time, error)
- func Url(rawURL string) (*url.URL, error)
- type Faker
- func (f *Faker) Bool() bool
- func (f *Faker) Color() string
- func (f *Faker) Date() time.Time
- func (f *Faker) Day() int
- func (f *Faker) Digit() string
- func (f *Faker) DigitN(n int) string
- func (f *Faker) Domain() string
- func (f *Faker) Email() string
- func (f *Faker) Emoji() string
- func (f *Faker) FirstName() string
- func (f *Faker) Float() float64
- func (f *Faker) FloatRange(min, max float64) float64
- func (f *Faker) HTTPMethod() string
- func (f *Faker) HTTPStatusCode() int
- func (f *Faker) HTTPVersion() string
- func (f *Faker) HexColor() string
- func (f *Faker) Hour() int
- func (f *Faker) IPv4() string
- func (f *Faker) IPv6() string
- func (f *Faker) Int() int
- func (f *Faker) IntRange(min int, max int) int
- func (f *Faker) LastName() string
- func (f *Faker) Letter() string
- func (f *Faker) LetterN(n int) string
- func (f *Faker) Lexify(str string) string
- func (f *Faker) Minute() int
- func (f *Faker) Month() int
- func (f *Faker) Name() string
- func (f *Faker) NanoSecond() int
- func (f *Faker) Numerify(str string) string
- func (f *Faker) Password(lower bool, upper bool, numeric bool, special bool, space bool, num int) string
- func (f *Faker) RandomInt(i []int) int
- func (f *Faker) RandomString(a []string) string
- func (f *Faker) Regex(pattern string) (string, error)
- func (f *Faker) Second() int
- func (f *Faker) ULID() (string, error)
- func (f *Faker) URL() string
- func (f *Faker) UUID() string
- func (f *Faker) UUIDv4() string
- func (f *Faker) UUIDv6() string
- func (f *Faker) UUIDv7() string
- func (f *Faker) UserAgent() string
- func (f *Faker) Username() string
- func (f *Faker) Year() int
- type Hash
- type JWTOptions
- type Jwt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Faker ¶
type Faker struct {
// contains filtered or unexported fields
}
func (*Faker) FloatRange ¶
func (*Faker) HTTPMethod ¶
func (*Faker) HTTPStatusCode ¶
func (*Faker) HTTPVersion ¶
func (*Faker) NanoSecond ¶
func (*Faker) RandomString ¶
type Hash ¶ added in v1.3.0
type Hash struct{}
Hash provides methods to compute hash values using various algorithms.
func NewHash ¶ added in v1.3.0
func NewHash() *Hash
NewHash creates a new Hash instance. NewHash is mapped to the built-in function `hash`.
type JWTOptions ¶ added in v0.137.0
type JWTOptions struct {
Secret string `json:"secret"` // Required
Algorithm string `json:"algorithm"` // Optional: HS256, HS384, HS512 (default: HS256)
Subject string `json:"subject"` // Optional: sub claim
Audience []string `json:"audience"` // Optional: aud claim
Issuer string `json:"issuer"` // Optional: iss claim
ID string `json:"id"` // Optional: jti claim
ExpiresIn string `json:"expires_in"` // Optional: duration like "1h", "30m"
NotBefore string `json:"not_before"` // Optional: duration like "5m"
PrivateClaims map[string]any `json:"private_claims"` // Optional: private claims
}
JWTOptions represents options for JWT signing and parsing. It has a structure that allows defining Registered Claim Names, some Public Claim Names, and Private Claim Names. During actual signing and parsing, JSON data for the key names defined in the structure tag is specified.
type Jwt ¶ added in v0.137.0
type Jwt struct {
}
Jwt provides methods to sign and parse JSON Web Tokens (JWT).
Click to show internal directories.
Click to hide internal directories.