Documentation
¶
Index ¶
- Variables
- type Adapter
- type AdapterResolver
- type CleanupWarning
- type Connector
- type Definition
- type DefinitionRegistrar
- type DefinitionRepository
- type ID
- type ImportRequest
- type ImportResult
- type Importer
- type ImporterDependencies
- type Kind
- type Manager
- type ParsedConnection
- type RegistrationResult
- type ResolvedDefinition
- type SecretResolver
- type SecretWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidConnectionString = errors.New("connection: invalid connection string") )
View Source
var ( ErrDatabaseNotFound = errors.New("connection: database not found") ErrDefinitionNotFound = errors.New("connection: definition not found") )
View Source
var (
ErrAdapterNotFound = errors.New("connection: adapter not found")
)
View Source
var ErrInvalidDefinition = errors.New("connection: invalid definition")
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
Kind() Kind
ParseConnectionString([]byte) (ParsedConnection, error)
}
type AdapterResolver ¶
type CleanupWarning ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
type Definition ¶
type Definition struct {
ID ID `json:"id"`
Kind Kind `json:"kind"`
Settings map[string]string `json:"settings"`
SecretRefs map[string]secret.Reference `json:"secretRefs"`
}
func (Definition) Clone ¶
func (d Definition) Clone() Definition
func (Definition) Validate ¶
func (d Definition) Validate() error
type DefinitionRegistrar ¶
type DefinitionRegistrar interface {
Register(Definition) (RegistrationResult, error)
}
type DefinitionRepository ¶
type DefinitionRepository interface {
Lookup(context.Context, ID) (Definition, error)
Upsert(context.Context, Definition) error
}
type ImportRequest ¶
type ImportResult ¶
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
func NewImporter ¶
func NewImporter(dependencies ImporterDependencies) (*Importer, error)
func (*Importer) Import ¶
func (i *Importer) Import(ctx context.Context, request ImportRequest) (ImportResult, error)
type ImporterDependencies ¶
type ImporterDependencies struct {
Adapters AdapterResolver
Secrets SecretWriter
Definitions DefinitionRepository
Registrar DefinitionRegistrar
Warn CleanupWarning
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(resolver SecretResolver, definitions []Definition) (*Manager, error)
func (*Manager) List ¶
func (m *Manager) List() []Definition
func (*Manager) Register ¶
func (m *Manager) Register(definition Definition) (RegistrationResult, error)
type ParsedConnection ¶
func (ParsedConnection) Clone ¶
func (p ParsedConnection) Clone() ParsedConnection
type RegistrationResult ¶
type RegistrationResult struct {
Previous Definition
Replaced bool
}
type ResolvedDefinition ¶
type ResolvedDefinition struct {
ID ID
Kind Kind
Settings map[string]string
Secrets map[string][]byte
}
func (ResolvedDefinition) Clone ¶
func (d ResolvedDefinition) Clone() ResolvedDefinition
type SecretResolver ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mysql implements the MySQL relational connector.
|
Package mysql implements the MySQL relational connector. |
|
Package postgres parses PostgreSQL connection imports and owns their cached runtime pools.
|
Package postgres parses PostgreSQL connection imports and owns their cached runtime pools. |
|
Package sqlite implements the SQLite connector edge.
|
Package sqlite implements the SQLite connector edge. |
Click to show internal directories.
Click to hide internal directories.