Documentation ¶
Index ¶
- func Write(w io.Writer, doc *Document, fm FmtMode) error
- type BlanksBlock
- type Block
- type BlockType
- type CommentsBlock
- type Document
- 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
- type 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
- type IPAliasesBlockElementType
- type 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
- type UnrecognizedBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlanksBlock ¶
type BlanksBlock struct {
// contains filtered or unexported fields
}
Sequence of blank lines
func (*BlanksBlock) LinesCount ¶
func (blk *BlanksBlock) LinesCount() int
func (*BlanksBlock) Type ¶
func (blk *BlanksBlock) Type() BlockType
type CommentsBlock ¶
type CommentsBlock struct {
// contains filtered or unexported fields
}
Sequence of comments
func NewCommentsBlock ¶
func NewCommentsBlock(commentsText string) *CommentsBlock
Creates new comments block
func (*CommentsBlock) CommentsText ¶
func (blk *CommentsBlock) CommentsText() string
func (*CommentsBlock) SetCommentsText ¶
func (blk *CommentsBlock) SetCommentsText(commentsText string)
func (*CommentsBlock) Type ¶
func (blk *CommentsBlock) Type() BlockType
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Container object for dom blocks found during parsing of the original document
func NewDocument ¶
func NewEmptyDocument ¶
func NewEmptyDocument() *Document
func (*Document) BlocksCount ¶
func (*Document) DeleteBlock ¶
func (*Document) IPBlocks ¶
func (doc *Document) IPBlocks() []*IPAliasesBlock
func (*Document) IPBlocksByIdentifiers ¶
func (doc *Document) IPBlocksByIdentifiers(id int, name string) []*IPAliasesBlock
func (*Document) IPsBlockById ¶
func (doc *Document) IPsBlockById(id int) *IPAliasesBlock
Finds IPs block by ID
func (*Document) IPsBlockByIdOrName ¶
func (doc *Document) IPsBlockByIdOrName(idOrName string) *IPAliasesBlock
func (*Document) IPsBlockByName ¶
func (doc *Document) IPsBlockByName(name string) *IPAliasesBlock
Finds IPs block by name
type IPAliasesBlock ¶
type IPAliasesBlock struct {
// contains filtered or unexported fields
}
Block of IPs
func NewIPAliasesBlock ¶
func NewIPAliasesBlock() *IPAliasesBlock
func (*IPAliasesBlock) AddEntry ¶
func (blk *IPAliasesBlock) AddEntry(entry IPAliasesBlockElement)
func (*IPAliasesBlock) AliasEntries ¶
func (blk *IPAliasesBlock) AliasEntries() []*IPAliasesEntry
func (*IPAliasesBlock) AliasEntriesByAlias ¶
func (blk *IPAliasesBlock) AliasEntriesByAlias(alias string) []*IPAliasesEntry
func (*IPAliasesBlock) AliasEntriesByIP ¶
func (blk *IPAliasesBlock) AliasEntriesByIP(ip string) []*IPAliasesEntry
func (*IPAliasesBlock) AliasEntriesByIPOrAlias ¶
func (blk *IPAliasesBlock) AliasEntriesByIPOrAlias(ipOrAlias string) []*IPAliasesEntry
func (*IPAliasesBlock) ClearFormatting ¶
func (blk *IPAliasesBlock) ClearFormatting()
func (*IPAliasesBlock) Entries ¶
func (blk *IPAliasesBlock) Entries() []IPAliasesBlockElement
func (*IPAliasesBlock) Id ¶
func (blk *IPAliasesBlock) Id() int
func (*IPAliasesBlock) IdSet ¶
func (blk *IPAliasesBlock) IdSet() bool
Returns true if real ID value is set, otherwise if ID is auto generated, then returns false
func (*IPAliasesBlock) Name ¶
func (blk *IPAliasesBlock) Name() string
func (*IPAliasesBlock) Note ¶
func (blk *IPAliasesBlock) Note() string
func (*IPAliasesBlock) RemoveEntry ¶
func (blk *IPAliasesBlock) RemoveEntry(entry IPAliasesBlockElement) bool
func (*IPAliasesBlock) SetId ¶
func (blk *IPAliasesBlock) SetId(id int)
func (*IPAliasesBlock) SetName ¶
func (blk *IPAliasesBlock) SetName(name string)
func (*IPAliasesBlock) SetNote ¶
func (blk *IPAliasesBlock) SetNote(comment string)
func (*IPAliasesBlock) Type ¶
func (blk *IPAliasesBlock) Type() BlockType
type IPAliasesBlockElement ¶
type IPAliasesBlockElement interface { Type() IPAliasesBlockElementType ClearFormatting() // contains filtered or unexported methods }
type IPAliasesBlockElementType ¶
type IPAliasesBlockElementType int
const ( Alias IPAliasesBlockElementType = iota Placeholder )
type IPAliasesEntry ¶
type IPAliasesEntry struct {
// contains filtered or unexported fields
}
func NewIPAliasesEntry ¶
func NewIPAliasesEntry(ip string) *IPAliasesEntry
func (*IPAliasesEntry) AddAlias ¶
func (blk *IPAliasesEntry) AddAlias(alias string) bool
func (*IPAliasesEntry) Aliases ¶
func (blk *IPAliasesEntry) Aliases() []string
func (*IPAliasesEntry) ClearFormatting ¶
func (blk *IPAliasesEntry) ClearFormatting()
func (*IPAliasesEntry) Disabled ¶
func (blk *IPAliasesEntry) Disabled() bool
func (*IPAliasesEntry) IP ¶
func (blk *IPAliasesEntry) IP() string
func (*IPAliasesEntry) Note ¶
func (blk *IPAliasesEntry) Note() string
func (*IPAliasesEntry) RemoveAlias ¶
func (blk *IPAliasesEntry) RemoveAlias(alias string) bool
func (*IPAliasesEntry) SetDisabled ¶
func (blk *IPAliasesEntry) SetDisabled(disabled bool)
func (*IPAliasesEntry) SetIP ¶
func (blk *IPAliasesEntry) SetIP(ip string)
func (*IPAliasesEntry) SetNote ¶
func (blk *IPAliasesEntry) SetNote(comment string)
func (*IPAliasesEntry) Type ¶
func (blk *IPAliasesEntry) Type() IPAliasesBlockElementType
type IPAliasesPlaceholder ¶
type IPAliasesPlaceholder struct {
// contains filtered or unexported fields
}
func NewIPAliasesPlaceholder ¶
func NewIPAliasesPlaceholder() *IPAliasesPlaceholder
func (*IPAliasesPlaceholder) ClearFormatting ¶
func (blk *IPAliasesPlaceholder) ClearFormatting()
func (*IPAliasesPlaceholder) Type ¶
func (blk *IPAliasesPlaceholder) Type() IPAliasesBlockElementType
type UnrecognizedBlock ¶
type UnrecognizedBlock struct {
// contains filtered or unexported fields
}
Block of unrecognized lines
func (*UnrecognizedBlock) BodyElements ¶
func (blk *UnrecognizedBlock) BodyElements() []syntax.Element
func (*UnrecognizedBlock) Type ¶
func (blk *UnrecognizedBlock) Type() BlockType
Click to show internal directories.
Click to hide internal directories.