repository

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	GetDBType() string
	CreateEntity(entity *types.Entity) (*types.Entity, error)
	CreateAsset(asset oam.Asset) (*types.Entity, error)
	FindEntityById(id string) (*types.Entity, error)
	FindEntitiesByContent(asset oam.Asset, since time.Time) ([]*types.Entity, error)
	FindEntitiesByType(atype oam.AssetType, since time.Time) ([]*types.Entity, error)
	DeleteEntity(id string) error
	CreateEdge(edge *types.Edge) (*types.Edge, error)
	FindEdgeById(id string) (*types.Edge, error)
	IncomingEdges(entity *types.Entity, since time.Time, labels ...string) ([]*types.Edge, error)
	OutgoingEdges(entity *types.Entity, since time.Time, labels ...string) ([]*types.Edge, error)
	DeleteEdge(id string) error
	CreateEntityTag(entity *types.Entity, tag *types.EntityTag) (*types.EntityTag, error)
	CreateEntityProperty(entity *types.Entity, property oam.Property) (*types.EntityTag, error)
	FindEntityTagById(id string) (*types.EntityTag, error)
	FindEntityTagsByContent(prop oam.Property, since time.Time) ([]*types.EntityTag, error)
	GetEntityTags(entity *types.Entity, since time.Time, names ...string) ([]*types.EntityTag, error)
	DeleteEntityTag(id string) error
	CreateEdgeTag(edge *types.Edge, tag *types.EdgeTag) (*types.EdgeTag, error)
	CreateEdgeProperty(edge *types.Edge, property oam.Property) (*types.EdgeTag, error)
	FindEdgeTagById(id string) (*types.EdgeTag, error)
	FindEdgeTagsByContent(prop oam.Property, since time.Time) ([]*types.EdgeTag, error)
	GetEdgeTags(edge *types.Edge, since time.Time, names ...string) ([]*types.EdgeTag, error)
	DeleteEdgeTag(id string) error
	Close() error
}

Repository defines the methods for interacting with the asset database. It provides operations for creating, retrieving, tagging, and linking assets.

func New

func New(dbtype, dsn string) (Repository, error)

New creates a new instance of the asset database repository.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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