Documentation
¶
Index ¶
- func ValidateConfig(cfg config.Config, requireBase bool) error
- func ValidateTTL(ttl *time.Duration) error
- type BaseInfo
- type BaseResult
- type BranchInfo
- type DSNResult
- type DoctorResult
- type DrainResult
- type DropResult
- type EnsureOptions
- type EnsureResult
- type FillResult
- type GCResult
- type ListResult
- type PoolCounts
- type PoolDatabase
- type PoolStatus
- type Service
- func (svc Service) BaseAdopt(ctx context.Context, name string, terminate bool) (BaseResult, error)
- func (svc Service) BaseClose(ctx context.Context, terminate bool) (BaseResult, error)
- func (svc Service) BaseCreate(ctx context.Context, name, from string, terminate bool) (BaseResult, error)
- func (svc Service) BaseOpen(ctx context.Context) (BaseResult, error)
- func (svc Service) DSN(ctx context.Context, branch string) (DSNResult, error)
- func (svc Service) Doctor(ctx context.Context) (DoctorResult, error)
- func (svc Service) Drop(ctx context.Context, branch string, force bool) (DropResult, error)
- func (svc Service) Ensure(ctx context.Context, branch string, opts EnsureOptions) (EnsureResult, error)
- func (svc Service) GC(ctx context.Context, dryRun bool) (GCResult, error)
- func (svc Service) List(ctx context.Context) (ListResult, error)
- func (svc Service) PoolDrain(ctx context.Context) (DrainResult, error)
- func (svc Service) PoolFill(ctx context.Context, size int) (FillResult, error)
- func (svc Service) PoolStatus(ctx context.Context) (PoolStatus, error)
- func (svc Service) Reset(ctx context.Context, branch string, force bool, opts EnsureOptions) (EnsureResult, error)
- type Skipped
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateTTL ¶
Types ¶
type BaseResult ¶
type BranchInfo ¶
type DoctorResult ¶
type DrainResult ¶
type DropResult ¶
type EnsureOptions ¶
type EnsureResult ¶
type EnsureResult struct {
DSNResult
Created bool `json:"created"`
Source string `json:"source"`
Stale bool `json:"stale"`
Gen int `json:"gen"`
BaseGen int `json:"base_gen"`
Strategy string `json:"strategy"`
ElapsedMS int64 `json:"elapsed_ms"`
ExpiresAt time.Time `json:"expires_at,omitzero"`
Warnings []string `json:"warnings,omitempty"`
RefillRequested bool `json:"refill_requested"`
RefillNeeded bool `json:"-"`
Reset bool `json:"reset,omitempty"`
}
type FillResult ¶
type FillResult struct {
Created int `json:"created"`
Discarded int `json:"discarded"`
PoolSize int `json:"pool_size"`
Target int `json:"target"`
Strategy string `json:"strategy"`
ElapsedMS int64 `json:"elapsed_ms"`
Skipped string `json:"skipped,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type ListResult ¶
type ListResult struct {
Base BaseInfo `json:"base"`
Branches []BranchInfo `json:"branches"`
Pool []PoolDatabase `json:"pool"`
Tmp []PoolDatabase `json:"tmp"`
Unmanaged []string `json:"unmanaged"`
}
type PoolCounts ¶
type PoolDatabase ¶
type PoolStatus ¶
type PoolStatus struct {
PoolCounts
Databases []PoolDatabase `json:"databases"`
}
type Service ¶
type Service struct {
Config config.Config
Connect func(context.Context, string) (*pgx.Conn, error)
}
func (Service) BaseCreate ¶
func (Service) Ensure ¶
func (svc Service) Ensure(ctx context.Context, branch string, opts EnsureOptions) (EnsureResult, error)
func (Service) PoolStatus ¶
func (svc Service) PoolStatus(ctx context.Context) (PoolStatus, error)
func (Service) Reset ¶
func (svc Service) Reset(ctx context.Context, branch string, force bool, opts EnsureOptions) (EnsureResult, error)
Click to show internal directories.
Click to hide internal directories.