golibs

module
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2021 License: Unlicense

README

Code Coverage Go Report Card GolangCI Go Doc

golibs

This repository contains several useful functions and interfaces for Go:

  • Cache - in-memory cache with LRU, limits and statistics
  • Log - logger with configurable log-level on top of standard "log"
  • File:
    • safe file writing
  • JSON:
    • JSON format helper functions
  • Utils:
    • hostname validator

Cache

A quick example:

conf := cache.Config{}
conf.EnableLRU = true
c := cache.New(conf)
c.Set([]byte("key"), []byte("value"))
val := c.Get([]byte("key"))

Directories

Path Synopsis
Package cache provides a simple LRU cache implementation
Package cache provides a simple LRU cache implementation
Package errors is a drop-in replacement and extension of the Go standard library's package errors.
Package errors is a drop-in replacement and extension of the Go standard library's package errors.
Package file provides helper functions for working with files Deprecated: This package is deprecated and will be removed in v0.10.0.
Package file provides helper functions for working with files Deprecated: This package is deprecated and will be removed in v0.10.0.
Package jsonutil provides some helper functions for working with JSON objects
Package jsonutil provides some helper functions for working with JSON objects
Package log contains necessary logging functions
Package log contains necessary logging functions
Package netutil contains common utilities for IP, MAC, and other kinds of network addresses.
Package netutil contains common utilities for IP, MAC, and other kinds of network addresses.
Package stringutil contains utilities for dealing with strings.
Package stringutil contains utilities for dealing with strings.
Package utils provides simple helper functions that are used in AdGuard projects Deprecated: This package is deprecated and will be removed in v0.10.0.
Package utils provides simple helper functions that are used in AdGuard projects Deprecated: This package is deprecated and will be removed in v0.10.0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL