resources

package
v0.0.0-...-2e58fa2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSubjectNotFound      = errors.New("subject not found")
	ErrObjectNotFound       = errors.New("object not found")
	ErrRelationshipExists   = errors.New("relationship already exists")
	ErrRelationshipNotFound = errors.New("relationship not found")
)

Functions

This section is empty.

Types

type ResourceRepository

type ResourceRepository interface {
	Save(ctx context.Context, resource *model.Relationship) (*model.Relationship, error)
	Update(context.Context, *model.Relationship, uuid.UUID) (*model.Relationship, error)
	Delete(context.Context, uuid.UUID) (*model.Relationship, error)
	FindByID(context.Context, uuid.UUID) (*model.Relationship, error)
	FindRelationship(ctx context.Context, subjectId, objectId uuid.UUID, relationshipType string) (*model.Relationship, error)
	FindResourceIdByReporterResourceId(ctx context.Context, id model.ReporterResourceId) (uuid.UUID, error)
	ListAll(context.Context) ([]*model.Relationship, error)
}

type Usecase

type Usecase struct {
	DisablePersistence bool
	// contains filtered or unexported fields
}

func New

func New(repository ResourceRepository, eventer eventingapi.Manager, logger log.Logger, disablePersistence bool) *Usecase

func (*Usecase) Create

func (uc *Usecase) Create(ctx context.Context, m *model.Relationship) (*model.Relationship, error)

func (*Usecase) Delete

func (*Usecase) Update

Jump to

Keyboard shortcuts

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