Documentation ¶
Overview ¶
PulseHA - HA Cluster Daemon Copyright (C) 2017-2020 Andrew Zak <andrew@linux.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- type Config
- func (c *Config) ClusterCheck() bool
- func (c *Config) GetConfig() Config
- func (c *Config) GetGroupIface(hostname string, groupName string) (ifaceName string, err error)
- func (c *Config) GetLocalNode() Node
- func (c *Config) GetLocalNodeUUID() string
- func (c *Config) GetNodeByHostname(hostname string) (uid string, node Node, err error)
- func (c *Config) GetNodeHostnameByAddress(address string) (string, error)
- func (c *Config) Load() error
- func (c *Config) LocalNode() Node
- func (c *Config) NodeCount() int
- func (c *Config) Reload()
- func (c *Config) Save() error
- func (c *Config) SaveDefaultLocalConfig() error
- func (c *Config) UpdateHostname(newHostname string)
- func (c *Config) UpdateValue(key string, value string) error
- func (c *Config) Validate() error
- type Local
- type Node
Constants ¶
This section is empty.
Variables ¶
var (
CONFIG_LOCATION = "/etc/pulseha/config.json"
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Pulse Local `json:"pulseha"` Groups map[string][]string `json:"floating_ip_groups"` Nodes map[string]*Node `json:"nodes"` sync.Mutex }
func (*Config) ClusterCheck ¶
ClusterCheck - Check to see if wea re in a configured cluster or not.
func (*Config) GetGroupIface ¶
* Returns the interface the group is assigned to
func (*Config) GetLocalNode ¶
func (*Config) GetLocalNodeUUID ¶
GetLocalNode - Return the local node UID
func (*Config) GetNodeByHostname ¶
GetNodeByHostname - Get node by hostname
func (*Config) GetNodeHostnameByAddress ¶
* Returns the hostname for a node based of it's IP address
func (*Config) Reload ¶
func (c *Config) Reload()
*
- Reload the config file into memory.
- Note: Need to clear memory value before calling Load()
func (*Config) SaveDefaultLocalConfig ¶
DefaultLocalConfig - Generate a default config to write
func (*Config) UpdateHostname ¶
UpdateHostname - Changes our local node hostname and the hostname in our node section
func (*Config) UpdateValue ¶
UpdateValue - Update a key's value
type Local ¶
type Local struct { HealthCheckInterval int `json:"hcs_interval"` FailOverInterval int `json:"fos_interval"` FailOverLimit int `json:"fo_limit"` LocalNode string `json:"local_node"` ClusterToken string `json:"cluster_token"` LoggingLevel string `json:"logging_level"` AutoFailback bool `json:"auto_failback"` LogToFile bool `json:"log_to_file"` LogFileLocation string `json:"log_file_location"` }