Documentation ¶
Index ¶
- type CacheServiceMediator
- func (c *CacheServiceMediator) AddCache(key string, expiration time.Duration, data any) (responses.AddCacheResponse, error)
- func (c *CacheServiceMediator) CheckIfCacheExists(key string) (responses.CacheExistsResponse, error)
- func (c *CacheServiceMediator) Init(nats *mq.Nats, version consts.VersionConst, prefix string) *CacheServiceMediator
- func (c *CacheServiceMediator) RemoveCache(key string) (responses.RemoveCacheResponse, error)
- func (c *CacheServiceMediator) RemoveKeyLock(key string) (responses.RemoveKeyLockResponse, error)
- func (c *CacheServiceMediator) RequestKeyLock(key string, expiration time.Duration) (responses.RequestKeyLockResponse, error)
- func (c *CacheServiceMediator) RetrieveCache(key string, output any) error
- type DataServiceMediator
- func (d *DataServiceMediator) AddDocument(collection string, data any) (responses.AddDocumentResponse, error)
- func (d *DataServiceMediator) FilterDocuments(collection string, filters bson.D) (responses.FilterDocumentsResponse, error)
- func (d *DataServiceMediator) Init(nats *mq.Nats, version consts.VersionConst, prefix string) *DataServiceMediator
- func (d *DataServiceMediator) ListDocuments(collection string) (responses.ListDocumentsResponse, error)
- func (d *DataServiceMediator) RemoveDocument(collection string, documentId string) (responses.RemoveDocumentResponse, error)
- func (d *DataServiceMediator) ReplaceDocument(collection string, documentId string, data any) (responses.ReplaceDocumentResponse, error)
- func (d *DataServiceMediator) RetrieveDocument(collection string, documentId string, output any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheServiceMediator ¶
type CacheServiceMediator struct {
// contains filtered or unexported fields
}
func (*CacheServiceMediator) AddCache ¶
func (c *CacheServiceMediator) AddCache(key string, expiration time.Duration, data any) (responses.AddCacheResponse, error)
AddCache adds data to a cache based on
func (*CacheServiceMediator) CheckIfCacheExists ¶
func (c *CacheServiceMediator) CheckIfCacheExists(key string) (responses.CacheExistsResponse, error)
CheckIfCacheExists checks if a key exists within the cache
func (*CacheServiceMediator) Init ¶
func (c *CacheServiceMediator) Init(nats *mq.Nats, version consts.VersionConst, prefix string) *CacheServiceMediator
Init creates a new cache mediator for interacting with the cache service
func (*CacheServiceMediator) RemoveCache ¶
func (c *CacheServiceMediator) RemoveCache(key string) (responses.RemoveCacheResponse, error)
RemoveCache removes data from the cache
func (*CacheServiceMediator) RemoveKeyLock ¶
func (c *CacheServiceMediator) RemoveKeyLock(key string) (responses.RemoveKeyLockResponse, error)
RemoveKeyLock removes an existing key lock
func (*CacheServiceMediator) RequestKeyLock ¶
func (c *CacheServiceMediator) RequestKeyLock(key string, expiration time.Duration) (responses.RequestKeyLockResponse, error)
RequestKeyLock attempts to request a key lock on an id
func (*CacheServiceMediator) RetrieveCache ¶
func (c *CacheServiceMediator) RetrieveCache(key string, output any) error
RetrieveCache attempts to retrieve and decode data from the cache
type DataServiceMediator ¶
type DataServiceMediator struct {
// contains filtered or unexported fields
}
func (*DataServiceMediator) AddDocument ¶
func (d *DataServiceMediator) AddDocument(collection string, data any) (responses.AddDocumentResponse, error)
AddDocument attempts to store a document in the data service
func (*DataServiceMediator) FilterDocuments ¶
func (d *DataServiceMediator) FilterDocuments(collection string, filters bson.D) (responses.FilterDocumentsResponse, error)
FilterDocuments attempts to search documents in the data service
func (*DataServiceMediator) Init ¶
func (d *DataServiceMediator) Init(nats *mq.Nats, version consts.VersionConst, prefix string) *DataServiceMediator
Init creates a new data mediator for interacting with the data service
func (*DataServiceMediator) ListDocuments ¶
func (d *DataServiceMediator) ListDocuments(collection string) (responses.ListDocumentsResponse, error)
ListDocuments retrieves all documents in the collection
func (*DataServiceMediator) RemoveDocument ¶
func (d *DataServiceMediator) RemoveDocument(collection string, documentId string) (responses.RemoveDocumentResponse, error)
RemoveDocument attempts to remove a document stored in the data service
func (*DataServiceMediator) ReplaceDocument ¶
func (d *DataServiceMediator) ReplaceDocument(collection string, documentId string, data any) (responses.ReplaceDocumentResponse, error)
ReplaceDocument attempts to replace a document
func (*DataServiceMediator) RetrieveDocument ¶
func (d *DataServiceMediator) RetrieveDocument(collection string, documentId string, output any) error
RetrieveDocument attempts to retrieve a document from the data store