zeplic: github.com/nfrance-conseil/zeplic/config Index | Files

package config

import "github.com/nfrance-conseil/zeplic/config"

Package config contains: local.go - server.go - signal.go - syslog.go - version.go

Local reads and extracts the information JSON configuration file

Package config contains: local.go - server.go - signal.go - syslog.go - version.go

Server keeps the struct of server json file and extracts all data

Package config contains: local.go - server.go - signal.go - syslog.go - version.go

Signal gets the process ID of zeplic and sends to the process SIGTERM/SIGHUP

Package config contains: local.go - server.go - signal.go - syslog.go - version.go

Syslog establishes a new connection with the syslog daemon and writes in the log file, all messages return by the functions

Package config contains: local.go - server.go - signal.go - syslog.go - version.go

Version gets the commit version and date of last zeplic build

Index

Package Files

local.go server.go signal.go syslog.go version.go

Variables

var (
    // LogService returns the writer of syslog
    LogService *syslog.Writer
    // SyslogFilePath returns the path of syslog config file
    SyslogFilePath string
    // Facility applies the priority
    Facility syslog.Priority
)
var (
    // BuildTime gets date of last build
    BuildTime string
    // Commit gets the last commit
    Commit string
    // Version show the version of zeplic
    Version string
)
var LocalFilePath string

LocalFilePath returns the path of JSON config file

var PidFilePath string

PidFilePath gets the path of pid file

var ServerFilePath string

ServerFilePath returns the path of JSON config file

func Leave Uses

func Leave() int

Leave sends a SIGTERM signal to zeplic process ID

func LogBook Uses

func LogBook() *syslog.Writer

LogBook checks the configuration of syslog and creates a new connection with the service

func Logger Uses

func Logger(log string) syslog.Priority

Logger returns the facility of LOCAL variable

func Pid Uses

func Pid() error

Pid writes the pid of zeplic pid file

func ShowVersion Uses

func ShowVersion() string

ShowVersion shows the version of zeplic

type Actions Uses

type Actions struct {
    Hostname         string `json:"hostname"`
    Dataset          string `json:"dataset"`
    Backup           Cold
    Sync             Hot
    RollbackIfNeeded bool `json:"rollback_if_needed"`
    SkipIfRenamed    bool `json:"skip_if_renamed"`
    SkipIfNotWritten bool `json:"skip_if_not_written"`
    SkipIfCloned     bool `json:"skip_if_cloned"`
}

Actions contains the information of replicate every snapshot

type Cold Uses

type Cold struct {
    Prefix      string   `json:"prefix"`
    Creation    string   `json:"creation"`
    SyncOn      string   `json:"sync_on"`
    SyncDataset string   `json:"sync_dataset"`
    SyncPolicy  string   `json:"sync_policy"`
    Retention   []string `json:"retention"`
}

Cold contains the information of backup snapshot

type Config Uses

type Config struct {
    Resync     []string  `json:"consul_resync"`
    Datacenter string    `json:"datacenter"`
    Director   []Actions `json:"datasets"`
}

Config extracts the interface of JSON server file

func Server Uses

func Server() Config

Server extracts all data from server json file

type Copy Uses

type Copy struct {
    Enable bool   `json:"enable"`
    Name   string `json:"name"`
    Delete bool   `json:"delete"`
}

Copy contains Clone options

type Data Uses

type Data struct {
    Enable    bool   `json:"enable"`
    Slave     bool   `json:"slave"`
    Name      string `json:"name"`
    Consul    Sync
    Prefix    string `json:"snap_prefix"`
    Retention int    `json:"snap_retention"`
    Backup    bool   `json:"backup"`
    Clone     Copy
}

Data contains the information of each dataset

type Hot Uses

type Hot struct {
    Prefix      string   `json:"prefix"`
    Creation    string   `json:"creation"`
    SyncOn      string   `json:"sync_on"`
    SyncDataset string   `json:"sync_dataset"`
    SyncPolicy  string   `json:"sync_policy"`
    Retention   []string `json:"retention"`
}

Hot contains the information of synchronization snapshot

type Log Uses

type Log struct {
    Enable bool   `json:"enable"`
    Mode   string `json:"mode"`
    Info   string `json:"info"`
}

Log extracts the interface of JSON file

type Pool Uses

type Pool struct {
    Dataset []Data `json:"local_datasets"`
}

Pool extracts the interface of JSON file

func Local Uses

func Local() Pool

Local reads the local json file and checks how many datasets are there and its data

type Sync Uses

type Sync struct {
    Enable     bool   `json:"enable"`
    Datacenter string `json:"datacenter"`
}

Sync contains Consul options

Package config imports 9 packages (graph) and is imported by 3 packages. Updated 2017-10-06. Refresh now. Tools for package owners.