stringify

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0, BSD-2-Clause Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	IndentationSize = 4
)

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) string

func Float32

func Float32(f float32) string

func Float64

func Float64(f float64) string

func Int

func Int(value int64) string

func Interface

func Interface(value interface{}) string

func IsInterfaceNil

func IsInterfaceNil(param interface{}) bool

func Map

func Map(value interface{}) string

func Slice

func Slice(value []interface{}) string

func SliceOfBytes

func SliceOfBytes(value []byte) string

func String

func String(value string) string

func Struct

func Struct(name string, fields ...*StructField) string

Struct creates a string representation of the given struct details.

func UInt

func UInt(value uint64) string

Types

type StructBuilder

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

func NewStructBuilder

func NewStructBuilder(name string, fields ...*StructField) *StructBuilder

NewStructBuilder returns a builder for the struct that can dynamically be modified.

func (*StructBuilder) AddField

func (stringifyStruct *StructBuilder) AddField(field *StructField)

AddField dynamically adds a new field to the struct.

func (*StructBuilder) String

func (stringifyStruct *StructBuilder) String() (result string)

type StructField

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

func NewStructField

func NewStructField(name string, value interface{}) *StructField

func (*StructField) String

func (structField *StructField) String() (result string)

Jump to

Keyboard shortcuts

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