gitpod/components/supervisor/cmd/container-drop.go
2022-12-08 13:05:19 -03:00

29 lines
626 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/spf13/cobra"
"github.com/gitpod-io/gitpod/supervisor/pkg/dropwriter"
)
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)
}