diff options
Diffstat (limited to 'vendor/github.com/authzed/spicedb/pkg/caveats/source.go')
| -rw-r--r-- | vendor/github.com/authzed/spicedb/pkg/caveats/source.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/github.com/authzed/spicedb/pkg/caveats/source.go b/vendor/github.com/authzed/spicedb/pkg/caveats/source.go new file mode 100644 index 0000000..8550f03 --- /dev/null +++ b/vendor/github.com/authzed/spicedb/pkg/caveats/source.go @@ -0,0 +1,19 @@ +package caveats + +import ( + "github.com/authzed/cel-go/common" +) + +// SourcePosition is an incoming source position. +type SourcePosition interface { + // LineAndColumn returns the 0-indexed line number and column position in the source file. + LineAndColumn() (int, int, error) + + // RunePosition returns the 0-indexed rune position in the source file. + RunePosition() (int, error) +} + +// NewSource creates a new source for compilation into a caveat. +func NewSource(expressionString string, name string) (common.Source, error) { + return common.NewStringSource(expressionString, name), nil +} |
