assetsmongo

package
v0.0.0-...-44f2542 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

Repository represents the MongoDB repository for assets.

func NewRepository

func NewRepository(eventStore xmongo.EventStore) *Repository

NewRepository creates a new MongoDB repository for assets.

func (*Repository) Exists

func (r *Repository) Exists(ctx context.Context, id uuid.UUID) (bool, error)

Exists checks if an asset with the given ID exists in the event store.

func (*Repository) GetAll

func (r *Repository) GetAll(ctx context.Context) ([]*assetDomain.Asset, error)

GetAll retrieves all assets from the event store.

func (*Repository) GetByID

func (r *Repository) GetByID(ctx context.Context, id uuid.UUID) (*assetDomain.Asset, error)

GetByID retrieves an asset by its ID from the event store.

func (*Repository) Save

func (r *Repository) Save(ctx context.Context, asset *assetDomain.Asset) error

Save saves the asset changes into the event store.

Jump to

Keyboard shortcuts

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