types

package
v0.0.0-...-b713958 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Overview

Package types the common types used by CNPG

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTargetTime

func ParseTargetTime(currentLocation *time.Location, targetTime string) (time.Time, error)

ParseTargetTime returns the parsed targetTime which is used for point-in-time-recovery Currently, we support formats of targetTime as follows: YYYY-MM-DD HH24:MI:SS YYYY-MM-DD HH24:MI:SS.FF6TZH YYYY-MM-DD HH24:MI:SS.FF6TZH:TZM YYYY-MM-DDTHH24:MI:SSZ (time.RFC3339) YYYY-MM-DDTHH24:MI:SS±TZH:TZM (time.RFC3339) YYYY-MM-DDTHH24:MI:SSS±TZH:TZM (time.RFC3339Micro) YYYY-MM-DDTHH24:MI:SS (modified time.RFC3339)

Types

type LSN

type LSN string

LSN is a string composed by two hexadecimal numbers, separated by "/"

func Int64ToLSN

func Int64ToLSN(value uint64) LSN

Int64ToLSN convert an int64 LSN to its string representation

func LSNStartFromWALName

func LSNStartFromWALName(filename string, walSegSize uint64) (LSN, error)

LSNStartFromWALName extracts the start LSN from a WAL file name

func (LSN) Components

func (lsn LSN) Components() (uint64, uint64, error)

Components an LSN into its components

func (LSN) Less

func (lsn LSN) Less(other LSN) bool

Less compares two LSNs

func (LSN) Parse

func (lsn LSN) Parse() (uint64, error)

Parse an LSN in its components

func (LSN) WALFileName

func (lsn LSN) WALFileName(tli int, walSegmentSize uint64) (string, error)

WALFileName computes the name of the WAL file hosting the passed LSN

func (LSN) WALFileStart

func (lsn LSN) WALFileStart(walSegmentSize uint64) (LSN, error)

WALFileStart computes the LSN corresponding to the WAL file start

Jump to

Keyboard shortcuts

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