arg

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "kv2",
	Short: "kv2 provides an interface for your secrets manager",
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		serverUrlEnv, exists := os.LookupEnv("KV2_SERVER_URL")
		if !exists {

			return errors.New("KV2_SERVER_URL not found in environment")
		}

		opts := connect.WithClientOptions(
			connect.WithCompressMinBytes(1280),
		)

		client := &http.Client{
			CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
				return http.ErrUseLastResponse
			},
			Timeout: 20 * time.Second,
			Transport: &http.Transport{
				Dial: (&net.Dialer{
					Timeout: 3 * time.Second,
				}).Dial,
				TLSHandshakeTimeout:   3 * time.Second,
				ResponseHeaderTimeout: 3 * time.Second,
				ExpectContinueTimeout: 3 * time.Second,
			},
		}

		kv2 = secretsv1connect.NewKv2ServiceClient(client, serverUrlEnv, opts)

		return nil
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL