slot

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorSlotIsNotExists = goerrors.New("slot is not exists")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                        string        `json:"name" yaml:"name"`
	SlotActivityCheckerInterval time.Duration `json:"slotActivityCheckerInterval" yaml:"slotActivityCheckerInterval"`
	CreateIfNotExists           bool          `json:"createIfNotExists" yaml:"createIfNotExists"`
}

func (Config) Validate

func (c Config) Validate() error

type Info

type Info struct {
	Name              string `json:"name"`
	Type              Type   `json:"type"`
	WalStatus         string `json:"walStatus"`
	RestartLSN        pq.LSN `json:"restartLSN"`
	ConfirmedFlushLSN pq.LSN `json:"confirmedFlushLSN"`
	CurrentLSN        pq.LSN `json:"currentLSN"`
	RetainedWALSize   pq.LSN `json:"retainedWALSize"`
	Lag               pq.LSN `json:"lag"`
	ActivePID         int32  `json:"activePID"`
	Active            bool   `json:"active"`
}

type Slot

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

func NewSlot

func NewSlot(ctx context.Context, dsn string, cfg Config, m metric.Metric) (*Slot, error)

func (*Slot) Close

func (s *Slot) Close()

func (*Slot) Create

func (s *Slot) Create(ctx context.Context) (*Info, error)

func (*Slot) Info

func (s *Slot) Info(ctx context.Context) (*Info, error)

func (*Slot) Metrics

func (s *Slot) Metrics(ctx context.Context)

type Type

type Type string
const (
	Logical  Type = "logical"
	Physical Type = "physical"
)

Jump to

Keyboard shortcuts

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