transformer

package
v0.0.0-...-306874a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJSONStringToProto

func LoadJSONStringToProto(modelString string) (*pb.AuthorizationModel, error)

LoadJSONStringToProto - Converts models authored in OpenFGA JSON syntax to the protobuf representation

func MustTransformDSLToJSON

func MustTransformDSLToJSON(data string) string

MustTransformDSLToJSON - Calls TransformDSLToJSON - panics if the error fails

func MustTransformDSLToProto

func MustTransformDSLToProto(data string) *pb.AuthorizationModel

MustTransformDSLToProto - Calls TransformDSLToProto - panics if the error fails

func TransformDSLToJSON

func TransformDSLToJSON(data string) (string, error)

TransformDSLToJSON - Converts models authored in FGA DSL syntax to the json syntax accepted by the OpenFGA API

func TransformDSLToProto

func TransformDSLToProto(data string) (*pb.AuthorizationModel, error)

TransformDSLToProto - Converts models authored in FGA DSL syntax to the OpenFGA Authorization Model Protobuf format

func TransformJSONProtoToDSL

func TransformJSONProtoToDSL(model *pb.AuthorizationModel) (string, error)

TransformJSONProtoToDSL - Converts models from the protobuf representation of the JSON syntax to the OpenFGA DSL

func TransformJSONStringToDSL

func TransformJSONStringToDSL(modelString string) (*string, error)

TransformJSONStringToDSL - Converts models authored in OpenFGA JSON syntax to the DSL syntax

Types

type OpenFgaDslErrorListener

type OpenFgaDslErrorListener struct {
	*antlr.DefaultErrorListener // Embed default which ensures we fit the interface
	Errors                      *multierror.Error
}

func (*OpenFgaDslErrorListener) SyntaxError

func (c *OpenFgaDslErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)

type OpenFgaDslListener

type OpenFgaDslListener struct {
	*parser.BaseOpenFGAParserListener
	// contains filtered or unexported fields
}

func (*OpenFgaDslListener) EnterCondition

func (l *OpenFgaDslListener) EnterCondition(ctx *parser.ConditionContext)

func (*OpenFgaDslListener) EnterConditions

func (l *OpenFgaDslListener) EnterConditions(ctx *parser.ConditionsContext)

func (*OpenFgaDslListener) EnterMain

func (l *OpenFgaDslListener) EnterMain(_ctx *parser.MainContext)

func (*OpenFgaDslListener) EnterRelationDeclaration

func (l *OpenFgaDslListener) EnterRelationDeclaration(_ctx *parser.RelationDeclarationContext)

func (*OpenFgaDslListener) EnterRelationDefDirectAssignment

func (l *OpenFgaDslListener) EnterRelationDefDirectAssignment(_ctx *parser.RelationDefDirectAssignmentContext)

func (*OpenFgaDslListener) EnterRelationDefPartials

func (l *OpenFgaDslListener) EnterRelationDefPartials(ctx *parser.RelationDefPartialsContext)

func (*OpenFgaDslListener) EnterTypeDef

func (l *OpenFgaDslListener) EnterTypeDef(ctx *parser.TypeDefContext)

func (*OpenFgaDslListener) ExitCondition

func (l *OpenFgaDslListener) ExitCondition(ctx *parser.ConditionContext)

func (*OpenFgaDslListener) ExitConditionExpression

func (l *OpenFgaDslListener) ExitConditionExpression(ctx *parser.ConditionExpressionContext)

func (*OpenFgaDslListener) ExitConditionParameter

func (l *OpenFgaDslListener) ExitConditionParameter(ctx *parser.ConditionParameterContext)

func (*OpenFgaDslListener) ExitModelHeader

func (l *OpenFgaDslListener) ExitModelHeader(ctx *parser.ModelHeaderContext)

func (*OpenFgaDslListener) ExitRelationDeclaration

func (l *OpenFgaDslListener) ExitRelationDeclaration(ctx *parser.RelationDeclarationContext)

func (*OpenFgaDslListener) ExitRelationDefDirectAssignment

func (l *OpenFgaDslListener) ExitRelationDefDirectAssignment(_ctx *parser.RelationDefDirectAssignmentContext)

func (*OpenFgaDslListener) ExitRelationDefRewrite

func (l *OpenFgaDslListener) ExitRelationDefRewrite(ctx *parser.RelationDefRewriteContext)

func (*OpenFgaDslListener) ExitRelationDefTypeRestriction

func (l *OpenFgaDslListener) ExitRelationDefTypeRestriction(ctx *parser.RelationDefTypeRestrictionContext)

func (*OpenFgaDslListener) ExitTypeDef

func (l *OpenFgaDslListener) ExitTypeDef(_ctx *parser.TypeDefContext)

type OpenFgaDslSyntaxError

type OpenFgaDslSyntaxError struct {
	// contains filtered or unexported fields
}

func (*OpenFgaDslSyntaxError) Error

func (err *OpenFgaDslSyntaxError) Error() string

type OpenFgaDslSyntaxErrorMetadata

type OpenFgaDslSyntaxErrorMetadata struct {
	// contains filtered or unexported fields
}

type OpenFgaDslSyntaxMultipleError

type OpenFgaDslSyntaxMultipleError multierror.Error

func (*OpenFgaDslSyntaxMultipleError) Error

type RelationDefinitionOperator

type RelationDefinitionOperator string
const (
	RELATION_DEFINITION_OPERATOR_NONE    RelationDefinitionOperator = ""
	RELATION_DEFINITION_OPERATOR_OR      RelationDefinitionOperator = "or"
	RELATION_DEFINITION_OPERATOR_AND     RelationDefinitionOperator = "and"
	RELATION_DEFINITION_OPERATOR_BUT_NOT RelationDefinitionOperator = "but not"
)

Jump to

Keyboard shortcuts

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