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 FmtMode) error + type BlanksBlock struct + func (blk *BlanksBlock) LinesCount() int + func (blk *BlanksBlock) Type() BlockType + type Block interface + Type func() BlockType + type BlockType int + const Blanks + const Comments + const IPList + const Unknown + type CommentsBlock struct + func NewCommentsBlock(commentsText string) *CommentsBlock + func (blk *CommentsBlock) CommentsText() string + func (blk *CommentsBlock) SetCommentsText(commentsText string) + func (blk *CommentsBlock) Type() BlockType + type Document struct + func NewDocument(doc *syntax.Document) *Document + func NewEmptyDocument() *Document + func Read(r io.Reader) (*Document, error) + func (doc *Document) AddBlock(block Block) + func (doc *Document) Blocks() []Block + func (doc *Document) BlocksCount() int + func (doc *Document) DeleteBlock(block Block) + func (doc *Document) IPBlocks() []*IPAliasesBlock + func (doc *Document) IPBlocksByIdentifiers(id int, name string) []*IPAliasesBlock + func (doc *Document) IPsBlockById(id int) *IPAliasesBlock + func (doc *Document) IPsBlockByIdOrName(idOrName string) *IPAliasesBlock + func (doc *Document) IPsBlockByName(name string) *IPAliasesBlock + func (doc *Document) Normalize() bool + type FmtMode int + const FmtDefault + const FmtKeep + const FmtReFormat + type IPAliasesBlock struct + func NewIPAliasesBlock() *IPAliasesBlock + func (blk *IPAliasesBlock) AddEntry(entry IPAliasesBlockElement) + func (blk *IPAliasesBlock) AliasEntries() []*IPAliasesEntry + func (blk *IPAliasesBlock) AliasEntriesByAlias(alias string) []*IPAliasesEntry + func (blk *IPAliasesBlock) AliasEntriesByIP(ip string) []*IPAliasesEntry + func (blk *IPAliasesBlock) AliasEntriesByIPOrAlias(ipOrAlias string) []*IPAliasesEntry + func (blk *IPAliasesBlock) ClearFormatting() + func (blk *IPAliasesBlock) Entries() []IPAliasesBlockElement + func (blk *IPAliasesBlock) Id() int + func (blk *IPAliasesBlock) IdSet() bool + func (blk *IPAliasesBlock) Name() string + func (blk *IPAliasesBlock) Note() string + func (blk *IPAliasesBlock) RemoveEntry(entry IPAliasesBlockElement) bool + func (blk *IPAliasesBlock) SetId(id int) + func (blk *IPAliasesBlock) SetName(name string) + func (blk *IPAliasesBlock) SetNote(comment string) + func (blk *IPAliasesBlock) Type() BlockType + type IPAliasesBlockElement interface + ClearFormatting func() + Type func() IPAliasesBlockElementType + type IPAliasesBlockElementType int + const Alias + const Placeholder + type IPAliasesEntry struct + func NewIPAliasesEntry(ip string) *IPAliasesEntry + func (blk *IPAliasesEntry) AddAlias(alias string) bool + func (blk *IPAliasesEntry) Aliases() []string + func (blk *IPAliasesEntry) ClearFormatting() + func (blk *IPAliasesEntry) Disabled() bool + func (blk *IPAliasesEntry) IP() string + func (blk *IPAliasesEntry) Note() string + func (blk *IPAliasesEntry) RemoveAlias(alias string) bool + func (blk *IPAliasesEntry) SetDisabled(disabled bool) + func (blk *IPAliasesEntry) SetIP(ip string) + func (blk *IPAliasesEntry) SetNote(comment string) + func (blk *IPAliasesEntry) Type() IPAliasesBlockElementType + type IPAliasesPlaceholder struct + func NewIPAliasesPlaceholder() *IPAliasesPlaceholder + func (blk *IPAliasesPlaceholder) ClearFormatting() + func (blk *IPAliasesPlaceholder) Type() IPAliasesBlockElementType + type UnrecognizedBlock struct + func (blk *UnrecognizedBlock) BodyElements() []syntax.Element + func (blk *UnrecognizedBlock) Type() BlockType