Documentation
¶
Index ¶
- Constants
- func ColorBlack(text string) string
- func ColorBlue(text string) string
- func ColorCyan(text string) string
- func ColorGreen(text string) string
- func ColorPurple(text string) string
- func ColorRed(text string) string
- func ColorRedBold(text string) string
- func ColorWhite(text string) string
- func ColorYellow(text string) string
- func DisableColor()
- func NewSlogHandler(writer *os.File, level string) slog.Handler
- func PrintDiff(leftName string, leftData []byte, rightName string, rightData []byte)
- func PrintDiffWithFunction(leftName string, leftData []byte, rightName string, rightData []byte, ...)
- func PrintFile(name string, data []byte)
- func PrintFileWithFunction(name string, data []byte, output func(string))
- func PrintGeneratedFile(name string, data []byte)
- func SetTabSize(size int)
- func WrapComment(s string) []string
- func WrapText(s string, width int) []string
- type SlogHandler
- func (h *SlogHandler) Enabled(_ context.Context, level slog.Level) bool
- func (h *SlogHandler) Handle(_ context.Context, r slog.Record) error
- func (h *SlogHandler) SetLevel(level string)
- func (h *SlogHandler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *SlogHandler) WithGroup(name string) slog.Handler
Constants ¶
View Source
const CommentWidth = 80
Variables ¶
This section is empty.
Functions ¶
func ColorBlack ¶
func ColorGreen ¶
func ColorPurple ¶
func ColorRedBold ¶
func ColorWhite ¶
func ColorYellow ¶
func DisableColor ¶ added in v0.2.0
func DisableColor()
func PrintDiffWithFunction ¶
func PrintFileWithFunction ¶
func PrintGeneratedFile ¶
func SetTabSize ¶
func SetTabSize(size int)
func WrapComment ¶
Types ¶
type SlogHandler ¶
type SlogHandler struct {
// contains filtered or unexported fields
}
func (*SlogHandler) SetLevel ¶
func (h *SlogHandler) SetLevel(level string)
Click to show internal directories.
Click to hide internal directories.