utils

package
v5.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: BSD-3-Clause Imports: 14 Imported by: 6

Documentation

Index

Constants

View Source
const EmptyHTTPResponse = `{}`

Variables

This section is empty.

Functions

func DecodeBase64String

func DecodeBase64String(str string) (string, error)

DecodeBase64String decodes a given base64 string to regular string

func GenerateID

func GenerateID(crypto bool) string

GenerateID copied from docker. generates a unique hash string

func HandleHTTPError

func HandleHTTPError(w http.ResponseWriter, msg string, err error)

func IPIncrement

func IPIncrement(originalIP net.IP) (resultIP net.IP, err error)

IPIncrement increment the ip address

func ReadRequest

func ReadRequest(r *http.Request, req interface{}) error

ReadRequest http request body

Types

type HashMap

type HashMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

HashMap synchronized hash map

func NewHashMap

func NewHashMap() *HashMap

NewHashMap creates a new hash map

func (*HashMap) GetKeys

func (h *HashMap) GetKeys() []string

GetKeys given keys in a map

func (*HashMap) Read

func (h *HashMap) Read(key string) (interface{}, bool)

Read reads from hash map

func (*HashMap) Write

func (h *HashMap) Write(key string, value interface{})

Write writes to hash map

Jump to

Keyboard shortcuts

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