Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoBodyPersister ¶
type MongoBodyPersister struct {
Parser parse.ResponseParser
Repository MongoRepository
}
MongoBodyPersister persists body in file
func NewMongoBodyPersister ¶
func NewMongoBodyPersister(connectionString string, parser parse.ResponseParser) *MongoBodyPersister
NewMongoBodyPersister creates a new MongoBodyPersister
func (MongoBodyPersister) GetResultString ¶
func (mbp MongoBodyPersister) GetResultString(result interface{}) (string, error)
GetResultString gets the result string rom interface
func (MongoBodyPersister) LoadBody ¶
func (mbp MongoBodyPersister) LoadBody(req *definition.Request, res *definition.Response)
LoadBody loads the response body from the corresponding mongo collection
func (MongoBodyPersister) Persist ¶
func (mbp MongoBodyPersister) Persist(per *definition.Persist, req *definition.Request, res *definition.Response) bool
Persist the body of the response to mongo if needed
type MongoRepository ¶
MongoRepository saves and loads items from mongo
func NewMongoRepository ¶
func NewMongoRepository(connectionString string) *MongoRepository
NewMongoRepository creates a new MongoRepository
func (MongoRepository) DeleteItem ¶
func (mr MongoRepository) DeleteItem(collectionName string, id string) error
DeleteItem deletes an item from a collection
func (MongoRepository) GetItem ¶
func (mr MongoRepository) GetItem(collectionName string, id string) (string, error)
GetItem gets the result string rom interface
func (MongoRepository) UpsertItem ¶
func (mr MongoRepository) UpsertItem(collectionName string, id string, body string) error
UpsertItem inserts or updates item with a given id in a given collection
Click to show internal directories.
Click to hide internal directories.