string_format_writer

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StringDRArrow         = "↳"
	StringNew             = "new"
	StringSame            = "same"
	StringChanged         = "changed"
	StringDeleted         = "deleted"
	StringUpdated         = "updated"
	StringArchived        = "archived"
	StringInternal        = "internal"
	StringUnchanged       = "unchanged"
	StringUntracked       = "untracked"
	StringConflicted      = "conflicted"
	StringRecognized      = "recognized"
	StringCheckedOut      = "checked out"
	StringBlobMissing     = "blob missing"
	StringWouldDelete     = "would delete"
	StringUnrecognized    = "unrecognized"
	StringFormatDateTime  = "06-01-02 15:04:05"
	StringIndent          = "                 "
	StringIndentWithSpace = "                   "
	LenStringMax          = len(StringIndent) // TODO-P4 use reflection?

)
View Source
const (
	CliFormatTruncationNone = CliFormatTruncation(iota)
	CliFormatTruncation66CharEllipsis
)

Variables

This section is empty.

Functions

func MakeBoxStringEncoder

func MakeBoxStringEncoder(
	truncate CliFormatTruncation,
	co ColorOptions,
) *boxStringEncoder

func MakeBracketWrapped

func MakeBracketWrapped[T any](
	sfw interfaces.StringEncoderTo[T],
) interfaces.StringEncoderTo[T]

func MakeColor

func MakeDefaultDatePrefixFormatWriter

func MakeDefaultDatePrefixFormatWriter[T any](
	clock Clock,
	f interfaces.StringEncoderTo[T],
) interfaces.StringEncoderTo[T]

func MakeDelim

func MakeDelim[T any](
	delim string,
	w1 interfaces.WriterAndStringWriter,
	f interfaces.StringEncoderTo[T],
) func(T) error

func MakeFunc

func MakeIndentedHeader

func MakeIndentedHeader(
	o ColorOptions,
) interfaces.StringEncoderTo[string]

func MakeQuotedString

func MakeQuotedString[T ~string]() interfaces.StringEncoderTo[T]

func MakeRightAligned

func MakeRightAligned() interfaces.StringEncoderTo[string]

func MakeString

func MakeString[T ~string]() interfaces.StringEncoderTo[T]

func StringPrefixFromOptions

func StringPrefixFromOptions(
	options options_print.Options,
) string

func WriteStringPrefixFormat

func WriteStringPrefixFormat(
	w interfaces.WriterAndStringWriter,
	prefix, body string,
) (n int64, err error)

Types

type Box

type Box struct {
	Header                   BoxHeader
	Contents                 collections_slice.Slice[FormattedField]
	Trailer                  collections_slice.Slice[FormattedField]
	EachFieldOnANewline      bool
	IdFieldsSeparatedByLines bool
}

type BoxHeader

type BoxHeader struct {
	Value        string
	RightAligned bool
}

type CliFormatTruncation

type CliFormatTruncation int

type Clock

type Clock interface {
	GetTime() time.Time
}

type ColorOptions

type ColorOptions struct {
	OffEntirely bool
}

func (ColorOptions) SetOffEntirely

func (co ColorOptions) SetOffEntirely(v bool) ColorOptions

type Date

type Date[T any] struct {
	Clock
	Format string
	interfaces.StringEncoderTo[T]
}

func (*Date[T]) EncodeStringTo

func (f *Date[T]) EncodeStringTo(
	e T,
	w interfaces.WriterAndStringWriter,
) (n int64, err error)

type FormattedField

type FormattedField struct {
	fields.Field
	Separator          rune
	DisableValueQuotes bool
	NoTruncate         bool
	NeedsNewline       bool
}

type HeaderWriter

type HeaderWriter[T any] interface {
	WriteBoxHeader(*BoxHeader, T) error
}

type OutputOptions

type OutputOptions struct {
	ColorOptionsOut ColorOptions
	ColorOptionsErr ColorOptions
}

Source Files

  • bracket_wrapped.go
  • color.go
  • date.go
  • delim.go
  • fields_writer.go
  • func.go
  • indented_header.go
  • main.go
  • options.go
  • prefix.go
  • quoted_string.go
  • right_aligned.go
  • string.go
  • truncate_options.go

Jump to

Keyboard shortcuts

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