gitpod/components/supervisor/cmd/container-drop.go

28 lines
625 B
Go

// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.
package cmd
import (
"io"
"os"
"github.com/gitpod-io/gitpod/supervisor/pkg/dropwriter"
"github.com/spf13/cobra"
)
var dropCmd = &cobra.Command{
Use: "drop",
Short: "starts a dropping rate-limiter for stdin",
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
out := dropwriter.Writer(os.Stdout, dropwriter.NewBucket(128, 64))
io.Copy(out, os.Stdin)
},
}
func init() {
containerCmd.AddCommand(dropCmd)
}