confsyncer

package
v0.0.0-...-1aad945 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

* ConfSyncer - a little sync config files tool in the Linux. * Copyright (C) 2020 Amatist_kurisu<misaki.zhcy@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

* ConfSyncer - a little sync config files tool in the Linux. * Copyright (C) 2020 Amatist_kurisu<misaki.zhcy@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	ContainerName      = "confsyncer"
	GenerateDCFileName = "docker-compose.yaml"
)

Variables

View Source
var (

	// TmpDir(TmpDirPath) is a tmp git clone dir
	TmpDirPath = "/tmp/confsyncer-" + fmt.Sprint(time.Now().Format("20060102"))

	// use it when need a default config
	DefaultConfigContext = `` /* 139-byte string literal not displayed */

)
View Source
var (
	ConfigExists = true
)

Functions

func ConfigPull

func ConfigPull(cmd *cobra.Command, args []string)

func ConfigPush

func ConfigPush(cmd *cobra.Command, args []string)

func DaemonPull

func DaemonPull(cmd *cobra.Command, args []string)

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func LoadConfig

func LoadConfig()

LoadConfig reads in config file and ENV variables if set.

func ShowConfig

func ShowConfig(*cobra.Command, []string)

ShowConfig

func VersionCmd

func VersionCmd(cmd *cobra.Command, args []string)

VersionCmd

Types

type Config

type Config struct {
	GitRepo             string `yaml:"gitRepo"`
	GitPullTimeInternal int    `yaml:"gitPullTimeInternal"`
	Maps                []Path `yaml:"maps"`
}

type Container

type Container struct {
	Image   string   `yaml:"image"`
	Restart string   `yaml:"restart"`
	Volumes []string `yaml:"volumes"`
}

type DCCmd

type DCCmd string

func (*DCCmd) Gen

func (d *DCCmd) Gen(cmd *cobra.Command, args []string)

func (*DCCmd) Restart

func (d *DCCmd) Restart(cmd *cobra.Command, args []string)

func (*DCCmd) Stop

func (d *DCCmd) Stop(cmd *cobra.Command, args []string)

type DockerComposeStruct

type DockerComposeStruct struct {
	Version  string               `yaml:"version"`
	Services map[string]Container `yaml:"services"`
}

struct of Docker-compose.yaml

type Path

type Path struct {
	Local       string `yaml:"local"`
	GitRepoPath string `yaml:"gitRepoPath"`
}

func GetFilesMap

func GetFilesMap() ([]Path, error)

get files map

Jump to

Keyboard shortcuts

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