Categorygithub.com/KyberNetwork/kutils
modulepackage
0.3.8
Repository: https://github.com/kybernetwork/kutils.git
Documentation: pkg.go.dev

# README

Why

Reusable Kyber utilities

What

  • ctx.go: Context that ignores being cancelled
  • http.go: Resty HTTP client with easy configs
  • map.go: Collects values from a slice
  • num.go: Conversions, Min, Max, Abs
  • slice.go: Checks for existence, maps with fn, gets unique elements, filters
  • string.go: String utils

# Packages

No description provided by the author
No description provided by the author
Package mocks is a generated GoMock package.
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DecodeConfig unmarshalls the raw config value bytes into the specified destination with custom logic hooks.
FilterInPlace filters a slice in-place, i.e.
No description provided by the author
JSONMarshal allows choosing the JSON marshalling implementation with build tag with the same logic as used by gin.
JSONUnmarshal allows choosing the JSON unmarshalling implementation with build tag with the same logic as used by gin.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SplitListElem split each element in a string list with the given separator.
StringToTimeDurationHookFunc converts string to time.Duration.
StringUnmarshalHookFunc converts string values using json.Unmarshaler or encoding.TextUnmarshaler if the destination type implements it.
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author

# Variables

ConfigDecodeHook converts string to time.Duration and string to string slice like viper does.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

ChanBatcher implements Batcher using golang channel.
ChanTask uses a done channel to signal resolution of return value and error.
No description provided by the author
HttpCfg is the resty http client configs.

# Interfaces

BatchableTask represents a batchable task.
Batcher batches together n BatchableTask's together and executes a logic for a batch of BatchableTask's.

# Type aliases

BatchCfg provides batchRate and batchCnt configs for a ChanBatcher.
BatchFn is called for a batch of tasks collected and triggered by a ChanBatcher per its batchCfg.