Documentation
¶
Index ¶
- func Bind(v interface{}, data map[string]interface{}, vars ...*regexp.Regexp) interface{}
- func Dump(values ...interface{})
- func DumpError(values ...interface{})
- func DumpInfo(values ...interface{})
- func DumpWarn(values ...interface{})
- func EnvInt(key interface{}, defaults ...int) int
- func EnvString(key interface{}, defaults ...string) string
- func GetDevWriter() io.Writer
- func Marshal(jsonObj interface{}) ([]byte, error)
- func ReadFile(file io.Reader) ([]byte, error)
- func ReadFileString(file io.Reader) (string, error)
- func SetDevWriter(w io.Writer)
- func ToString(values ...interface{}) string
- func UnmarshalFile(file io.Reader, v interface{}) error
- type Formatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dump ¶ added in v1.0.0
func Dump(values ...interface{})
Dump The Dump function dumps the given variables:
func DumpError ¶ added in v1.0.0
func DumpError(values ...interface{})
DumpError dumps the given variables in red color
func DumpInfo ¶ added in v1.0.0
func DumpInfo(values ...interface{})
DumpInfo dumps the given variables in blue color
func DumpWarn ¶ added in v1.0.0
func DumpWarn(values ...interface{})
DumpWarn dumps the given variables in yellow color
func GetDevWriter ¶ added in v1.0.0
GetDevWriter returns the current development mode output target.
func ReadFileString ¶
ReadFileString 读取文件内容, 返回String
func SetDevWriter ¶ added in v1.0.0
SetDevWriter replaces the development mode output target. Called by TUI initialization to redirect output into the TUI-managed area.
func ToString ¶ added in v1.0.0
func ToString(values ...interface{}) string
ToString returns a formatted string representation of the given variables
func UnmarshalFile ¶
UnmarshalFile JSON Unmarshal
Types ¶
type Formatter ¶ added in v1.0.0
type Formatter struct {
KeyColor *color.Color
StringColor *color.Color
BoolColor *color.Color
NumberColor *color.Color
NullColor *color.Color
StringMaxLength int
Indent int
DisabledColor bool
RawStrings bool
}
Formatter is a colorized JSON formatter
func NewFormatter ¶ added in v1.0.0
func NewFormatter() *Formatter
NewFormatter create a new Formatter
Click to show internal directories.
Click to hide internal directories.