Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct { ID primitive.ObjectID EntityID string EntityName string Data JSON CreatedAt time.Time UpdatedAt time.Time }
Metadata is a struct designed to encapsulate payload data.
type MetadataMongoDBModel ¶
type MetadataMongoDBModel struct { ID primitive.ObjectID `bson:"_id,omitempty"` EntityID string `bson:"entity_id"` EntityName string `bson:"entity_name"` Data JSON `bson:"metadata"` CreatedAt time.Time `bson:"created_at"` UpdatedAt time.Time `bson:"updated_at"` }
MetadataMongoDBModel represents the metadata into mongodb context
func (*MetadataMongoDBModel) FromEntity ¶
func (mmm *MetadataMongoDBModel) FromEntity(md *Metadata) error
FromEntity converts an entity.Metadata to MetadataMongoDBModel
func (*MetadataMongoDBModel) ToEntity ¶
func (mmm *MetadataMongoDBModel) ToEntity() *Metadata
ToEntity converts an MetadataMongoDBModel to entity.Metadata
type Repository ¶
type Repository interface { Create(ctx context.Context, collection string, metadata *Metadata) error FindList(ctx context.Context, collection string, filter common.QueryHeader) ([]*Metadata, error) FindByEntity(ctx context.Context, collection, id string) (*Metadata, error) Update(ctx context.Context, collection, id string, metadata map[string]any) error Delete(ctx context.Context, collection, id string) error }
Repository provides an interface for operations related on mongodb a metadata entities.
Click to show internal directories.
Click to hide internal directories.