utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdate

func CreateOrUpdate(db *gorm.DB, model interface{}, where interface{}, update interface{}) (interface{}, error)

CreateOrUpdate --

func PermuteStrings

func PermuteStrings(parts ...[]string) (ret [][]string)

PermuteStrings generates all permutations of strings provided

func RandomString

func RandomString(length int) string

RandomString --

func RandomStringWithCharset

func RandomStringWithCharset(length int, charset string) string

RandomStringWithCharset --

func StringSliceContains

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

StringSliceContains --

func StringSlicePosition

func StringSlicePosition(slice []string, value string) int

StringSlicePosition --

Types

type Paginator

type Paginator struct {
	Limit  int
	Offset int
	Total  int
}

Paginator --

func Paginate

func Paginate(r *http.Request, count int64) (*Paginator, error)

Paginate --

Jump to

Keyboard shortcuts

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