resources

package
v0.0.0-...-c492642 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	DB      *gorm.DB
	Eventer eventingapi.Manager
}

func New

func New(db *gorm.DB) *Repo

func (*Repo) Delete

func (r *Repo) Delete(ctx context.Context, id uuid.UUID) (*model.Relationship, error)

Delete deletes a model from the database, removes related tuples from the relations-api, and issues a delete event. The `id` is possibly of the form <reporter_type:local_resource_id>.

func (*Repo) FindByID

func (r *Repo) FindByID(ctx context.Context, id uuid.UUID) (*model.Relationship, error)

func (*Repo) FindRelationship

func (r *Repo) FindRelationship(ctx context.Context, subjectId, objectId uuid.UUID, relationshipType string) (*model.Relationship, error)

func (*Repo) FindResourceIdByReporterResourceId

func (r *Repo) FindResourceIdByReporterResourceId(ctx context.Context, id model.ReporterResourceId) (uuid.UUID, error)

func (*Repo) ListAll

func (r *Repo) ListAll(context.Context) ([]*model.Relationship, error)

func (*Repo) Save

func (*Repo) Update

func (r *Repo) Update(ctx context.Context, m *model.Relationship, id uuid.UUID) (*model.Relationship, error)

Update updates a model in the database, updates related tuples in the relations-api, and issues an update event. The `id` is possibly of the form <reporter_type:local_resource_id>.

Jump to

Keyboard shortcuts

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