pfmt

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

README

pfmt

Build Status Go Reference

Source files are distributed under the BSD-style license found in the LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) boolV

Bool returns stringer/JSON/text marshaler for the bool type.

func Boolp

func Boolp(p *bool) boolP

Boolp returns stringer/JSON/text marshaler for the bool pointer type.

func Boolps

func Boolps(s ...*bool) boolPS

Boolps returns stringer/JSON/text marshaler for slice of bool pointers type.

func Bools

func Bools(s ...bool) boolS

Bools returns stringer/JSON/text marshaler for the bool slice type.

func Bytes

func Bytes(s ...byte) byteS

Bytes returns stringer/JSON/text marshaler for slice of bytes type.

func Bytesp

func Bytesp(p *[]byte) byteSP

Bytesp returns stringer/JSON/text marshaler for the pointer to byte slice type.

func Bytesps

func Bytesps(a ...*[]byte) byteSPS

Bytesps returns stringer/JSON/text marshaler for slice of pointers to byte slice type.

func Bytess

func Bytess(s ...[]byte) byteSS

Bytess returns stringer/JSON/text marshaler for the slice of byte slice type.

func Complex128

func Complex128(v complex128) complex128V

Complex128 returns stringer/JSON/text marshaler for the complex128 type.

func Complex128p

func Complex128p(p *complex128) complex128P

Complex128p returns stringer/JSON/text marshaler for the complex128 pointer type.

func Complex128ps

func Complex128ps(a ...*complex128) complex128PS

Complex128ps returns stringer/JSON/text marshaler for the complex128 pointer slice type.

func Complex128s

func Complex128s(s ...complex128) complex128S

Complex128s returns stringer/JSON/text marshaler for the complex128 slice type.

func Complex64

func Complex64(v complex64) complex64V

Complex64 returns stringer/JSON/text marshaler for the complex64 type.

func Complex64p

func Complex64p(p *complex64) complex64P

Complex64p returns stringer/JSON/text marshaler for the complex64 pointer type.

func Complex64ps

func Complex64ps(s ...*complex64) complex64PS

Complex64ps returns stringer/JSON/text marshaler for the slice of complex64 pointers type.

func Complex64s

func Complex64s(s ...complex64) complex64S

Complex64s returns stringer/JSON/text marshaler for the complex64 type.

func Duration

func Duration(v time.Duration) durationV

Duration returns stringer/JSON/text marshaler for the time duration type.

func Durationp

func Durationp(p *time.Duration) durationP

Durationp returns stringer/JSON/text marshaler for the time duration pointer type.

func Durationps

func Durationps(s ...*time.Duration) durationPS

Durationps returns stringer/JSON/text marshaler for the time duration pointer slice type.

func Durations

func Durations(s ...time.Duration) durationS

Durations returns stringer/JSON/text marshaler for time duration slice type.

func Error

func Error(v error) errorV

Error returns stringer/JSON/text marshaler for the error type.

func Errorp

func Errorp(p *error) errorP

Errorp returns stringer/JSON/text marshaler for the error pointer type.

func Errorps

func Errorps(s ...*error) errorPS

Errorps returns stringer/JSON/text marshaler for the slice of error pointers type.

func Errors

func Errors(s ...error) errorS

Errors returns stringer/JSON/text marshaler for the error slice type.

func Float32

func Float32(v float32) float32V

Float32 returns stringer/JSON/text marshaler for the float32 type.

func Float32p

func Float32p(p *float32) float32P

Float32p returns stringer/JSON/text marshaler for the float32 pointer type.

func Float32ps

func Float32ps(a ...*float32) float32PS

Float32ps returns stringer/JSON/text marshaler for the float32 pointer slice type.

func Float32s

func Float32s(s ...float32) float32S

Float32s returns stringer/JSON/text marshaler for the float32 slice type.

func Float64

func Float64(v float64) float64V

Float64 returns stringer/JSON/text marshaler for the float64 type.

func Float64p

func Float64p(p *float64) float64P

Float64p returns stringer/JSON/text marshaler for the float64 pointer type.

func Float64ps

func Float64ps(a ...*float64) float64PS

Float64ps returns stringer/JSON/text marshaler for the float64 pointer slice type.

func Float64s

func Float64s(s ...float64) float64S

Float64s returns stringer/JSON/text marshaler for the float64 slice type.

func Formatter added in v0.0.2

func Formatter(v interface{}) fmt.Formatter

Formatter returns formatter.

func Func added in v0.0.2

func Func(v func() KV) funcV

Func returns stringer/JSON/text marshaler for the custom function type.

func Int

func Int(v int) intV

Int returns stringer/JSON/text marshaler for the int type.

func Int16

func Int16(v int16) int16V

Int16 returns stringer/JSON/text marshaler for the int16 type.

func Int16p

func Int16p(p *int16) int16P

Int16p returns stringer/JSON/text marshaler for the int16 pointer type.

func Int16ps

func Int16ps(a ...*int16) int16PS

Int16ps returns stringer/JSON/text marshaler for the int16 pointer slice type.

func Int16s

func Int16s(s ...int16) int16S

Int16s returns stringer/JSON/text marshaler for the int16 slice type.

func Int32

func Int32(v int32) int32V

Int32 returns stringer/JSON/text marshaler for the int32 type.

func Int32p

func Int32p(p *int32) int32P

Int32p returns stringer/JSON/text marshaler for the int32 pointer type.

func Int32ps

func Int32ps(a ...*int32) int32PS

Int32ps returns stringer/JSON/text marshaler for the int32 pointer slice type.

func Int32s

func Int32s(s ...int32) int32S

Int32s returns stringer/JSON/text marshaler for the int32 slice type.

func Int64

func Int64(v int64) int64V

Int64 returns stringer/JSON/text marshaler for the int64 type.

func Int64p

func Int64p(p *int64) int64P

Int64p returns stringer/JSON/text marshaler for the int64 pointer type.

func Int64ps

func Int64ps(a ...*int64) int64PS

Int64ps returns stringer/JSON/text marshaler for the int64 pointer slice type.

func Int64s

func Int64s(s ...int64) int64S

Int64s returns stringer/JSON/text marshaler for the int64 slice type.

func Int8

func Int8(v int8) int8V

Int8 returns stringer/JSON/text marshaler for the int8 type.

func Int8p

func Int8p(p *int8) int8P

Int8p returns stringer/JSON/text marshaler for the int8 pointer type.

func Int8ps

func Int8ps(a ...*int8) int8PS

Int8ps returns stringer/JSON/text marshaler for the int8 pointer slice type.

func Int8s

func Int8s(s ...int8) int8S

Int8s returns stringer/JSON/text marshaler for the int8 slice type.

func Intp

func Intp(p *int) intP

Intp returns stringer/JSON/text marshaler for the int pointer type.

func Intps

func Intps(a ...*int) intPS

Intps returns stringer/JSON/text marshaler for the int pointer slice type.

func Ints

func Ints(s ...int) intS

Ints returns stringer/JSON/text marshaler for the int slice type.

func JSON added in v0.0.2

func JSON(s ...KV) jsonV

JSON returns stringer/JSON/text marshaler for the KV slice type.

func JSONMarshalers

func JSONMarshalers(s ...json.Marshaler) jsonMarshalerS

JSONMarshalers returns stringer/JSON/text marshaler for the JSON marshaler slice type.

func Println

func Println(a ...interface{}) (n int, errno error)

Println formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.

func Raw

func Raw(v []byte) rawV

Raw returns stringer/JSON/text marshaler for the raw byte slice.

func Rawp

func Rawp(p *[]byte) rawP

Rawp returns stringer/JSON/text marshaler for the raw byte slice pointer.

func Rawps

func Rawps(s ...*[]byte) rawPS

Rawps returns stringer/JSON/text marshaler for the slice of byte slice pointers type.

func Raws

func Raws(s ...[]byte) rawS

Raws returns stringer/JSON/text marshaler for the slice of byte slice type.

func Reflect

func Reflect(v interface{}) reflectV

Reflect returns stringer/JSON/text marshaler uses reflection.

func Reflects

func Reflects(s ...interface{}) reflectS

func Runes

func Runes(s ...rune) runeS

Runes returns stringer/JSON/text marshaler for the rune slice type.

func Runesp

func Runesp(p *[]rune) runeSP

Runesp returns stringer/JSON/text marshaler for the rune pointer slice type.

func Runesps

func Runesps(a ...*[]rune) runeSPS

Runesps returns stringer/JSON/text marshaler for slice of pointers to rune slice type.

func Sprint

func Sprint(a ...interface{}) string

Sprint formats using the default formats for its operands and returns the resulting string. Spaces are added between operands when neither is a string.

func String

func String(v string) stringV

String returns stringer/JSON/text marshaler for the string type.

func Stringp

func Stringp(p *string) stringP

Stringp returns stringer/JSON/text marshaler for the string pointer type.

func Stringps

func Stringps(a ...*string) stringPS

Stringps returns stringer/JSON/text marshaler for the string pointer slice type.

func Strings

func Strings(s ...string) stringS

Strings returns stringer/JSON/text marshaler for the string slice type.

func Text

func Text(v encoding.TextMarshaler) textV

Text returns stringer/JSON/text marshaler for the encoding.TextMarshaler type.

func Texts

func Texts(s ...encoding.TextMarshaler) textS

Texts returns stringer/JSON/text marshaler for the text marshaler slice type.

func Time

func Time(v time.Time) timeV

Time returns stringer/JSON/text marshaler for the time type.

func Timep

func Timep(p *time.Time) timeP

Timep returns stringer/JSON/text marshaler for the time pointer type.

func Timeps

func Timeps(a ...*time.Time) timePS

Timeps returns stringer/JSON/text marshaler for the time pointer slice type.

func Times

func Times(s ...time.Time) timeS

Times returns stringer/JSON/text marshaler for the slice of byte slice type.

func Uint

func Uint(v uint) uintV

Uint returns stringer/JSON/text marshaler for the uint type.

func Uint16

func Uint16(v uint16) uint16V

Uint16 returns stringer/JSON/text marshaler for the uint16 type.

func Uint16p

func Uint16p(p *uint16) uint16P

Uint16p returns stringer/JSON/text marshaler for the uint16 pointer type.

func Uint16ps

func Uint16ps(a ...*uint16) uint16PS

Uint16ps returns stringer/JSON/text marshaler for the uint16 pointer slice type.

func Uint16s

func Uint16s(s ...uint16) uint16S

Uint16s returns stringer/JSON/text marshaler for the uint16 slice type.

func Uint32

func Uint32(v uint32) uint32V

Uint32 returns stringer/JSON/text marshaler for the uint32 type.

func Uint32p

func Uint32p(p *uint32) uint32P

Uint32p returns stringer/JSON/text marshaler for the uint32 pointer type.

func Uint32ps

func Uint32ps(a ...*uint32) uint32PS

Uint32ps returns stringer/JSON/text marshaler for the uint32 pointer slice type.

func Uint32s

func Uint32s(s ...uint32) uint32S

Uint32s returns stringer/JSON/text marshaler for the uint32 slice type.

func Uint64

func Uint64(v uint64) uint64V

Uint64 returns stringer/JSON/text marshaler for the uint64 type.

func Uint64p

func Uint64p(p *uint64) uint64P

Uint64p returns stringer/JSON/text marshaler for the uint64 pointer type.

func Uint64ps

func Uint64ps(a ...*uint64) uint64PS

Uint64ps returns stringer/JSON/text marshaler for the uint64 pointer slice type.

func Uint64s

func Uint64s(s ...uint64) uint64S

Uint64s returns stringer/JSON/text marshaler for the uint64 slice type.

func Uint8

func Uint8(v uint8) uint8V

Uint8 returns stringer/JSON/text marshaler for the uint8 type.

func Uint8p

func Uint8p(p *uint8) uint8P

Uint8p returns stringer/JSON/text marshaler for the uint8 pointer type.

func Uint8ps

func Uint8ps(a ...*uint8) uint8PS

Uint8ps returns stringer/JSON/text marshaler for the uint8 pointer slice type.

func Uint8s

func Uint8s(s ...uint8) uint8S

Uint8s returns stringer/JSON/text marshaler for the uint8 slice type.

func Uintp

func Uintp(p *uint) uintP

Uintp returns stringer/JSON/text marshaler for the uint pointer type.

func Uintps

func Uintps(a ...*uint) uintPS

Uintps returns stringer/JSON/text marshaler for the uint pointer slice type.

func Uintptr

func Uintptr(v uintptr) uintptrV

Uintptr returns stringer/JSON/text marshaler for the uintptr type.

func Uintptrp

func Uintptrp(p *uintptr) uintptrP

Uintptrp returns stringer/JSON/text marshaler for the uintptr pointer type.

func Uintptrps

func Uintptrps(a ...*uintptr) uintptrPS

Uintptrps returns stringer/JSON/text marshaler for the slice of a pointer to a uintptr type.

func Uintptrs

func Uintptrs(s ...uintptr) uintptrS

Uintptrs returns stringer/JSON/text marshaler for the uintptr slice type.

func Uints

func Uints(s ...uint) uintS

Uints returns stringer/JSON/text marshaler for the uint slice type.

Types

type AnyS

type AnyS struct{ S []interface{} }

func Anys

func Anys(s ...interface{}) AnyS

Anys returns stringer/JSON/text marshaler for the slice of any type.

func (AnyS) MarshalJSON

func (s AnyS) MarshalJSON() ([]byte, error)

func (AnyS) MarshalText

func (s AnyS) MarshalText() ([]byte, error)

func (AnyS) String

func (s AnyS) String() string

type AnyV

type AnyV struct{ V interface{} }

func Any

func Any(v interface{}) AnyV

Any returns stringer/JSON/text marshaler for any type.

func (AnyV) MarshalJSON

func (v AnyV) MarshalJSON() ([]byte, error)

func (AnyV) MarshalText

func (v AnyV) MarshalText() ([]byte, error)

func (AnyV) String

func (v AnyV) String() string

type Fmt added in v0.0.3

type Fmt struct {
	// contains filtered or unexported fields
}

Formatter implements fmt formatter interface.

func (Fmt) Format added in v0.0.3

func (fm Fmt) Format(f fmt.State, c rune)

Format method controls how State and rune are interpreted, and may call Sprint(f) or Fprint(f) etc. to generate its output.

type KV added in v0.0.2

type KV interface {
	encoding.TextMarshaler
	json.Marshaler
}

KV is a key-value pair.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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