utils

package
v0.0.0-...-31b0ff0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcatMaps

func ConcatMaps(maps []map[string]interface{}) map[string]interface{}

ConcatMaps takes a slice of maps, and put their k/v pairs together.

func Contains

func Contains(s []interface{}, e interface{}) bool

Contains detects if e is in slice s

func ContainsString

func ContainsString(s []string, e string) bool

ContainsString detects if e is in slice s

func GenerateRsaKeys

func GenerateRsaKeys() (pubPEM []byte, privPEM []byte)

GenerateRsaKeys returns a public key and a private key, both in PEM format.

func PS

func PS(str string) *string

func Paginate

func Paginate(sMinID string, sMaxID string) func(db *gorm.DB) *gorm.DB

Paginate any Model. db.Scopes(Paginate(r)).Find(&users) db.Scopes(Paginate(r)).Find(&articles)

func ParsePublicKey

func ParsePublicKey(pubPEM []byte) (crypto.PublicKey, error)

ParsePublicKey converts PEM into crypto.PublicKey

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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