Documentation
¶
Index ¶
Constants ¶
View Source
const ( OpReplace = 'r' OpDelete = 'd' OpInsert = 'i' OpEqual = 'e' )
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
func Diff(f filesystem.DocumentHandler, before, after []byte) filesystem.DocumentChanges
Diff calculates difference between Document's content and after byte sequence and returns it as filesystem.DocumentChanges
func IsNoBlockFoundErr ¶ added in v0.3.0
Types ¶
type InvalidHclPosErr ¶
func (*InvalidHclPosErr) Error ¶
func (e *InvalidHclPosErr) Error() string
type NoBlockFoundErr ¶
func (*NoBlockFoundErr) Error ¶
func (e *NoBlockFoundErr) Error() string
type NoTokenFoundErr ¶ added in v0.3.0
func (*NoTokenFoundErr) Error ¶ added in v0.3.0
func (e *NoTokenFoundErr) Error() string
type TokenizedBlock ¶ added in v0.3.0
type TokenizedBlock interface {
TokenAtPosition(hcl.Pos) (hclsyntax.Token, error)
Tokens() hclsyntax.Tokens
Range() hcl.Range
}
func NewTestBlock ¶ added in v0.3.0
func NewTestBlock(b []byte) (TokenizedBlock, error)
type TokenizedFile ¶ added in v0.3.0
type TokenizedFile interface {
BlockAtPosition(hcl.Pos) (TokenizedBlock, error)
TokenAtPosition(hcl.Pos) (hclsyntax.Token, error)
PosInBlock(hcl.Pos) bool
Blocks() ([]TokenizedBlock, error)
}
func NewFile ¶
func NewFile(dh filesystem.DocumentHandler, content []byte) TokenizedFile
func NewTestFile ¶ added in v0.3.0
func NewTestFile(b []byte) TokenizedFile
Click to show internal directories.
Click to hide internal directories.