util

package
v0.0.0-...-dcade81 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Div

func Div(i, j float64) float64

func EscapeMarkdown

func EscapeMarkdown(s string) string

func RandomString

func RandomString(length int) string

func TruncateInRunes

func TruncateInRunes(s string, n int) string

TruncateInRunes truncates a string to fit the given size in Runes. https://github.com/prometheus/alertmanager/blob/dc1466487a537ea7cfce366b69429ac79a04a221/notify/util.go#L89

Types

type NeuteredFileSystem

type NeuteredFileSystem struct {
	fs.FS
}

func (NeuteredFileSystem) Open

func (nfs NeuteredFileSystem) Open(path string) (fs.File, error)

type RouterSwapper

type RouterSwapper struct {
	Root   *mux.Router
	Prefix string
	// contains filtered or unexported fields
}

func (*RouterSwapper) ServeHTTP

func (rs *RouterSwapper) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*RouterSwapper) Swap

func (rs *RouterSwapper) Swap(newRouter *mux.Router)

Jump to

Keyboard shortcuts

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