resources

package
v0.0.0-...-feb181f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResourceNotFound      = errors.New("resource not found")
	ErrDatabaseError         = errors.New("db error while querying for resource")
	ErrResourceAlreadyExists = errors.New("resource already exists")
)

Functions

This section is empty.

Types

type Usecase

type Usecase struct {
	Authz     authzapi.Authorizer
	Eventer   eventingapi.Manager
	Namespace string

	Server             server.Server
	DisablePersistence bool
	// contains filtered or unexported fields
}

func New

func New(repository ResourceRepository, authz authzapi.Authorizer, eventer eventingapi.Manager, namespace string, logger log.Logger, disablePersistence bool) *Usecase

func (*Usecase) Create

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

func (*Usecase) Delete

func (uc *Usecase) Delete(ctx context.Context, id model.ReporterResourceId) error

Delete deletes a model from the database, removes related tuples from the relations-api, and issues a delete event.

func (*Usecase) Update

Update updates a model in the database, updates related tuples in the relations-api, and issues an update event.

Jump to

Keyboard shortcuts

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