postgresql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

PostgreSQL Service Plugin

Documentation has moved!

For complete PostgreSQL plugin documentation, please visit: docs/services/postgresql/

Quick Example

import (
    "context"
    "github.com/oswaldo-montano/gtool/internal/infra/docker"
    "github.com/oswaldo-montano/gtool/internal/plugin/services/postgresql"
)

// Create plugin
dockerClient, _ := docker.NewClient(logger)
plugin := postgresql.NewPostgreSQLPlugin(dockerClient, logger)

// Launch PostgreSQL
ctx := context.Background()
config := map[string]interface{}{
    "port":         "5432",
    "scripts-path": "./test/component/mocks-data/postgresql",
}
plugin.Launch(ctx, config)
defer plugin.Stop(ctx)

Configuration

third-party:
  mocks:
    - postgresql
  mock-config:
    postgresql:
      port: 5432
      scripts-path: ./test/component/mocks-data/postgresql

For more details, see the full documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgreSQLConfig

type PostgreSQLConfig struct {
	Image         string `json:"image"`
	Port          string `json:"port"`
	User          string `json:"user"`
	Password      string `json:"password"`
	Database      string `json:"database"`
	ScriptsPath   string `json:"scripts-path"`
	ContainerName string `json:"container-name"`
}

PostgreSQLConfig holds PostgreSQL-specific configuration

type PostgreSQLPlugin

type PostgreSQLPlugin struct {
	// contains filtered or unexported fields
}

PostgreSQLPlugin implements the ServicePlugin interface for PostgreSQL

func NewPostgreSQLPlugin

func NewPostgreSQLPlugin(dockerClient *docker.Client, logger *zap.Logger) *PostgreSQLPlugin

NewPostgreSQLPlugin creates a new PostgreSQL service plugin

func (*PostgreSQLPlugin) GetConnectionInfo

func (p *PostgreSQLPlugin) GetConnectionInfo() (*plugin.ConnectionInfo, error)

GetConnectionInfo returns connection details

func (*PostgreSQLPlugin) GetLogs

func (p *PostgreSQLPlugin) GetLogs(ctx context.Context, opts *plugin.LogOptions) ([]string, error)

GetLogs retrieves service logs

func (*PostgreSQLPlugin) IsReady

func (p *PostgreSQLPlugin) IsReady(ctx context.Context) (bool, error)

IsReady checks if the PostgreSQL service is ready to accept connections

func (*PostgreSQLPlugin) Launch

func (p *PostgreSQLPlugin) Launch(ctx context.Context, config map[string]interface{}) error

Launch starts the PostgreSQL service with given configuration

func (*PostgreSQLPlugin) Name

func (p *PostgreSQLPlugin) Name() string

Name returns the service identifier

func (*PostgreSQLPlugin) Stop

func (p *PostgreSQLPlugin) Stop(ctx context.Context) error

Stop terminates the PostgreSQL service

Jump to

Keyboard shortcuts

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