keepalived

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

PkgGoDev GoReportCard GitHub Actions CI Status GitHub Actions CodeQL Status Coverage Status Codebeat badge

InstallationBuild StatusLicense


keepalived is a very simple Go package for reading virtual IP info from keepalived configuration file.

Installation

Make sure you have a working Go 1.15+ workspace (instructions), then:

go get -d pkg.re/essentialkaos/go-keepalived.v1

For update to the latest stable release, do:

go get -d -u pkg.re/essentialkaos/go-keepalived.v1

Build Status

Branch Status
master CI
develop CI

License

Apache License, Version 2.0

Documentation

Overview

Package keepalived is a simple Go package for reading virtual IP info from keepalived config

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVirtualIP

func GetVirtualIP(config string) (string, error)

GetVirtualIP returns virtual IP from keepalived configuration file

Example
ip, err := GetVirtualIP("/etc/keepalived/keepalived.conf")

fmt.Printf("Virtual IP: %s\n", ip)
fmt.Printf("Error: %v\n", err)
Output:

func IsMaster

func IsMaster(virtualIP string) (bool, error)

IsMaster returns true if given virtual IP is used on this server

Example
isMaster, err := IsMaster("191.12.11.18")

fmt.Printf("Is Master: %t\n", isMaster)
fmt.Printf("Error: %v\n", err)
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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