format

package
v0.0.0-...-854da8c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmpty = errors.New("Empty format name")
)

Errors

Functions

This section is empty.

Types

type Format

type Format struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Format - groups of values for formatting

func New

func New(s string) (*Format, error)

New parsing from string s and returns Format

func (*Format) Count

func (f *Format) Count() int

Count returns the count of groups

func (*Format) Group

func (f *Format) Group(name string) (*Group, bool)

Group returns a group by name

func (*Format) Groups

func (f *Format) Groups() []string

Groups returns group names

func (*Format) Name

func (f *Format) Name() string

Name returns the name of the format

func (*Format) RawString

func (f *Format) RawString() string

RawString returns part of the line after the name of the format

func (*Format) Root

func (f *Format) Root() *Group

Root Returns root group

type Group

type Group struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Group - group of values

func (*Group) Count

func (g *Group) Count() int

Count returns the count of values

func (*Group) Get

func (g *Group) Get(key string) (string, bool)

Get returns a value by key

func (*Group) Name

func (g *Group) Name() string

Name returns the name of the group

Jump to

Keyboard shortcuts

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