align

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Align

func Align(str string, align AlignmentType, size int) string

func Center

func Center(str string, size int) string

func Left

func Left(str string, size int) string
func Right(str string, size int) string

func Tab

func Tab(size int) string

Tab crée une tabulation d’une longueur donnée

func Tabulate

func Tabulate(str string, leftSize, rightSize int) string

func TabulateLeft

func TabulateLeft(str string, tabSize int) string

TabulateLeft ajoute une tabulation gauche à une chaîne donnée

func TabulateRight

func TabulateRight(str string, tabSize int) string

TabulateRight ajoute une tabulation droite à une chaîne donnée

Types

type Alignment

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

func New

func New(t AlignmentType, size int) Alignment

func (Alignment) Format

func (a Alignment) Format(str string) string

type AlignmentType

type AlignmentType int
const (
	LEFT AlignmentType = iota
	RIGHT
	CENTER
)

type ColumnSet

type ColumnSet []Alignment

func NewColumnSet

func NewColumnSet(aligns ...Alignment) ColumnSet

func (ColumnSet) Line

func (cs ColumnSet) Line(columns []string, sep, prefix, suffix string) string

func (ColumnSet) Normalize

func (cs ColumnSet) Normalize(columns []string) []string

Jump to

Keyboard shortcuts

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