<commit_before>package main

import (
	"os"

	"code.cloudfoundry.org/lager"
	"github.com/concourse/atc"
	"github.com/concourse/flag"
	"github.com/concourse/worker"
	"github.com/concourse/worker/beacon"
	"github.com/tedsuo/ifrit"
)

type BeaconConfigRequired struct {
	Host             string              `long:"host" required:"true" default:"127.0.0.1" description:"TSA host to negotiate the worker draining through."`
	Port             int                 `long:"port" required:"true" default:"2222" description:"TSA port to connect to."`
	PublicKey        flag.AuthorizedKeys `long:"public-key" required:"true" description:"File containing a public key to expect from the TSA."`
	WorkerPrivateKey flag.PrivateKey     `long:"worker-private-key" required:"true" description:"File containing the private key to use when authenticating to the TSA."`
}

func (b BeaconConfigRequired) canonical() beacon.Config {
	return beacon.Config{
		Host:             b.Host,
		Port:             b.Port,
		PublicKey:        b.PublicKey,
		WorkerPrivateKey: b.WorkerPrivateKey,
	}
}

type LandWorkerCommand struct {
	TSA BeaconConfigRequired `group:"TSA Configuration" namespace:"tsa" required:"true"`

	WorkerName string `long:"name" required:"true" description:"The name of the worker you wish to land."`
}

func (cmd *LandWorkerCommand) Execute(args []string) error {
	logger := lager.NewLogger("land-worker")
	logger.RegisterSink(lager.NewWriterSink(os.Stdout, lager.DEBUG))
<commit_msg>update cmd to beacon config changes in worker binary<commit_after>package main

import (
	"os"

	"code.cloudfoundry.org/lager"
	"github.com/concourse/atc"
	"github.com/concourse/flag"
	"github.com/concourse/worker"
	"github.com/concourse/worker/beacon"
	"github.com/tedsuo/ifrit"
)

type BeaconConfigRequired struct {
	Host             []string            `long:"host" required:"true" default:"127.0.0.1:2222" description:"TSA host to negotiate the worker draining through."`
	PublicKey        flag.AuthorizedKeys `long:"public-key" required:"true" description:"File containing a public key to expect from the TSA."`
	WorkerPrivateKey flag.PrivateKey     `long:"worker-private-key" required:"true" description:"File containing the private key to use when authenticating to the TSA."`
}

func (b BeaconConfigRequired) canonical() beacon.Config {
	return beacon.Config{
		Host:             b.Host,
		PublicKey:        b.PublicKey,
		WorkerPrivateKey: b.WorkerPrivateKey,
	}
}

type LandWorkerCommand struct {
	TSA BeaconConfigRequired `group:"TSA Configuration" namespace:"tsa" required:"true"`

	WorkerName string `long:"name" required:"true" description:"The name of the worker you wish to land."`
}

func (cmd *LandWorkerCommand) Execute(args []string) error {
	logger := lager.NewLogger("land-worker")
	logger.RegisterSink(lager.NewWriterSink(os.Stdout, lager.DEBUG))

{'fraction_non_alphanumeric': 0.11704745166959578, 'fraction_numerical': 0.007029876977152899, 'mean_word_length': 4.270370370370371, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5690009', 'n_tokens_mistral': 892, 'n_tokens_neox': 865, 'n_words': 222}