v3

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	UnionIdentifier        string = "|"
	IntersectionIdentifier string = "&"
	ExclusionIdentifier    string = " - "
	RelationIdentifier     string = "#"
	WildcardIdentifier     string = ":*"
	ArrowIdentifier        string = "->"
)
View Source
const SupportedSchemaVersion int = 3

Variables

This section is empty.

Functions

func Load

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

Types

type ArrowOperator

type ArrowOperator struct {
	Relation   string `yaml:"relation"`
	Permission string `yaml:"permission"`
}

type DirectRelation

type DirectRelation struct {
	ObjectType string `yaml:"direct_relation"`
}

type ExclusionOperator

type ExclusionOperator struct {
	Base     string `yaml:"base"`
	Subtract string `yaml:"subtract"`
}

type IntersectionOperator

type IntersectionOperator struct {
	Intersection []string `yaml:"intersect"`
}

type Manifest

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

type ModelInfo

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

type ObjectType

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

type ObjectTypeName

type ObjectTypeName string

type PermissionName

type PermissionName string

type PermissionOperator

type PermissionOperator struct {
	Operator interface {
		// contains filtered or unexported methods
	} `yaml:"operator"`
}

func (*PermissionOperator) UnmarshalYAML

func (p *PermissionOperator) UnmarshalYAML(value *yaml.Node) error

type RelationDefinition

type RelationDefinition struct {
	Definition []interface {
		// contains filtered or unexported methods
	} `yaml:"definition"`
}

func (*RelationDefinition) UnmarshalYAML

func (r *RelationDefinition) UnmarshalYAML(value *yaml.Node) error

type RelationName

type RelationName string

type SchemaVersion

type SchemaVersion int

func (*SchemaVersion) UnmarshalYAML

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

type SubjectRelation

type SubjectRelation struct {
	ObjectType string `yaml:"object_relation"`
	Relation   string `yaml:"subject_relation"`
}

type UnionOperator

type UnionOperator struct {
	Union []string `yaml:"union"`
}

type WildcardRelation

type WildcardRelation struct {
	ObjectType string `yaml:"wildcard_relation"`
}

Jump to

Keyboard shortcuts

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