store

package
v0.0.1-pre Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

View Source
const (
	NodeXIDDelimiter = "."
	EdgeXIDDelimiter = "->"

	NodeXTypePod = "pod"
	NodeXTypeSvc = "service"
	// XXX: Not covered until we know how to represent this
	NodeXTypeExt = "ext"

	EdgeXTypeConnection = "connection"

	ReservedAttributeNodeType  = "node_type"
	ReservedAttributeEdgeType  = "edge_type"
	ReservedAttributeName      = "name"
	ReservedAttributeNamespace = "namespace"
	ReservedAttributeXID       = "xid"
)

Variables

This section is empty.

Functions

func NodeXTypeFromString

func NodeXTypeFromString(objType string) string

func NodeXTypeToString

func NodeXTypeToString(xtype string) string

Types

type Dagger

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

func NewDaggerStore

func NewDaggerStore() *Dagger

func NewDaggerStore(logger *log.ZapLogger) *Dagger {

func (*Dagger) AddEdge

func (d *Dagger) AddEdge(edge Edge) error

func (*Dagger) AddNode

func (d *Dagger) AddNode(node Node)

func (*Dagger) DelEdge

func (d *Dagger) DelEdge(edge Edge)

func (*Dagger) DelEdgeAttribute

func (d *Dagger) DelEdgeAttribute(edge Edge, key string) (map[string]interface{}, error)

func (*Dagger) DelNode

func (d *Dagger) DelNode(node Node)

func (*Dagger) DelNodeAttribute

func (d *Dagger) DelNodeAttribute(node Node, key string) (map[string]interface{}, error)

func (*Dagger) GetEdgeAttribute

func (d *Dagger) GetEdgeAttribute(edge Edge, key string) (interface{}, error)

func (*Dagger) GetEdgeAttributes

func (d *Dagger) GetEdgeAttributes(edge Edge) (map[string]interface{}, error)

func (*Dagger) GetEdgeNodes

func (d *Dagger) GetEdgeNodes(edge Edge) (Node, Node, error)

func (*Dagger) GetNodeAttribute

func (d *Dagger) GetNodeAttribute(node Node, key string) (interface{}, error)

func (*Dagger) GetNodeAttributes

func (d *Dagger) GetNodeAttributes(node Node) (map[string]interface{}, error)

func (*Dagger) ListInboundEdges

func (d *Dagger) ListInboundEdges(node Node) ([]Edge, error)

func (*Dagger) ListNeighbors

func (d *Dagger) ListNeighbors(node Node) ([]Node, error)

func (*Dagger) ListNodes

func (d *Dagger) ListNodes() ([]Node, error)

func (*Dagger) ListOutboundEdges

func (d *Dagger) ListOutboundEdges(node Node) ([]Edge, error)

func (*Dagger) SetEdgeAttribute

func (d *Dagger) SetEdgeAttribute(edge Edge, key string, value interface{}) (map[string]interface{}, error)

func (*Dagger) SetEdgeAttributes

func (d *Dagger) SetEdgeAttributes(edge Edge, attributes map[string]interface{}) (map[string]interface{}, error)

func (*Dagger) SetNodeAttribute

func (d *Dagger) SetNodeAttribute(node Node, key string, value interface{}) (map[string]interface{}, error)

func (*Dagger) SetNodeAttributes

func (d *Dagger) SetNodeAttributes(node Node, attributes map[string]interface{}) (map[string]interface{}, error)

type Edge

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

type EdgeOps

type EdgeOps interface {
	AddEdge(edge Edge) error
	DelEdge(edge Edge)
	GetEdgeNodes(edge Edge) (Node, Node, error)
	GetEdgeAttributes(edge Edge) (map[string]interface{}, error)
	GetEdgeAttribute(edge Edge, key string) (interface{}, error)
	SetEdgeAttributes(edge Edge, attributes map[string]interface{}) (map[string]interface{}, error)
	SetEdgeAttribute(edge Edge, key string, value interface{}) (map[string]interface{}, error)
	DelEdgeAttribute(edge Edge, key string) (map[string]interface{}, error)
}

type GraphOps

type GraphOps interface {
	ListNodes() ([]Node, error)
	ListNeighbors(node Node) ([]Node, error)
	ListOutboundEdges(node Node) ([]Edge, error)
	ListInboundEdges(node Node) ([]Edge, error)
}

type GraphStorage

type GraphStorage interface {
	NodeOps
	EdgeOps
	GraphOps
}

type Node

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

type NodeOps

type NodeOps interface {
	AddNode(node Node)
	DelNode(node Node)
	GetNodeAttributes(node Node) (map[string]interface{}, error)
	GetNodeAttribute(node Node, key string) (interface{}, error)
	SetNodeAttributes(node Node, attributes map[string]interface{}) (map[string]interface{}, error)
	SetNodeAttribute(node Node, key string, value interface{}) (map[string]interface{}, error)
	DelNodeAttribute(node Node, key string) (map[string]interface{}, error)
}

Jump to

Keyboard shortcuts

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