Documentation
¶
Overview ¶
pkg/providers/mongodb/provider.go
Real MongoDB provider for Orkestra.
Handles the "mongodb" block in Katalog declarations. Uses the official MongoDB Go driver — no mocks, no stubs.
Supported resource kinds:
database — MongoDB database (create, drop) user — Database user (create, update roles, delete) collection — Collection with optional schema validation (create, drop)
Installation:
go get go.mongodb.org/mongo-driver/mongo go get go.mongodb.org/mongo-driver/mongo/options
Registration:
client, _ := mongo.Connect(ctx, options.Client().ApplyURI(uri)) registry.Register(mongoprovider.New(client))
Katalog:
providers:
mongodb:
- database:
name: "{{ .metadata.name }}"
- user:
name: "{{ .spec.dbUser }}"
database: "{{ .metadata.name }}"
roles: "readWrite"
credentials:
secretName: "{{ .metadata.name }}-mongo-creds" # MONGO_PASSWORD
- collection:
name: events
database: "{{ .metadata.name }}"
when:
- field: spec.enableEvents
equals: "true"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements orktypes.Provider for the "mongodb" block.
func NewFromURI ¶
NewFromURI connects to MongoDB using the given URI and returns a Provider.
Click to show internal directories.
Click to hide internal directories.