utils

package
v0.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructLineAndColumnData

func ConstructLineAndColumnData(lines []string, lineIndex int, symbol string) (StartEnd, StartEnd)

func GetConditionLineNumber

func GetConditionLineNumber(conditionName string, lines []string) int

func GetExtendedTypeLineNumber

func GetExtendedTypeLineNumber(typeName string, lines []string) int

func GetModuleForObjectTypeRelation

func GetModuleForObjectTypeRelation(typeDef *openfgav1.TypeDefinition, relation string) (string, error)

GetModuleForObjectTypeRelation returns the module for the given object type and relation in that type.

Parameters: - typeDef: A pointer to an openfgav1.TypeDefinition object which contains metadata about the type. - relation: A string representing the relation whose module is to be retrieved.

Returns: - A string representing the module for the given object type and relation. - An error if the relation does not exist.

func GetRelationLineNumber

func GetRelationLineNumber(relation string, lines []string) int

func GetTypeLineNumber

func GetTypeLineNumber(typeName string, lines []string) int

func IsRelationAssignable

func IsRelationAssignable(relDef *openfgav1.Userset) bool

IsRelationAssignable returns true if the relation is assignable, as in the relation definition has a key "this" or any of its children have a key "this".

Types

type StartEnd

type StartEnd struct {
	Start int
	End   int
}

Jump to

Keyboard shortcuts

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