util

package
v0.0.0-...-f1c6d0e Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeJPEG

func EncodeJPEG(i image.Image) ([]byte, error)

func FirstNHTML

func FirstNHTML(text string, n, maxDepth int) string

func GenerateRandomToken

func GenerateRandomToken() (string, error)

func GetPreferredLanguage

func GetPreferredLanguage(langs []language.Tag) language.Tag

func MapMerge

func MapMerge(to, from map[string]interface{}) map[string]interface{}

MapMerge merges 'from' into 'to', overwriting if necessary.

func Merge

func Merge(p0, p1 context.Context) context.Context

func MustPropagateString

func MustPropagateString(f func() (string, error), e *error) (s string)

func SoftMapMergeInto

func SoftMapMergeInto(m map[string]interface{}, key string, val map[string]interface{})

SoftMapMerge takes m[k], converts to map[string]interface{}, and merges val into m[k], overwriting if necessary.

If m[k] does not exist, it is created.

If it cannot do the merge, silently fail.

func ToErrors

func ToErrors(nilable []error) error

func ToImage

func ToImage(b []byte) (image.Image, error)

toImage turns bytes into a JPEG, GIF, or PNG image.

Types

This section is empty.

Jump to

Keyboard shortcuts

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