Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/supervisor/cmd/container-drop.go
2498 views
1
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cmd
6
7
import (
8
"io"
9
"os"
10
11
"github.com/spf13/cobra"
12
13
"github.com/gitpod-io/gitpod/supervisor/pkg/dropwriter"
14
)
15
16
var dropCmd = &cobra.Command{
17
Use: "drop",
18
Short: "starts a dropping rate-limiter for stdin",
19
Hidden: true,
20
Run: func(cmd *cobra.Command, args []string) {
21
out := dropwriter.Writer(os.Stdout, dropwriter.NewBucket(128, 64))
22
io.Copy(out, os.Stdin)
23
},
24
}
25
26
func init() {
27
containerCmd.AddCommand(dropCmd)
28
}
29
30