mongo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: MIT Imports: 10 Imported by: 0

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

Persist the body of the response to mongo if needed

type MongoRepository

type MongoRepository struct {
	ConnectionInfo mgo.DialInfo
}

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

Jump to

Keyboard shortcuts

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