Documentation ¶
Index ¶
- type EventType
- type FirestoreConnection
- func (f *FirestoreConnection) FirestoreAdd(docId string, s interface{}) error
- func (f *FirestoreConnection) FirestoreDelete(docId string, s interface{}) error
- func (f *FirestoreConnection) FirestoreFind(queryParams map[string][]string, value interface{}) (interface{}, error)
- func (f *FirestoreConnection) FirestoreFindById(key string, values interface{}) (interface{}, error)
- func (f *FirestoreConnection) FirestoreUpdate(docId string, s interface{}) error
- func (f *FirestoreConnection) SetCollection(collectionStr string)
- type PersistenceLayer
- func (p *PersistenceLayer) AddDocument(key string, values interface{}) error
- func (p *PersistenceLayer) CloudEventDomain() string
- func (p *PersistenceLayer) DeleteDocument(key string, values interface{}) error
- func (p *PersistenceLayer) Find(queryParams map[string][]string, value interface{}) (valuesArray interface{}, err error)
- func (p *PersistenceLayer) FindById(key string, values interface{}) (interface{}, error)
- func (p *PersistenceLayer) GetConnection() (err error)
- func (p *PersistenceLayer) Initialise() error
- func (p *PersistenceLayer) Publish(eventType EventType, subject string, values interface{}) error
- func (p *PersistenceLayer) SetDocType(docType documentType)
- func (p *PersistenceLayer) UpdateDocument(key string, values interface{}) error
- type PubsubConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirestoreConnection ¶
type FirestoreConnection struct {
// contains filtered or unexported fields
}
func GetFirestore ¶
func GetFirestore(gcpProjectID string) (*FirestoreConnection, error)
GetFirestore -
func GetFirestoreConnection ¶
func GetFirestoreConnection(gcpProjectID string, collectionStr string) (*FirestoreConnection, error)
GetFirestoreConnection - deprecated
func (*FirestoreConnection) FirestoreAdd ¶
func (f *FirestoreConnection) FirestoreAdd(docId string, s interface{}) error
FirestoreAdd -
func (*FirestoreConnection) FirestoreDelete ¶
func (f *FirestoreConnection) FirestoreDelete(docId string, s interface{}) error
FirestoreDelete -
func (*FirestoreConnection) FirestoreFind ¶
func (f *FirestoreConnection) FirestoreFind(queryParams map[string][]string, value interface{}) (interface{}, error)
FirestoreFind - queryParams - map["db.field"][]values value = pass in a struct, e.g. Source{} loop through the map building a query like db.field1 in ("value[0]", "value[1]", .. "value[n]") && db.field2 in ("value[0]", "value[1]", .. "value[n]") Limitation: create a separate query for each OR condition and merge the query results in your app.
func (*FirestoreConnection) FirestoreFindById ¶
func (f *FirestoreConnection) FirestoreFindById(key string, values interface{}) (interface{}, error)
FirestoreFindById -
func (*FirestoreConnection) FirestoreUpdate ¶
func (f *FirestoreConnection) FirestoreUpdate(docId string, s interface{}) error
FirestoreUpdate -
func (*FirestoreConnection) SetCollection ¶
func (f *FirestoreConnection) SetCollection(collectionStr string)
type PersistenceLayer ¶
type PersistenceLayer struct {
// contains filtered or unexported fields
}
PersistenceLayer implements hexagonal architecture to hide the PaaS functionality from the APIs
func GetPersistenceLayer ¶
func GetPersistenceLayer(docType documentType) (*PersistenceLayer, error)
GetPersistenceLayer - deprecated
func LocalEntry ¶
func LocalEntry(docType documentType) (*PersistenceLayer, error)
func (*PersistenceLayer) AddDocument ¶
func (p *PersistenceLayer) AddDocument(key string, values interface{}) error
AddDocument -
func (*PersistenceLayer) CloudEventDomain ¶
func (p *PersistenceLayer) CloudEventDomain() string
func (*PersistenceLayer) DeleteDocument ¶
func (p *PersistenceLayer) DeleteDocument(key string, values interface{}) error
DeleteDocument -
func (*PersistenceLayer) Find ¶
func (p *PersistenceLayer) Find(queryParams map[string][]string, value interface{}) (valuesArray interface{}, err error)
Find -
func (*PersistenceLayer) FindById ¶
func (p *PersistenceLayer) FindById(key string, values interface{}) (interface{}, error)
FindById -
func (*PersistenceLayer) GetConnection ¶
func (p *PersistenceLayer) GetConnection() (err error)
GetConnection -
func (*PersistenceLayer) Publish ¶
func (p *PersistenceLayer) Publish(eventType EventType, subject string, values interface{}) error
Publish -
func (*PersistenceLayer) SetDocType ¶
func (p *PersistenceLayer) SetDocType(docType documentType)
SetDocType - Note that this only impacts Firestore
func (*PersistenceLayer) UpdateDocument ¶
func (p *PersistenceLayer) UpdateDocument(key string, values interface{}) error
UpdateDocument -
type PubsubConnection ¶
type PubsubConnection struct {
// contains filtered or unexported fields
}
func GetPubsubConnection ¶
func GetPubsubConnection(gcpProjectID string) (*PubsubConnection, error)