Documentation ¶
Index ¶
- Constants
- func FNV32(s string) uint32
- func FilterSimpleArgs(args []interface{}) (simpleArgs []interface{})
- func IsPaperTrade() bool
- func LogErr(err error, msgAndArgs ...interface{}) bool
- func MaskKey(key string) string
- func NewValidLimiter(r rate.Limit, b int) (*rate.Limiter, error)
- func ParseRateLimitSyntax(desc string) (*rate.Limiter, error)
- func ReadJsonFile(file string, obj interface{}) error
- func SafeMkdirAll(p string) error
- func ShouldDelay(l *rate.Limiter, minInterval time.Duration) time.Duration
- func StringSliceContains(slice []string, needle string) bool
- func StringSplitByLength(s string, length int) (result []string)
- func TryLock(lock *sync.RWMutex) bool
- func TryRLock(lock *sync.RWMutex) bool
- func UnixMilli() int64
- func WriteJsonFile(p string, obj interface{}) error
- type Reonce
- type Response
- type VolatileMemory
Constants ¶
View Source
const Pointer = reflect.Pointer
Variables ¶
This section is empty.
Functions ¶
func FilterSimpleArgs ¶ added in v1.33.4
func FilterSimpleArgs(args []interface{}) (simpleArgs []interface{})
FilterSimpleArgs filters out the simple type arguments int, string, bool, and []byte
func IsPaperTrade ¶ added in v1.33.0
func IsPaperTrade() bool
func LogErr ¶ added in v1.59.0
LogErr logs the error with the message and arguments if the error is not nil. It returns true if the error is not nil. Examples: LogErr(err) LogErr(err, "error message") LogErr(err, "error message %s", "with argument")
func ParseRateLimitSyntax ¶ added in v1.60.1
ParseRateLimitSyntax parses the rate limit syntax into the rate.Limiter parameters sample inputs:
2+1/5s (2 initial tokens, 1 token per 5 seconds) 5+3/1m (5 initial tokens, 3 tokens per minute) 3m (3 tokens per minute) 1/3m (1 token per 3 minutes)
func ReadJsonFile ¶ added in v1.51.0
func SafeMkdirAll ¶ added in v1.33.0
func StringSliceContains ¶ added in v1.11.1
func StringSplitByLength ¶ added in v1.42.0
func WriteJsonFile ¶ added in v1.33.0
Types ¶
type Response ¶ added in v1.11.0
Response is wrapper for standard http.Response and provides more methods.
func NewResponse ¶ added in v1.11.0
NewResponse is a wrapper of the http.Response instance, it reads the response body and close the file.
func (*Response) DecodeJSON ¶ added in v1.11.0
type VolatileMemory ¶
type VolatileMemory struct {
// contains filtered or unexported fields
}
func NewDetectorCache ¶
func NewDetectorCache() *VolatileMemory
func (*VolatileMemory) IsObjectFresh ¶
func (i *VolatileMemory) IsObjectFresh(obj interface{}, ttl time.Duration) bool
func (*VolatileMemory) IsTextFresh ¶
func (i *VolatileMemory) IsTextFresh(text string, ttl time.Duration) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.