Documentation
¶
Index ¶
- Constants
- func ComputeSchemaHash(definitions []compiler.SchemaDefinition) (string, error)
- func GenerateCaveatSource(caveat *core.CaveatDefinition, caveatTypeSet *caveattypes.TypeSet) (string, bool, error)
- func GenerateRelationSource(relation *core.Relation, caveatTypeSet *caveattypes.TypeSet) (string, error)
- func GenerateSchema(ctx context.Context, definitions []compiler.SchemaDefinition) (string, bool, error)
- func GenerateSchemaWithCaveatTypeSet(ctx context.Context, definitions []compiler.SchemaDefinition, ...) (string, bool, error)
- func GenerateSource(namespace *core.NamespaceDefinition, caveatTypeSet *caveattypes.TypeSet) (string, bool, error)
- func NewSourceGenerator(caveatTypeSet *caveattypes.TypeSet) *sourceGenerator
Constants ¶
const Ellipsis = "..."
Ellipsis is the relation name for terminal subjects.
const MaxSingleLineCommentLength = 70 // 80 - the comment parts and some padding
MaxSingleLineCommentLength sets the maximum length for a comment to made single line.
Variables ¶
This section is empty.
Functions ¶
func ComputeSchemaHash ¶ added in v1.53.0
func ComputeSchemaHash(definitions []compiler.SchemaDefinition) (string, error)
ComputeSchemaHash computes a SHA256 hash of the given schema definitions. Definitions are sorted by name before generating the schema text for consistent ordering.
func GenerateCaveatSource ¶ added in v1.14.0
func GenerateCaveatSource(caveat *core.CaveatDefinition, caveatTypeSet *caveattypes.TypeSet) (string, bool, error)
GenerateCaveatSource generates a DSL view of the given caveat definition.
func GenerateRelationSource ¶ added in v1.31.0
func GenerateRelationSource(relation *core.Relation, caveatTypeSet *caveattypes.TypeSet) (string, error)
GenerateRelationSource generates a DSL view of the given relation definition.
func GenerateSchema ¶ added in v1.14.0
func GenerateSchema(ctx context.Context, definitions []compiler.SchemaDefinition) (string, bool, error)
GenerateSchema generates a DSL view of the given schema. Definitions are output in the order provided. For canonical output, sort definitions by name before calling.
func GenerateSchemaWithCaveatTypeSet ¶ added in v1.43.0
func GenerateSchemaWithCaveatTypeSet(ctx context.Context, definitions []compiler.SchemaDefinition, caveatTypeSet *caveattypes.TypeSet) (string, bool, error)
GenerateSchemaWithCaveatTypeSet generates a DSL view of the given schema. Definitions are output in the order provided. For canonical output, sort definitions by name before calling.
func GenerateSource ¶
func GenerateSource(namespace *core.NamespaceDefinition, caveatTypeSet *caveattypes.TypeSet) (string, bool, error)
GenerateSource generates a DSL view of the given namespace definition.
func NewSourceGenerator ¶ added in v1.50.0
func NewSourceGenerator(caveatTypeSet *caveattypes.TypeSet) *sourceGenerator
Types ¶
This section is empty.