pkgsitegolang.org/x/pkgsite/cmd/internal/cmdconfig Index | Files

package cmdconfig

import "golang.org/x/pkgsite/cmd/internal/cmdconfig"

Package cmdconfig contains functions for configuring commands.

Index

Functions

func ExperimentGetter

func ExperimentGetter(ctx context.Context, cfg *config.Config) middleware.ExperimentGetter

ExperimentGetter returns an ExperimentGetter using the config.

func Experimenter

Experimenter configures a middleware.Experimenter.

func Logger

func Logger(ctx context.Context, cfg *config.Config, logName string) middleware.Logger

Logger configures a middleware.Logger.

func OpenDB

func OpenDB(ctx context.Context, cfg *config.Config, bypassLicenseCheck bool) (_ *postgres.DB, err error)

OpenDB opens the postgres database specified by the config. It first tries the main connection info (DBConnInfo), and if that fails, it uses backup connection info it if exists (DBSecondaryConnInfo).

func Reporter

func Reporter(ctx context.Context, cfg *config.Config) derrors.Reporter

Reporter configures an Error Reporting client.

Source Files

cmdconfig.go

Version
v0.0.0-20250218150137-224a1368cf02 (latest)
Published
Feb 18, 2025
Platform
linux/amd64
Imports
20 packages
Last checked
2 months ago

Tools for package owners.