httputils

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: BSD-1-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TitleCaser = cases.Title(language.English)

Functions

func CutFrontPath added in v1.0.6

func CutFrontPath(s string, length int) string

Cut the front of a path, and add "..." if it was cut.

func CutStart added in v1.0.6

func CutStart(s string, length int, delim string, prefixIfCut bool) string

Cut the string if it is longer than the specified length, and add "..." if it was cut.

func DirFromPath added in v1.0.6

func DirFromPath(p string) string

DirFromPath gets the directory from a path

func FilenameFromPath

func FilenameFromPath(p string) string

FilenameFromPath gets the filename from a path

func FormatLabel added in v1.6.2

func FormatLabel(s string) string

func GetPkgPath

func GetPkgPath(s any) string

Format the package path nicely For use in DB tables

func Jsonify

func Jsonify(v interface{}, indent int) ([]byte, error)

Jsonify converts a struct to json

func MustInt added in v1.6.2

func MustInt(s string, min, max, dflt int) int

func NameFromPath

func NameFromPath(p string) string

NameFromPath gets the filename from a path and removes the extension

func NicePath

func NicePath(forceSuffixSlash bool, p ...string) string

NicePath formats a path nicely

func SimpleSlugify

func SimpleSlugify(s string) string

SimpleSlugify is a simple slugify function

func UnJsonify

func UnJsonify(data []byte, v interface{}) error

UnJsonify converts json to a struct

func WrapSlash

func WrapSlash(p string) string

WrapSlash wraps a path with a slash if it doesn't have one

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