config

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Overview

Package config has definitions about the overall configuration of Collector.

Index

Constants

View Source
const (
	// Time to wait before retrying a failed operation.
	RETRYDURATION = time.Duration(5) * time.Second
	DockerHub     = "registry-1.docker.io"
)

Variables

View Source
var (
	FilterRepos = false

	// Directories/files dependent on Environment variables
	BANYANHOSTDIR = func() string {
		if os.Getenv("BANYAN_HOST_DIR") == "" {
			os.Setenv("BANYAN_HOST_DIR", os.Getenv("HOME")+"/.banyan")
		}
		return os.Getenv("BANYAN_HOST_DIR")
	}
	BANYANDIR = func() string {
		if os.Getenv("BANYAN_DIR") != "" {
			return os.Getenv("BANYAN_DIR")
		}
		return BANYANHOSTDIR()
	}
	COLLECTORDIR = func() string {
		if os.Getenv("COLLECTOR_DIR") == "" {
			fmt.Fprintf(os.Stderr, "Please set the environment variable COLLECTOR_DIR to the parent")
			fmt.Fprintf(os.Stderr, " of the \"data\" scripts directory...\n\n")

			return ""
		}
		return os.Getenv("COLLECTOR_DIR")
	}
	BanyanOutDir = flag.String("banyanoutdir", BANYANDIR()+"/hostcollector/banyanout",
		"Output directory for collected data")
	// Dests is setup as a flag when main calls DefineDestsFlag().
	Dests *string

	// BanyanUpdate is a function to log interesting updates as collector execution proceeds.
	BanyanUpdate BanyanUpdateFunc = func(status ...string) {}
)

Functions

func DefineDestsFlag

func DefineDestsFlag(def string)

DefineDestsFlag is called by the importing package, e.g., main, to create the dests flag.

Types

type BanyanUpdateFunc

type BanyanUpdateFunc func(status ...string)

Jump to

Keyboard shortcuts

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