pkgsite: golang.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

Package Files

cmdconfig.go

func ExperimentGetter Uses

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

ExperimentGetter returns an ExperimentGetter using the config.

func Experimenter Uses

func Experimenter(ctx context.Context, cfg *config.Config, getter middleware.ExperimentGetter, reportingClient *errorreporting.Client) *middleware.Experimenter

Experimenter configures a middleware.Experimenter.

func Logger Uses

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

Logger configures a middleware.Logger.

func OpenDB Uses

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 ReportingClient Uses

func ReportingClient(ctx context.Context, cfg *config.Config) *errorreporting.Client

ReportingClient configures an Error Reporting client.

Package cmdconfig imports 15 packages (graph) and is imported by 2 packages. Updated 2021-01-15. Refresh now. Tools for package owners.