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 Item ¶
type Item struct { ID bson.ObjectId `bson:"_id"` Name string `bson:"name"` CreatedAt time.Time `bson:"createdAt"` }
Item is the mongo collection template representing an item.
type Store ¶
type Store interface { Create(i Item) (Item, error) Find(query bson.M, next string, previous string, limit int, sortAscending bool, paginatedField string, collation mgo.Collation) ([]Item, mgocursorpagination.Cursor, error) EnsureIndices() error }
Store allows operations on items.
func NewMongoStore ¶
func NewMongoStore(col *mgo.Collection) Store
NewMongoStore returns a new Store.
Click to show internal directories.
Click to hide internal directories.