oracle

package
v0.67.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoDefinitionFound indicates the position was valid but no matching definition was found.
	ErrNoDefinitionFound = Error{Code: "oracle_no_definition_found"}

	// ErrNoMatchFound indicates the position was invalid.
	ErrNoMatchFound = Error{Code: "oracle_no_match_found"}
)

Functions

This section is empty.

Types

type DefinitionQuery

type DefinitionQuery struct {
	Filename string                 // name of file to search for position inside of
	Pos      int                    // position to search for
	Modules  map[string]*ast.Module // workspace modules; buffer may shadow a file inside the workspace
	Buffer   []byte                 // buffer that overrides module with filename
}

DefinitionQuery defines a Rego definition query.

type DefinitionQueryResult

type DefinitionQueryResult struct {
	Result *ast.Location `json:"result"`
}

DefinitionQueryResult defines output of a definition query.

type Error

type Error struct {
	Code string `json:"code"`
}

Error defines the structure of errors returned by the oracle.

func (Error) Error

func (e Error) Error() string

type Oracle

type Oracle struct {
}

Oracle implements different queries over ASTs, e.g., find definition.

func New

func New() *Oracle

New returns a new Oracle object.

func (*Oracle) FindDefinition

func (o *Oracle) FindDefinition(q DefinitionQuery) (*DefinitionQueryResult, error)

FindDefinition returns the location of the definition referred to by the symbol at the position in q.

Jump to

Keyboard shortcuts

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