util

package
v0.0.0-...-5607d3c Latest Latest
Warning

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

Go to latest
Published: May 13, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HtmlMdRenderer md.Renderer

Functions

func FormatFilesize

func FormatFilesize(bytes int64) string

func FormatFilesize2

func FormatFilesize2(bytes int64) string

func InfoHashToMagnet

func InfoHashToMagnet(ih string, name string, trackers ...string) (str string)

convert a binary infohash to a magnet uri given a display name and tracker urls

func IsWhitespace

func IsWhitespace(r rune) bool

return true if r is a whitespace rune

func MarkdownToHTML

func MarkdownToHTML(markdown string) template.HTML

TODO: restrict certain types of markdown

func Safe

func Safe(s string) template.URL

func SafeText

func SafeText(s string) template.HTML

func SendError

func SendError(w http.ResponseWriter, err error, code int)

func TrimWhitespaces

func TrimWhitespaces(s string) string

trim whitespaces from a string

func UnZlib

func UnZlib(description []byte) (string, error)

Types

This section is empty.

Directories

Path Synopsis
* package for parsing bitorrent meta info objects originally from XD i2p bittorrent client: https://github.com/majestrate/XD
* package for parsing bitorrent meta info objects originally from XD i2p bittorrent client: https://github.com/majestrate/XD

Jump to

Keyboard shortcuts

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