Documentation ¶
Index ¶
- type Repository
- func (r *Repository) Exists(ctx context.Context, id uuid.UUID) (bool, error)
- func (r *Repository) GetAll(ctx context.Context) ([]*assetDomain.Asset, error)
- func (r *Repository) GetByID(ctx context.Context, id uuid.UUID) (*assetDomain.Asset, error)
- func (r *Repository) Save(ctx context.Context, asset *assetDomain.Asset) error
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) 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.
Click to show internal directories.
Click to hide internal directories.