mongodb

package
v0.0.0-...-f54e1bb Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: BSD-3-Clause Imports: 14 Imported by: 7

README

mongodb

import "github.com/blueprint-uservices/blueprint/plugins/mongodb"

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

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`.

type MongoDBContainer

Blueprint IR Node that represents the server side docker container

type MongoDBContainer struct {
    docker.Container
    docker.ProvidesContainerInstance
    backend.NoSQLDB

    InstanceName string
    BindAddr     *address.BindConfig
    Iface        *goparser.ParsedInterface
}

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

func (*MongoDBContainer) Name
func (m *MongoDBContainer) Name() string

Implements ir.IRNode

func (*MongoDBContainer) String
func (m *MongoDBContainer) String() string

Implements ir.IRNode

type MongoDBGoClient

Blueprint IR Node that represents the generated client for the mongodb container

type MongoDBGoClient struct {
    golang.Service
    backend.NoSQLDB
    InstanceName string
    Addr         *address.DialConfig

    Spec *workflowspec.Service
}

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()

func (*MongoDBGoClient) Name
func (m *MongoDBGoClient) Name() string

Implements ir.IRNode

func (*MongoDBGoClient) String
func (m *MongoDBGoClient) String() string

Implements ir.IRNode

type MongoInterface

MongoDB interface exposed by the docker container.

type MongoInterface struct {
    service.ServiceInterface
    Wrapped service.ServiceInterface
}

func (*MongoInterface) GetMethods
func (m *MongoInterface) GetMethods() []service.Method

func (*MongoInterface) GetName
func (m *MongoInterface) GetName() string

Generated by gomarkdoc

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

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

Implements service.ServiceNode

func (*MongoDBContainer) Name

func (m *MongoDBContainer) Name() string

Implements ir.IRNode

func (*MongoDBContainer) String

func (m *MongoDBContainer) String() string

Implements ir.IRNode

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()

func (*MongoDBGoClient) Name

func (m *MongoDBGoClient) Name() string

Implements ir.IRNode

func (*MongoDBGoClient) String

func (m *MongoDBGoClient) String() string

Implements ir.IRNode

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

Jump to

Keyboard shortcuts

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