Documentation
¶
Overview ¶
Package mongodb provides a plugin to generate and include a mongodb instance in a Blueprint application.
The package provides a built-in mongodb container that provides the server-side implementation and a go-client for connecting to the client.
The applications must use a backend.NoSQLDatabase (runtime/core/backend) as the interface in the application workflow.
Index ¶
- func Container(spec wiring.WiringSpec, dbName string) string
- type MongoDBContainer
- type MongoDBGoClient
- func (n *MongoDBGoClient) AddInstantiation(builder golang.NamespaceBuilder) error
- func (n *MongoDBGoClient) AddInterfaces(builder golang.ModuleBuilder) error
- func (n *MongoDBGoClient) AddToWorkspace(builder golang.WorkspaceBuilder) error
- func (n *MongoDBGoClient) GetInterface(ctx ir.BuildContext) (service.ServiceInterface, error)
- func (node *MongoDBGoClient) ImplementsGolangNode()
- func (node *MongoDBGoClient) ImplementsGolangService()
- func (m *MongoDBGoClient) Name() string
- func (m *MongoDBGoClient) String() string
- type MongoInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Container ¶
func Container(spec wiring.WiringSpec, dbName string) string
Container generates the IRNodes for a mongodb server docker container that uses the latest mongodb image and the clients needed by the generated application to communicate with the server.
The generated container has the name `dbName`.
Types ¶
type MongoDBContainer ¶
type MongoDBContainer struct { docker.Container docker.ProvidesContainerInstance backend.NoSQLDB InstanceName string BindAddr *address.BindConfig Iface *goparser.ParsedInterface }
Blueprint IR Node that represents the server side docker container
func (*MongoDBContainer) AddContainerInstance ¶
func (node *MongoDBContainer) AddContainerInstance(target docker.ContainerWorkspace) error
Implements docker.ProvidesContainerInstance
func (*MongoDBContainer) GetInterface ¶
func (m *MongoDBContainer) GetInterface(ctx ir.BuildContext) (service.ServiceInterface, error)
Implements service.ServiceNode
type MongoDBGoClient ¶
type MongoDBGoClient struct { golang.Service backend.NoSQLDB InstanceName string Addr *address.DialConfig Spec *workflowspec.Service }
Blueprint IR Node that represents the generated client for the mongodb container
func (*MongoDBGoClient) AddInstantiation ¶
func (n *MongoDBGoClient) AddInstantiation(builder golang.NamespaceBuilder) error
Implements golang.Instantiable
func (*MongoDBGoClient) AddInterfaces ¶
func (n *MongoDBGoClient) AddInterfaces(builder golang.ModuleBuilder) error
Implements golang.ProvidesInterface
func (*MongoDBGoClient) AddToWorkspace ¶
func (n *MongoDBGoClient) AddToWorkspace(builder golang.WorkspaceBuilder) error
Implements golang.ProvidesModule
func (*MongoDBGoClient) GetInterface ¶
func (n *MongoDBGoClient) GetInterface(ctx ir.BuildContext) (service.ServiceInterface, error)
Implements service.ServiceNode
func (*MongoDBGoClient) ImplementsGolangNode ¶
func (node *MongoDBGoClient) ImplementsGolangNode()
func (*MongoDBGoClient) ImplementsGolangService ¶
func (node *MongoDBGoClient) ImplementsGolangService()
type MongoInterface ¶
type MongoInterface struct { service.ServiceInterface Wrapped service.ServiceInterface }
MongoDB interface exposed by the docker container.
func (*MongoInterface) GetMethods ¶
func (m *MongoInterface) GetMethods() []service.Method
func (*MongoInterface) GetName ¶
func (m *MongoInterface) GetName() string