graph

package
v0.0.0-...-fac6e79 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package graph implementation and provider

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingSignature source transaction signature not present in policy
	ErrMissingSignature = errors.New("source transaction signature missing from policy")
)

Functions

This section is empty.

Types

type ErrNotFound

type ErrNotFound struct {
	Key []byte
}

ErrNotFound key not found

func (*ErrNotFound) Error

func (enf *ErrNotFound) Error() string

Error stringify error message

type SimpleGraph

type SimpleGraph struct {
	// contains filtered or unexported fields
}

SimpleGraph dag implementation

func New

func New() *SimpleGraph

New constructor

func (*SimpleGraph) AddEdge

func (g *SimpleGraph) AddEdge(source *domain.Vertex, target *domain.Vertex, p *domain.Policy) (*domain.Edge, error)

AddEdge to vertex

func (*SimpleGraph) AddVertex

func (g *SimpleGraph) AddVertex(p *domain.Policy) (*domain.Vertex, error)

AddVertex to graph

func (*SimpleGraph) GetVertex

func (g *SimpleGraph) GetVertex(key string) (*domain.Vertex, error)

GetVertex from graph

func (*SimpleGraph) TraverseAndValidateData

func (g *SimpleGraph) TraverseAndValidateData(subject, resource string, permission domain.Permission) bool

TraverseAndValidateData iterate over edges and validate data

Jump to

Keyboard shortcuts

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