mongo
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/heuritech/daggerverse/mongo@v0.1.0
Entrypoint
Return Type
Mongo !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String ! | "mongo" | The image to use |
version | String ! | "7.0.16" | The version of mongodb to use |
user | Secret | - | The mongodb user |
password | Secret | - | The password of the mongodb user |
hostname | String ! | "mongodb.service" | The mongo hostname to use (only used for mongo uri helper |
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string
func (m *myModule) example(image string, version string, hostname string) *Mongo {
return dag.
Mongo(image, version, hostname)
}
@function
def example(image: str, version: str, hostname: str) -> dag.Mongo:
return (
dag.mongo(image, version, hostname)
)
@func()
example(image: string, version: string, hostname: string): Mongo {
return dag
.mongo(image, version, hostname)
}
Types
Mongo 🔗
user() 🔗
The mongodb user
Return Type
Secret
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string user
func (m *myModule) example(image string, version string, hostname string) *Secret {
return dag.
Mongo(image, version, hostname).
User()
}
@function
def example(image: str, version: str, hostname: str) -> dagger.Secret:
return (
dag.mongo(image, version, hostname)
.user()
)
@func()
example(image: string, version: string, hostname: string): Secret {
return dag
.mongo(image, version, hostname)
.user()
}
password() 🔗
The password of the mongodb user
Return Type
Secret
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string password
func (m *myModule) example(image string, version string, hostname string) *Secret {
return dag.
Mongo(image, version, hostname).
Password()
}
@function
def example(image: str, version: str, hostname: str) -> dagger.Secret:
return (
dag.mongo(image, version, hostname)
.password()
)
@func()
example(image: string, version: string, hostname: string): Secret {
return dag
.mongo(image, version, hostname)
.password()
}
hostname() 🔗
The mongo hostname to use (only used for mongo uri helper
Return Type
String !
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string hostname
func (m *myModule) example(ctx context.Context, image string, version string, hostname string) string {
return dag.
Mongo(image, version, hostname).
Hostname(ctx)
}
@function
async def example(image: str, version: str, hostname: str) -> str:
return await (
dag.mongo(image, version, hostname)
.hostname()
)
@func()
async example(image: string, version: string, hostname: string): Promise<string> {
return dag
.mongo(image, version, hostname)
.hostname()
}
ciTest() 🔗
Only for poc / troubleshot / ci
Return Type
String !
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string ci-test
func (m *myModule) example(ctx context.Context, image string, version string, hostname string) string {
return dag.
Mongo(image, version, hostname).
CiTest(ctx)
}
@function
async def example(image: str, version: str, hostname: str) -> str:
return await (
dag.mongo(image, version, hostname)
.ci_test()
)
@func()
async example(image: string, version: string, hostname: string): Promise<string> {
return dag
.mongo(image, version, hostname)
.ciTest()
}
ctr() 🔗
Get the mongodb container
Return Type
Container !
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string ctr
func (m *myModule) example(image string, version string, hostname string) *Container {
return dag.
Mongo(image, version, hostname).
Ctr()
}
@function
def example(image: str, version: str, hostname: str) -> dagger.Container:
return (
dag.mongo(image, version, hostname)
.ctr()
)
@func()
example(image: string, version: string, hostname: string): Container {
return dag
.mongo(image, version, hostname)
.ctr()
}
service() 🔗
Expose a mongo container as a service
Return Type
Service !
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string service
func (m *myModule) example(image string, version string, hostname string) *Service {
return dag.
Mongo(image, version, hostname).
Service()
}
@function
def example(image: str, version: str, hostname: str) -> dagger.Service:
return (
dag.mongo(image, version, hostname)
.service()
)
@func()
example(image: string, version: string, hostname: string): Service {
return dag
.mongo(image, version, hostname)
.service()
}
uri() 🔗
Return Type
Secret !
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string uri
func (m *myModule) example(image string, version string, hostname string) *Secret {
return dag.
Mongo(image, version, hostname).
Uri()
}
@function
def example(image: str, version: str, hostname: str) -> dagger.Secret:
return (
dag.mongo(image, version, hostname)
.uri()
)
@func()
example(image: string, version: string, hostname: string): Secret {
return dag
.mongo(image, version, hostname)
.uri()
}
withData() 🔗
Allow to mount a snapshot/backup data folder
Return Type
Mongo !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
data | Directory ! | - | A directory. |
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string with-data --data DIR_PATH
func (m *myModule) example(image string, version string, hostname string, data *Directory) *Mongo {
return dag.
Mongo(image, version, hostname).
WithData(data)
}
@function
def example(image: str, version: str, hostname: str, data: dagger.Directory) -> dag.Mongo:
return (
dag.mongo(image, version, hostname)
.with_data(data)
)
@func()
example(image: string, version: string, hostname: string, data: Directory): Mongo {
return dag
.mongo(image, version, hostname)
.withData(data)
}
withHostname() 🔗
Allow to add json data to mongo
Return Type
Mongo !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
hostname | String ! | - | No description provided |
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string with-hostname --hostname string
func (m *myModule) example(image string, version string, hostname string, hostname1 string) *Mongo {
return dag.
Mongo(image, version, hostname).
WithHostname(hostname1)
}
@function
def example(image: str, version: str, hostname: str, hostname1: str) -> dag.Mongo:
return (
dag.mongo(image, version, hostname)
.with_hostname(hostname1)
)
@func()
example(image: string, version: string, hostname: string, hostname1: string): Mongo {
return dag
.mongo(image, version, hostname)
.withHostname(hostname1)
}
withInitData() 🔗
Allow to add json data to mongo
Return Type
Mongo !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
data | Directory ! | - | A directory. |
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string with-init-data --data DIR_PATH
func (m *myModule) example(image string, version string, hostname string, data *Directory) *Mongo {
return dag.
Mongo(image, version, hostname).
WithInitData(data)
}
@function
def example(image: str, version: str, hostname: str, data: dagger.Directory) -> dag.Mongo:
return (
dag.mongo(image, version, hostname)
.with_init_data(data)
)
@func()
example(image: string, version: string, hostname: string, data: Directory): Mongo {
return dag
.mongo(image, version, hostname)
.withInitData(data)
}
withInitScripts() 🔗
Allow to add bash oa js script for the mongo setup
Return Type
Mongo !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
scripts | Directory ! | - | A directory. |
Example
dagger -m github.com/heuritech/daggerverse/mongo@cf921643e257dfcb1fb3b561fcb40bc6a83d5db5 call \
--image string --version string --hostname string with-init-scripts --scripts DIR_PATH
func (m *myModule) example(image string, version string, hostname string, scripts *Directory) *Mongo {
return dag.
Mongo(image, version, hostname).
WithInitScripts(scripts)
}
@function
def example(image: str, version: str, hostname: str, scripts: dagger.Directory) -> dag.Mongo:
return (
dag.mongo(image, version, hostname)
.with_init_scripts(scripts)
)
@func()
example(image: string, version: string, hostname: string, scripts: Directory): Mongo {
return dag
.mongo(image, version, hostname)
.withInitScripts(scripts)
}