mediators

package
v0.0.0-...-b11ff8e Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

RemoveCache removes data from the cache

func (*CacheServiceMediator) RemoveKeyLock

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

Jump to

Keyboard shortcuts

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