model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canary

type Canary struct {
	ID          int64     `json:"ID"`
	LastUpdated time.Time `json:"lastUpdated"`
	DiffMS      float64   `json:"diffMS"`
}

type Foo

type Foo struct {
	ID          string    `json:"id"`
	Created     time.Time `json:"created"`
	LastUpdated time.Time `json:"lastUpdated"`
}

type PgConfig

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

func LoadPostgresConfig

func LoadPostgresConfig() (*PgConfig, error)

type PoolStats

type PoolStats struct {
	AcquireCount    int64
	AcquireDuration time.Duration
	AcquiredConns   int32
	IdleConns       int32
	TotalConns      int32
	MaxConns        int32
}

type ReplicaStatus

type ReplicaStatus struct {
	ServerID    string    `json:"serverID"`
	SessionID   string    `json:"sessionID"`
	LastUpdated time.Time `json:"lastUpdated"`
}

type Store

type Store struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func NewStore

func NewStore(logger *zap.Logger, pgc *PgConfig) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) GetCanary

func (s *Store) GetCanary() (*Canary, error)

func (*Store) GetConnectionPoolStats

func (s *Store) GetConnectionPoolStats(ro bool) *PoolStats

func (*Store) GetMostRecentFoo

func (s *Store) GetMostRecentFoo() (*Foo, error)

func (*Store) GetReplicaStatus

func (s *Store) GetReplicaStatus(ro bool) ([]ReplicaStatus, error)

func (*Store) GetReplicationCanary

func (s *Store) GetReplicationCanary() (*Canary, error)

func (*Store) InsertFoo

func (s *Store) InsertFoo() (int64, error)

func (*Store) UpdateCanary

func (s *Store) UpdateCanary() (int64, error)

func (*Store) UpdateReplicationCanary

func (s *Store) UpdateReplicationCanary() (*Canary, error)

Jump to

Keyboard shortcuts

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