コード例 #1
0
ファイル: options.go プロジェクト: rawlingsj/gofabric8
// AddFlags adds flags for a specific LocalkubeServer
func AddFlags(s *localkube.LocalkubeServer) {
	flag.BoolVar(&s.Containerized, "containerized", s.Containerized, "If kubelet should run in containerized mode")
	flag.BoolVar(&s.EnableDNS, "enable-dns", s.EnableDNS, "If dns should be enabled")
	flag.StringVar(&s.DNSDomain, "dns-domain", s.DNSDomain, "The cluster dns domain")
	flag.IPVar(&s.DNSIP, "dns-ip", s.DNSIP, "The cluster dns IP")
	flag.StringVar(&s.LocalkubeDirectory, "localkube-directory", s.LocalkubeDirectory, "The directory localkube will store files in")
	flag.IPNetVar(&s.ServiceClusterIPRange, "service-cluster-ip-range", s.ServiceClusterIPRange, "The service-cluster-ip-range for the apiserver")
	flag.IPVar(&s.APIServerAddress, "apiserver-address", s.APIServerAddress, "The address the apiserver will listen securely on")
	flag.IntVar(&s.APIServerPort, "apiserver-port", s.APIServerPort, "The port the apiserver will listen securely on")
	flag.IPVar(&s.APIServerInsecureAddress, "apiserver-insecure-address", s.APIServerInsecureAddress, "The address the apiserver will listen insecurely on")
	flag.IntVar(&s.APIServerInsecurePort, "apiserver-insecure-port", s.APIServerInsecurePort, "The port the apiserver will listen insecurely on")
	flag.BoolVar(&s.ShouldGenerateCerts, "generate-certs", s.ShouldGenerateCerts, "If localkube should generate it's own certificates")
	flag.BoolVar(&s.ShowVersion, "version", s.ShowVersion, "If localkube should just print the version and exit.")
	flag.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively.")
	flag.IPVar(&s.NodeIP, "node-ip", s.NodeIP, "IP address of the node. If set, kubelet will use this IP address for the node.")
	flag.StringVar(&s.ContainerRuntime, "container-runtime", "", "The container runtime to be used")
	flag.StringVar(&s.NetworkPlugin, "network-plugin", "", "The name of the network plugin")

	// These two come from vendor/ packages that use flags. We should hide them
	flag.CommandLine.MarkHidden("google-json-key")
	flag.CommandLine.MarkHidden("log-flush-frequency")

	// Parse them
	flag.Parse()
}
コード例 #2
0
ファイル: release-notes.go プロジェクト: resouer/contrib
func init() {
	flag.IntVar(&last, "last-release-pr", 0, "The PR number of the last versioned release.")
	flag.IntVar(&current, "current-release-pr", 0, "The PR number of the current versioned release.")
	flag.StringVar(&token, "api-token", "", "Github api token for rate limiting. Background: https://developer.github.com/v3/#rate-limiting and create a token: https://github.com/settings/tokens")
	flag.StringVar(&base, "base", "master", "The base branch name for PRs to look for.")
	flag.BoolVar(&relnoteFilter, "relnote-filter", true, "Whether to filter PRs by the release-note label.")
}
コード例 #3
0
ファイル: mediasyncer.go プロジェクト: zeisss/mediasyncer
func init() {
	pflag.StringVar(&formula, "price-formula", "static", "What price formular to use? static, random, old, young")
	pflag.Float32Var(&formulaStaticPrice, "price-static", 1.0, "Price for static formular")
	pflag.Float32Var(&formulaDefaultPrice, "price-default", 1.0, "Default Price for old/young formular")
	pflag.Float32Var(&formulaOldPrice, "price-old", 1.0, "Age Price for old formular")
	pflag.Float32Var(&formulaYoungPrice, "price-young", 1.0, "Age Price for young formular")
	pflag.DurationVar(&formulaOldAge, "price-old-age", 6*30*24*time.Hour, "Minimum age before start bidding price-old")
	pflag.DurationVar(&formulaYoungAge, "price-young-age", 60*24*time.Hour, "Maximum age before stop bidding price-old")

	pflag.StringVar(&volumePath, "volume", "./lib", "What files to sync")

	pflag.StringVar(&fsConfig.Addr, "http-addr", "127.0.0.1", "IP to listen on. Must be resolvable by all peers")
	pflag.IntVar(&fsConfig.Port, "http-port", 8080, "Port for HTTP FileServer")

	pflag.IntVar(&p2pConfig.BindPort, "bind-port", 8000, "The port to bind to")
	pflag.StringVar(&p2pConfig.Name, "name", "mediasyncer", "The name of this process. Must be unique for the memberlist cluster")

	pflag.BoolVar(&printNetworkMessages, "debug", false, "Print network messages received/sent")
}
コード例 #4
0
ファイル: main.go プロジェクト: mashuai/pgskail
func initializeFlags() {
	flag.Set("logtostderr", "true")
	flag.BoolVar(&options.CleanKeystore, "clean", false, "Clean-up keystore and start over?")
	flag.StringVar(&options.EtcdHost, "etcd_host", "127.0.0.1", "Hostname or IP address where Etcd is listening on")
	flag.Uint64Var(&options.LeaderTTL, "ttl", 10, "Leader health-check interval in seconds")
	flag.BoolVar(&options.MemberElectable, "electable", true, "Is member elegible for leader?")
	flag.Uint64Var(&options.MemberTTL, "member_ttl", 30, "Member health-check interval in seconds")
	flag.StringVar(&options.PgHost, "pg_host", "127.0.0.1", "Hostname or IP address where PostgreSQL server is listening on")
	flag.IntVar(&options.PgPort, "pg_port", 5432, "TCP port where PostgreSQL server is listening on")

	flag.Parse()
}
コード例 #5
0
ファイル: main.go プロジェクト: squioc/lilt
func main() {
	var period int
	flag.IntVar(&period, "period", 1000, "number of milliseconds between each pulse")
	flag.Parse()

	var reader io.Reader
	if terminal.IsTerminal(int(os.Stdin.Fd())) {
		reader = &lilt.LineFeedReader{}
	} else {
		reader = os.Stdin
	}

	tempo := lilt.NewLiltWithReader(reader, os.Stdout, time.NewTicker(time.Duration(period)*time.Millisecond))
	tempo.Run()

}
コード例 #6
0
func init() {
	flag.IntVar(&target, "last-release-pr", 0, "The PR number of the last versioned release.")
	flag.IntVar(&current, "current-release-pr", 0, "The PR number of the current versioned release.")
	flag.StringVar(&token, "api-token", "", "Github api token for rate limiting. See https://developer.github.com/v3/#rate-limiting.")
}
コード例 #7
0
ファイル: release-notes.go プロジェクト: rwehner/contrib
func init() {
	flag.IntVar(&last, "last-release-pr", 0, "The PR number of the last versioned release.")
	flag.IntVar(&current, "current-release-pr", 0, "The PR number of the current versioned release.")
	flag.StringVar(&token, "api-token", "", "Github api token for rate limiting. Background: https://developer.github.com/v3/#rate-limiting and create a token: https://github.com/settings/tokens")
}
コード例 #8
0
ファイル: flags.go プロジェクト: sadlil/gologger
func init() {
	pflag.IntVar(&l, "logLevel", 0, "log level in which gologger logs to")
	pflag.StringVar(&c, "logCatagory", "", "log catagory which used for logging")
	pflag.BoolVar(&forceToGlog, "forceToGlog", false, "use glog for all logging. cancel other logging.")
	pflag.BoolVar(&alsoLogToGlog, "alsoLogToGlog", false, "also use glog as side logging.")
}