unit

package
v0.0.0-...-10b7995 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func (*Builder) AddSection

func (b *Builder) AddSection(name string, lines ...string) *SectionBuilder

func (*Builder) Bytes

func (b *Builder) Bytes() []byte

func (*Builder) Len

func (b *Builder) Len() (sum int)

func (*Builder) MarshalText

func (b *Builder) MarshalText() ([]byte, error)

type SectionBuilder

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

func (*SectionBuilder) Add

func (s *SectionBuilder) Add(key, value string) *SectionBuilder

func (*SectionBuilder) AddComment

func (s *SectionBuilder) AddComment(comment string) *SectionBuilder

func (*SectionBuilder) AddLines

func (s *SectionBuilder) AddLines(lines ...string) *SectionBuilder

func (*SectionBuilder) Len

func (s *SectionBuilder) Len() int

func (*SectionBuilder) Reset

func (s *SectionBuilder) Reset(name string) *SectionBuilder

type Unit

type Unit struct {
	Name     string  `json:"name"`
	Contents Builder `json:"contents,omitempty"`
}

func New

func New(name string) *Unit

func (*Unit) AddSection

func (u *Unit) AddSection(name string, lines ...string) *SectionBuilder

func (*Unit) Bytes

func (u *Unit) Bytes() []byte

func (*Unit) String

func (u *Unit) String() string

Jump to

Keyboard shortcuts

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