generator

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

View Source
const Ellipsis = "..."

Ellipsis is the relation name for terminal subjects.

View Source
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.

Jump to

Keyboard shortcuts

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