format

package module
v1.19.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: OSL-3.0 Imports: 9 Imported by: 0

README

Format

Yeah so it sounds like you and me had the same journey here, and uh yeah I'm glad to find someone who's on the other side of it. So uh tell me what did you do?

Uh what do you mean?

Like what do you do?

I mean I hit both shift keys, and I type the letters with my nose.

I know that that's what I've been doing too, but what did you do so you don't have to do that anymore?

No that's what I do.

Joel Haver (2021)

Data parsers and formatters

Path Synopsis
crypto JA3 and TLS fingerprint
json JSON parser
m3u M3U parser
net HTML and HTTP parsers
protobuf Protocol Buffers

Repo

https://github.com/89z/format

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Number = Symbols{"", " K", " M", " B", " T"}
	Rate   = Symbols{" B/s", " kB/s", " MB/s", " GB/s", " TB/s"}
	Size   = Symbols{" B", " kB", " MB", " GB", " TB"}
)
View Source
var Log = Logger{Writer: os.Stderr}

Functions

func Clean added in v1.16.5

func Clean(char rune) rune

func ExtensionByType added in v1.16.6

func ExtensionByType(typ string) (string, error)

github.com/golang/go/issues/22318

func IsBinary added in v1.17.6

func IsBinary(buf []byte) bool

mimesniff.spec.whatwg.org#binary-data-byte

func Percent

func Percent(w io.Writer, value, total float64) (int, error)

func PercentInt added in v1.16.0

func PercentInt(w io.Writer, value, total int) (int, error)

func PercentInt64 added in v1.15.9

func PercentInt64(w io.Writer, value, total int64) (int, error)

func PercentUint64 added in v1.18.1

func PercentUint64(w io.Writer, value, total uint64) (int, error)

func Trim

func Trim(w io.Writer, s string) (int, error)

Types

type InvalidSlice added in v1.16.7

type InvalidSlice struct {
	Index, Length int
}

func (InvalidSlice) Error added in v1.16.7

func (i InvalidSlice) Error() string

type Logger added in v1.18.4

type Logger struct {
	io.Writer
	Level int
}

Use 0 for INFO, 1 for VERBOSE and any other value for QUIET.

func (Logger) Dump added in v1.18.4

func (l Logger) Dump(req *http.Request) error

type Progress added in v1.16.3

type Progress struct {
	*http.Response

	io.Writer
	// contains filtered or unexported fields
}

func NewProgress added in v1.18.1

func NewProgress(src *http.Response, dst io.Writer) *Progress

func (*Progress) Read added in v1.16.3

func (p *Progress) Read(buf []byte) (int, error)

type Symbols

type Symbols []string

func (Symbols) Float64 added in v1.18.6

func (s Symbols) Float64(w io.Writer, f float64) (int, error)

func (Symbols) Int added in v1.18.6

func (s Symbols) Int(w io.Writer, i int) (int, error)

func (Symbols) Int64 added in v1.18.6

func (s Symbols) Int64(w io.Writer, i int64) (int, error)

func (Symbols) Uint64 added in v1.18.6

func (s Symbols) Uint64(w io.Writer, i uint64) (int, error)

Directories

Path Synopsis
cmd
net command
proxy command
TLS and JA3 parsers TLS and JA3 parsers
TLS and JA3 parsers TLS and JA3 parsers
JSON parser
JSON parser
M3U parser
M3U parser
HTML and HTTP parsers.
HTML and HTTP parsers.
Protocol Buffers
Protocol Buffers

Jump to

Keyboard shortcuts

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