v3

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const SupportedSchemaVersion int = 3

Variables

View Source
var ErrInvalidIdentifier = errors.New("invalid identifier (" + msgInvalidIdentifier + ")")

Functions

func Load

func Load(r io.Reader) (*model.Model, error)

func LoadFile added in v0.1.4

func LoadFile(path string) (*model.Model, error)

func ValidIdentifier added in v0.2.9

func ValidIdentifier[T interface{ ~string }](in T) bool

Types

type Manifest

type Manifest struct {
	ModelInfo   *ModelInfo                     `yaml:"model"`
	ObjectTypes map[ObjectTypeName]*ObjectType `yaml:"types"`
}

func (*Manifest) ValidateNames added in v0.2.9

func (m *Manifest) ValidateNames() error

type ModelInfo

type ModelInfo struct {
	Version SchemaVersion `yaml:"version"`
}

type ObjectType

type ObjectType struct {
	Relations   map[RelationName]string   `yaml:"relations,omitempty"`
	Permissions map[PermissionName]string `yaml:"permissions,omitempty"`
}

type ObjectTypeName

type ObjectTypeName string

type PermissionName

type PermissionName string

type RelationName

type RelationName string

type SchemaVersion

type SchemaVersion int

func (*SchemaVersion) UnmarshalYAML

func (v *SchemaVersion) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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