Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerService ¶
type DockerService struct { // DockerHostname determines how to access services from code. Empty means the code runs within docker. // when using docker-for-mac, "localhost" would be used when running outside of docker. DockerHostname string Image string Version string PublishedPort string ContainerPort string Env []string Cmd []string Entrypoint []string HealthCheck func(*DockerServiceInstance) error Instance *DockerServiceInstance }
DockerService contains the various settings required to create a new docker service.
func NewMongoService ¶
func NewMongoService(withinDocker bool) *DockerService
NewMongoService returns a mongo service.
func (*DockerService) Start ¶
func (svc *DockerService) Start() (*DockerServiceInstance, error)
Start starts the instance of the service
func (*DockerService) Stop ¶
func (svc *DockerService) Stop()
Stop stops the currently running instance of the service
type DockerServiceInstance ¶
type DockerServiceInstance struct { // ContainerName is the name of the docker container running the service. ContainerName string // DockerHost is the (hostname + port) to use within docker to access the service. // it does not have a scheme DockerHost string // Host is the host (hostname + port) to use outside of docker to access the service, // it does not have a scheme Host string // contains filtered or unexported fields }
DockerServiceInstance represents a running service running in docker.
type InlineItem ¶ added in v0.6.8
type InlineItem struct {
Sample string `bson:"sample"`
}
type Item ¶
type Item struct { ID bson.ObjectId `bson:"_id"` Name string `bson:"name"` Data string `bson:"data"` CreatedAt time.Time `bson:"createdAt"` }
Item is the mongo collection template representing an item.
type MongoStore ¶ added in v0.2.1
type MongoStore interface { Create(context.Context, *MongoItem) (*MongoItem, error) RemoveAll(context.Context) error Find(ctx context.Context, query interface{}, next string, previous string, limit int64, sortAscending bool, paginatedField string, collation *options.Collation, hint interface{}, projection interface{}) ([]*MongoItem, mongocursorpagination.Cursor, error) FindBSONRaw(ctx context.Context, query interface{}, next string, previous string, limit int64, sortAscending bool, paginatedField string, collation *options.Collation, hint interface{}, projection interface{}) ([]bson.Raw, mongocursorpagination.Cursor, error) FindMultiplePaginatedFields(ctx context.Context, query interface{}, next string, previous string, limit int64, sortOrders []int, paginatedFields []string, collation *options.Collation, hint interface{}, projection interface{}) ([]*MongoItem, mongocursorpagination.Cursor, error) }
func NewMongoStore ¶
func NewMongoStore(col *mongoCollectionWrapper) MongoStore
type Store ¶
type Store interface { Create(i *Item) (*Item, error) RemoveAll() error Find(query interface{}, next string, previous string, limit int, sortAscending bool, paginatedField string, collation mgo.Collation) ([]*Item, mongocursorpagination.Cursor, error) FindBSONRaw(query interface{}, next string, previous string, limit int, sortAscending bool, paginatedField string, collation mgo.Collation) ([]bson.Raw, mongocursorpagination.Cursor, error) EnsureIndices() error FindMultiplePaginatedFields(query interface{}, next string, previous string, limit int, sortOrders []int, paginatedFields []string, collation mgo.Collation) ([]*Item, mongocursorpagination.Cursor, error) }
Store allows operations on items.
func NewMgoStore ¶ added in v0.2.0
func NewMgoStore(col *mgo.Collection) Store
NewMgoStore returns a new Store that uses mgo.
Click to show internal directories.
Click to hide internal directories.