common

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorePrefix = "stolon/cluster"

	SentinelLeaderKey = "sentinel-leader"
)
View Source
const PgUnixSocketDirectories = "/tmp"

Variables

Roles enumerates all possible Role values

Functions

func IsStolonName

func IsStolonName(name string) bool

func NameFromStolonName

func NameFromStolonName(stolonName string) string

func NewTLSConfig

func NewTLSConfig(certFile, keyFile, caFile string, insecureSkipVerify bool) (*tls.Config, error)

func StolonName

func StolonName(name string) string

func UID

func UID() string

func UUID

func UUID() string

func WriteFileAtomic

func WriteFileAtomic(filename string, perm os.FileMode, data []byte) error

WriteFileAtomic atomically writes a file

func WriteFileAtomicFunc

func WriteFileAtomicFunc(filename string, perm os.FileMode, writeFunc func(f io.Writer) error) error

WriteFileAtomicFunc atomically writes a file, it achieves this by creating a temporary file and then moving it. writeFunc is the func that will write data to the file. This function is taken from

https://github.com/youtube/vitess/blob/master/go/ioutil2/ioutil.go

Copyright 2012, Google Inc. BSD-license, see licenses/LICENSE-BSD-3-Clause

Types

type Parameters

type Parameters map[string]string

func (Parameters) Diff added in v0.14.0

func (s Parameters) Diff(newParams Parameters) []string

Diff returns the list of pgParameters changed(newly added, existing deleted and value changed)

func (Parameters) Equals

func (s Parameters) Equals(is Parameters) bool

type Role

type Role string
const (
	RoleUndefined Role = "undefined"
	RoleMaster    Role = "master"
	RoleStandby   Role = "standby"
)

Jump to

Keyboard shortcuts

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