coverage

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityCoverageInfo

type EntityCoverageInfo struct {
	EntityName string

	UncoveredRelationships       []string
	CoverageRelationshipsPercent int

	UncoveredAttributes       []string
	CoverageAttributesPercent int

	UncoveredAssertions       map[string][]string
	CoverageAssertionsPercent map[string]int
}

EntityCoverageInfo represents coverage information for a single entity

type SchemaCoverage

type SchemaCoverage struct {
	EntityName    string
	Relationships []string
	Attributes    []string
	Assertions    []string
}

SchemaCoverage represents the expected coverage for a schema entity

Example schema:

entity user {}

entity organization {
    relation admin @user
    relation member @user
}

entity repository {
    relation parent @organization
    relation owner  @user @organization#admin
    permission edit   = parent.admin or owner
    permission delete = owner
}

Expected relationships coverage:

  • organization#admin@user
  • organization#member@user
  • repository#parent@organization
  • repository#owner@user
  • repository#owner@organization#admin

Expected assertions coverage:

  • repository#edit
  • repository#delete

type SchemaCoverageInfo

type SchemaCoverageInfo struct {
	EntityCoverageInfo         []EntityCoverageInfo
	TotalRelationshipsCoverage int
	TotalAttributesCoverage    int
	TotalAssertionsCoverage    int
}

SchemaCoverageInfo represents the overall coverage information for a schema

func Run

func Run(shape file.Shape) SchemaCoverageInfo

Run analyzes the coverage of relationships, attributes, and assertions for a given schema shape and returns the coverage information

Jump to

Keyboard shortcuts

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