예제 #1
0
package app

import (
	"fmt"
	"github.com/echocat/caretakerd"
	"github.com/echocat/caretakerd/defaults"
	"github.com/echocat/caretakerd/errors"
	"github.com/urfave/cli"
	"os"
)

var conf = NewConfigWrapper()
var defaultListenAddress = defaults.ListenAddress()
var defaultPemFile = defaults.AuthFileKeyFilename()
var listenAddress = NewFlagWrapper(&defaultListenAddress)
var pemFile = NewFlagWrapper(&defaultPemFile)

func init() {
	cli.AppHelpTemplate = `NAME:
   {{.Name}} - {{.Usage}}

USAGE:
   {{.HelpName}} {{if .Flags}}[global options]{{end}} command ...
{{if .Commands}}
COMMANDS:
   {{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
   {{end}}{{end}}{{if .Flags}}
GLOBAL OPTIONS:
   {{range .Flags}}{{.}}
   {{end}}{{end}}
`
예제 #2
0
package rpc

import (
	"github.com/echocat/caretakerd/defaults"
	"github.com/echocat/caretakerd/values"
)

var defaultValues = map[string]interface{}{
	"Enabled": values.Boolean(false),
	"Listen":  defaults.ListenAddress(),
}

// # Description
//
// Defines the remote access to caretakerd.
type Config struct {
	// @default false
	//
	// If this is set to ``true`` it is possible to control caretakerd remotely.
	// This includes the [``caretakerctl``](#commands.caretakerctl) command and also
	// by the services itself.
	//
	// > **Hint:** This does **NOT** automatically grants each of it caretakerd access rights.
	// > This is separately handled by the following access properties:
	// >
	// > * {@ref github.com/echocat/caretakerd/control.Config#Access Control.access} for caretakerctl
	// > * {@ref github.com/echocat/caretakerd/service.Config#Access Services.access} for services
	Enabled values.Boolean `json:"enabled" yaml:"enabled"`

	// @default "tcp://localhost:57955"
	//