Versions in this module Expand all Collapse all v0 v0.0.1 Nov 1, 2023 Changes in this version + func Write(w io.Writer, doc *Document, fm FormatMode) error + type CommentLine struct + func NewCommentsLine(commentText string) *CommentLine + func (*CommentLine) Type() ElementType + func (el *CommentLine) CommentText() string + func (el *CommentLine) HasPreformattedText() bool + func (el *CommentLine) OriginalLineIndex() int + func (el *CommentLine) PreformattedLineText() string + type Document struct + func NewDocument(elements []Element) *Document + func Read(r io.Reader) (*Document, error) + func (doc *Document) Elements() []Element + type Element interface + HasPreformattedText func() bool + OriginalLineIndex func() int + PreformattedLineText func() string + Type func() ElementType + type ElementType int + const Comment + const Empty + const IPMapping + const Unknown + type EmptyLine struct + func NewEmptyLine() *EmptyLine + func (*EmptyLine) Type() ElementType + func (el *EmptyLine) HasPreformattedText() bool + func (el *EmptyLine) OriginalLineIndex() int + func (el *EmptyLine) PreformattedLineText() string + type FormatMode int + const FmtDefault + const FmtKeep + const FmtReFormat + type IPMappingLine struct + func NewIPMappingLine(ip string, domainNames []string, comment string) *IPMappingLine + func (*IPMappingLine) Type() ElementType + func (el *IPMappingLine) CommentText() string + func (el *IPMappingLine) DomainNames() []string + func (el *IPMappingLine) HasPreformattedText() bool + func (el *IPMappingLine) IPAddress() string + func (el *IPMappingLine) OriginalLineIndex() int + func (el *IPMappingLine) PreformattedLineText() string + type UnrecognizedLine struct + func (*UnrecognizedLine) Type() ElementType + func (el *UnrecognizedLine) HasPreformattedText() bool + func (el *UnrecognizedLine) OriginalLineIndex() int + func (el *UnrecognizedLine) PreformattedLineText() string