encoder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(v ...any) any

func EncodeToBytes

func EncodeToBytes(v ...any) ([]byte, error)

EncodeToJSON is similar to Encode, but return a []byte{}

c3po.EncodeToJSON(struct{Name:"Jão", Age:99}) => []byte{"{'Name':'jão', 'Age':99}"}

func EncodeToBytesWithIndent

func EncodeToBytesWithIndent(indent string, v ...any) ([]byte, error)

func EncodeToString

func EncodeToString(v ...any) string

EncodeToString return a string representation if ok, else empty string

c3po.EncodeToString(struct{Name:"Jão", Age:99}) => "{'Name':'jão', 'Age':99}"

func EncodeToStringIndent

func EncodeToStringIndent(indent string, v ...any) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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