stringbuilder

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RightPad

func RightPad(str string, length int, pad string) string

func Times

func Times(str string, n int) (out string)

Types

type B

type B struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) *B

func (*B) AddIndent

func (t *B) AddIndent(delta int)

func (*B) AddIndentAndNewline

func (t *B) AddIndentAndNewline(delta int)

func (*B) DrawBar

func (w *B) DrawBar(length int, bytes, totalBytes uint64, changeCount int)

changeCount = 0 indicates stall / no progress

func (*B) Newline

func (w *B) Newline()

func (*B) Printf

func (w *B) Printf(format string, args ...interface{})

func (*B) PrintfDrawIndentedAndWrappedIfMultiline

func (w *B) PrintfDrawIndentedAndWrappedIfMultiline(format string, args ...interface{})

func (*B) String

func (b *B) String() string

func (*B) Write

func (w *B) Write(s string)

type Config

type Config struct {
	IndentMultiplier int `validate:"gte=1"`
	Width            int `validate:"gte=1"`
}

Jump to

Keyboard shortcuts

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