Documentation
¶
Index ¶
- func BinaryEncodeStruct(enc *TypeEncoder, v interface{}) error
- func Dump(descr string, in interface{})
- func DumpJSON(descr string, in interface{})
- func EncodeToBytes(v TypeMarshaller) ([]byte, error)
- func JoinHome(p string) (string, error)
- func RandomizeBytes(in []byte) []byte
- func SafeUnquote(in string) (string, error)
- func ToBytes(in interface{}) []byte
- func ToFixed(num float64, precision int) float64
- func ToFixedRounded(num float64, precision int) float64
- func WaitForCondition(d time.Duration, testFn func() bool) bool
- type StringBuilder
- type TypeEncoder
- func (p *TypeEncoder) Encode(v interface{}) error
- func (p *TypeEncoder) EncodeBytes(bs []byte) error
- func (p *TypeEncoder) EncodeNumber(v interface{}) error
- func (p *TypeEncoder) EncodeString(v string) error
- func (p *TypeEncoder) EncodeUVarint(i uint64) error
- func (p *TypeEncoder) EncodeVarint(i int64) error
- type TypeMarshaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryEncodeStruct ¶
func BinaryEncodeStruct(enc *TypeEncoder, v interface{}) error
func EncodeToBytes ¶
func EncodeToBytes(v TypeMarshaller) ([]byte, error)
func RandomizeBytes ¶
func SafeUnquote ¶
func ToFixedRounded ¶
Types ¶
type StringBuilder ¶
type StringBuilder []string
func (*StringBuilder) AddTemplate ¶
func (sb *StringBuilder) AddTemplate(t *template.Template, name string, data interface{}) error
func (*StringBuilder) Append ¶
func (sb *StringBuilder) Append(s string)
func (*StringBuilder) Join ¶
func (sb *StringBuilder) Join(s *StringBuilder)
func (*StringBuilder) String ¶
func (sb *StringBuilder) String() string
type TypeEncoder ¶
type TypeEncoder struct {
// contains filtered or unexported fields
}
func NewTypeEncoder ¶
func NewTypeEncoder(w io.Writer) *TypeEncoder
func (*TypeEncoder) Encode ¶
func (p *TypeEncoder) Encode(v interface{}) error
func (*TypeEncoder) EncodeBytes ¶
func (p *TypeEncoder) EncodeBytes(bs []byte) error
func (*TypeEncoder) EncodeNumber ¶
func (p *TypeEncoder) EncodeNumber(v interface{}) error
func (*TypeEncoder) EncodeString ¶
func (p *TypeEncoder) EncodeString(v string) error
func (*TypeEncoder) EncodeUVarint ¶
func (p *TypeEncoder) EncodeUVarint(i uint64) error
func (*TypeEncoder) EncodeVarint ¶
func (p *TypeEncoder) EncodeVarint(i int64) error
type TypeMarshaller ¶
type TypeMarshaller interface {
Marshal(enc *TypeEncoder) error
}
Click to show internal directories.
Click to hide internal directories.