pathfinder

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedParseJson = errorx.NewType(errorx.CommonErrors, "ErrFailedParseJson")
)
View Source
var (
	ErrFailedParseXml = errorx.NewType(errorx.CommonErrors, "ErrFailedParseXml")
)
View Source
var (
	ErrFailedParseYaml = errorx.NewType(errorx.CommonErrors, "ErrFailedParseYaml")
)
View Source
var (
	ErrUnsupportedFileExtension = errorx.NewType(errorx.CommonErrors, "ErrUnsupportedFileExtension")
)

Functions

This section is empty.

Types

type JsonPathFinder

type JsonPathFinder struct {
}

func (JsonPathFinder) Find

func (f JsonPathFinder) Find(content string, parts []string) (*Result, error)

type PathFinder

type PathFinder interface {
	Find(content string, parts []string) (*Result, error)
}

PathFinder finds a position of the version in string content using path array. Path array is an array of node names. It's agnostic to content type, and it's up to implementation to interpret them

func NewPathFinder

func NewPathFinder(fileName string) (PathFinder, error)

type Result

type Result struct {
	Start int
	End   int
	Value string
}

Result stores result of the version that was found and its position in string content

type XmlPathFinder

type XmlPathFinder struct {
}

func (XmlPathFinder) Find

func (f XmlPathFinder) Find(content string, parts []string) (*Result, error)

type YamlPathFinder

type YamlPathFinder struct {
}

func (YamlPathFinder) Find

func (f YamlPathFinder) Find(content string, parts []string) (*Result, error)

Jump to

Keyboard shortcuts

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