utils

package
v0.0.0-...-9e41cc5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBytes = 32

Variables

View Source
var ErrInvalidUrl = errors.New("signature is invalid")

Functions

func CreateFile

func CreateFile(path string) (file io.WriteCloser, err error)

func DefaultStringGenerator

func DefaultStringGenerator() string

func LimiterKeyGenerator

func LimiterKeyGenerator(key []byte) func(c *fiber.Ctx) string

func UniqueBytesGenerator

func UniqueBytesGenerator(length int) []byte

UniqueBytesGenerator generates crypto random bytes

func UniqueStringGenerator

func UniqueStringGenerator(length int) string

UniqueStringGenerator - Generates crypto secure base64 encoded string

func UnsafeBytes

func UnsafeBytes(s string) (bs []byte)

#nosec G103 GetBytes returns a byte pointer without allocation

func UnsafeString

func UnsafeString(b []byte) string

#nosec G103 GetString returns a string pointer without allocation

Types

type URLSigner

type URLSigner interface {
	Sign(string, ...interface{}) (string, error)
	Verify(string) error
}

func NewURLSigner

func NewURLSigner(h hash.Hash) URLSigner

Jump to

Keyboard shortcuts

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