Documentation ¶
Index ¶
- func LoadJSONStringToProto(modelString string) (*pb.AuthorizationModel, error)
- func MustTransformDSLToJSON(data string) string
- func MustTransformDSLToProto(data string) *pb.AuthorizationModel
- func ParseDSL(data string) (*OpenFgaDslListener, *OpenFgaDslErrorListener)
- func TransformDSLToJSON(data string) (string, error)
- func TransformDSLToProto(data string) (*pb.AuthorizationModel, error)
- func TransformJSONProtoToDSL(model *pb.AuthorizationModel) (string, error)
- func TransformJSONStringToDSL(modelString string) (*string, error)
- type OpenFgaDslErrorListener
- type OpenFgaDslListener
- func (l *OpenFgaDslListener) EnterCondition(ctx *parser.ConditionContext)
- func (l *OpenFgaDslListener) EnterConditions(ctx *parser.ConditionsContext)
- func (l *OpenFgaDslListener) EnterMain(_ctx *parser.MainContext)
- func (l *OpenFgaDslListener) EnterRelationDeclaration(_ctx *parser.RelationDeclarationContext)
- func (l *OpenFgaDslListener) EnterRelationDefDirectAssignment(_ctx *parser.RelationDefDirectAssignmentContext)
- func (l *OpenFgaDslListener) EnterRelationDefPartials(ctx *parser.RelationDefPartialsContext)
- func (l *OpenFgaDslListener) EnterTypeDef(ctx *parser.TypeDefContext)
- func (l *OpenFgaDslListener) ExitCondition(ctx *parser.ConditionContext)
- func (l *OpenFgaDslListener) ExitConditionExpression(ctx *parser.ConditionExpressionContext)
- func (l *OpenFgaDslListener) ExitConditionParameter(ctx *parser.ConditionParameterContext)
- func (l *OpenFgaDslListener) ExitModelHeader(ctx *parser.ModelHeaderContext)
- func (l *OpenFgaDslListener) ExitRelationDeclaration(ctx *parser.RelationDeclarationContext)
- func (l *OpenFgaDslListener) ExitRelationDefDirectAssignment(_ctx *parser.RelationDefDirectAssignmentContext)
- func (l *OpenFgaDslListener) ExitRelationDefRewrite(ctx *parser.RelationDefRewriteContext)
- func (l *OpenFgaDslListener) ExitRelationDefTypeRestriction(ctx *parser.RelationDefTypeRestrictionContext)
- func (l *OpenFgaDslListener) ExitTypeDef(_ctx *parser.TypeDefContext)
- type OpenFgaDslSyntaxError
- type OpenFgaDslSyntaxErrorMetadata
- type OpenFgaDslSyntaxMultipleError
- type RelationDefinitionOperator
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 ¶
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 ParseDSL ¶
func ParseDSL(data string) (*OpenFgaDslListener, *OpenFgaDslErrorListener)
func TransformDSLToJSON ¶
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 ¶
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 ¶
func (err *OpenFgaDslSyntaxMultipleError) Error() string
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" )