Documentation
¶
Index ¶
- func MapCopy[K comparable, V any](m map[K]V) map[K]V
- func RemoveByValueSlice[V comparable](slice *SliceWithCounter[V], value V)
- type ConfigLoader
- func (config *ConfigLoader) GetAndHasConfig(key string) (value string, has bool)
- func (config *ConfigLoader) GetBoolConfig(key string, def bool) bool
- func (config *ConfigLoader) GetConfig(key string) (value string)
- func (config *ConfigLoader) GetFloatConfig(key string, def float64) float64
- func (config *ConfigLoader) GetInt32Config(key string, def int32) int32
- func (config *ConfigLoader) GetInt64Config(key string, def int64) int64
- func (config *ConfigLoader) GetIntConfig(key string, def int) int
- func (config *ConfigLoader) GetOrDefault(key string, def string) (value string)
- func (config *ConfigLoader) GetStringSliceCommaConfig(key string, def string) []string
- func (config *ConfigLoader) GetStringSliceConfig(key string, def string) []string
- func (config *ConfigLoader) HasConfig(key string) (has bool)
- func (config *ConfigLoader) InitEmptyConfig()
- func (config *ConfigLoader) LoadConfigs(folder string)
- func (config *ConfigLoader) ReplaceConfig(key string, value string)
- type SliceWithCounter
- func (slice *SliceWithCounter[T]) AddToEnd(value T)
- func (slice *SliceWithCounter[T]) Append(value T)
- func (slice *SliceWithCounter[T]) Cap() int
- func (slice *SliceWithCounter[T]) Clear()
- func (slice *SliceWithCounter[T]) Copy() SliceWithCounter[T]
- func (slice *SliceWithCounter[T]) DeepClear()
- func (slice *SliceWithCounter[T]) Get(index int) T
- func (slice *SliceWithCounter[T]) IsEmpty() bool
- func (slice *SliceWithCounter[T]) Remove(index int)
- func (slice *SliceWithCounter[T]) RemoveAndGet(index int) (removed T)
- func (slice *SliceWithCounter[T]) RemoveLast()
- func (slice *SliceWithCounter[T]) Set(index int, value T)
- func (slice *SliceWithCounter[T]) ToSlice() []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapCopy ¶
func MapCopy[K comparable, V any](m map[K]V) map[K]V
func RemoveByValueSlice ¶
func RemoveByValueSlice[V comparable](slice *SliceWithCounter[V], value V)
Sadly can't define a generic function whose type is more restrictive directly on the struct... so have to do like this.
Types ¶
type ConfigLoader ¶
type ConfigLoader struct {
// contains filtered or unexported fields
}
var (
)func (*ConfigLoader) GetAndHasConfig ¶
func (config *ConfigLoader) GetAndHasConfig(key string) (value string, has bool)
func (*ConfigLoader) GetBoolConfig ¶
func (config *ConfigLoader) GetBoolConfig(key string, def bool) bool
func (*ConfigLoader) GetConfig ¶
func (config *ConfigLoader) GetConfig(key string) (value string)
func (*ConfigLoader) GetFloatConfig ¶
func (config *ConfigLoader) GetFloatConfig(key string, def float64) float64
func (*ConfigLoader) GetInt32Config ¶
func (config *ConfigLoader) GetInt32Config(key string, def int32) int32
func (*ConfigLoader) GetInt64Config ¶
func (config *ConfigLoader) GetInt64Config(key string, def int64) int64
func (*ConfigLoader) GetIntConfig ¶
func (config *ConfigLoader) GetIntConfig(key string, def int) int
func (*ConfigLoader) GetOrDefault ¶
func (config *ConfigLoader) GetOrDefault(key string, def string) (value string)
func (*ConfigLoader) GetStringSliceCommaConfig ¶
func (config *ConfigLoader) GetStringSliceCommaConfig(key string, def string) []string
Splits by comma instead of space.
func (*ConfigLoader) GetStringSliceConfig ¶
func (config *ConfigLoader) GetStringSliceConfig(key string, def string) []string
Uses a whitespace to slice the string into different substrings
func (*ConfigLoader) HasConfig ¶
func (config *ConfigLoader) HasConfig(key string) (has bool)
func (*ConfigLoader) InitEmptyConfig ¶
func (config *ConfigLoader) InitEmptyConfig()
func (*ConfigLoader) LoadConfigs ¶
func (config *ConfigLoader) LoadConfigs(folder string)
func (*ConfigLoader) ReplaceConfig ¶
func (config *ConfigLoader) ReplaceConfig(key string, value string)
type SliceWithCounter ¶
func NewSliceWithCounter ¶
func NewSliceWithCounter[T any](size int) SliceWithCounter[T]
func (*SliceWithCounter[T]) AddToEnd ¶
func (slice *SliceWithCounter[T]) AddToEnd(value T)
func (*SliceWithCounter[T]) Append ¶
func (slice *SliceWithCounter[T]) Append(value T)
func (*SliceWithCounter[T]) Cap ¶
func (slice *SliceWithCounter[T]) Cap() int
func (*SliceWithCounter[T]) Clear ¶
func (slice *SliceWithCounter[T]) Clear()
func (*SliceWithCounter[T]) Copy ¶
func (slice *SliceWithCounter[T]) Copy() SliceWithCounter[T]
func (*SliceWithCounter[T]) DeepClear ¶
func (slice *SliceWithCounter[T]) DeepClear()
func (*SliceWithCounter[T]) Get ¶
func (slice *SliceWithCounter[T]) Get(index int) T
func (*SliceWithCounter[T]) IsEmpty ¶
func (slice *SliceWithCounter[T]) IsEmpty() bool
func (*SliceWithCounter[T]) Remove ¶
func (slice *SliceWithCounter[T]) Remove(index int)
Shifts elements to the left
func (*SliceWithCounter[T]) RemoveAndGet ¶
func (slice *SliceWithCounter[T]) RemoveAndGet(index int) (removed T)
func (*SliceWithCounter[T]) RemoveLast ¶
func (slice *SliceWithCounter[T]) RemoveLast()
func (*SliceWithCounter[T]) Set ¶
func (slice *SliceWithCounter[T]) Set(index int, value T)
func (*SliceWithCounter[T]) ToSlice ¶
func (slice *SliceWithCounter[T]) ToSlice() []T
Click to show internal directories.
Click to hide internal directories.