{"modulePath":"knative.dev/serving","version":"v0.51.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sharedmain\n\n## Constants\n\n```go\nconst (\n\n\t// PodInfoAnnotationsPath is an exported path for the annotations file\n\t// This path is used by QP Options (Extensions).\n\tPodInfoAnnotationsPath = queue.PodInfoDirectory + \"/\" + queue.PodInfoAnnotationsFilename\n\n\t// QPOptionTokenDirPath is a directory for per audience tokens\n\t// This path is used by QP Options (Extensions) as \u003cQPOptionTokenDirPath\u003e/\u003cAudience\u003e\n\tQPOptionTokenDirPath = queue.TokenDirectory\n)\n```\n\n## Functions\n\n```go\nfunc Main(opts ...Option) error\n```\n\n```go\nfunc SetupObservabilityOrDie(\n\tctx context.Context,\n\tcfg *config,\n\tlogger *zap.SugaredLogger,\n) (*metrics.MeterProvider, *tracing.TracerProvider)\n```\n\n## Types\n\n```go\ntype Defaults struct {\n\t// Logger enables Options to use the QP pre-configured logger\n\t// It is expected that Options will use the provided Logger when logging\n\t// Options should not modify the provided Default Logger\n\tLogger *zap.SugaredLogger\n\n\t// Env exposes parsed QP environment variables for use by Options\n\t// Options should not modify the provided environment parameters\n\tEnv Env\n\n\t// Ctx provides Options with the QP context\n\t// An Option may derive a new context from Ctx. If a new context is derived,\n\t// the derived context should replace the value of Ctx.\n\t// The new Ctx will then be used by other Options (called next) and by QP.\n\tCtx context.Context\n\n\t// Transport provides Options with the QP RoundTripper\n\t// An Option may wrap the provided Transport to add a Roundtripper.\n\t// If Transport is wrapped, the new RoundTripper should replace the value of Transport.\n\t// The new Transport will then be used by other Options (called next) and by QP.\n\tTransport http.RoundTripper\n\n\t// ProxyHandler provides Options with the QP's main ReverseProxy\n\t// The default value is of type *httputil.ReverseProxy\n\t// An Option may type assert to *httutil.ReverseProxy and adjust attributes of the ReverseProxy,\n\t// or replace the handler entirely, typically to insert additional handler(s) into the chain.\n\tProxyHandler http.Handler\n}\n```\nDefaults provides Options (QP Extensions) with the default behaviour of QP Some attributes of Defaults may be modified by Options Modifying Defaults mutates the behavior of QP\n\n```go\ntype Env struct {\n\t// ServingNamespace is the namespace in which the service is defined\n\tServingNamespace string `split_words:\"true\" required:\"true\"`\n\n\t// ServingService is the name of the service served by this pod\n\tServingService string `split_words:\"true\"` // optional\n\n\t// ServingConfiguration is the name of service configuration served by this pod\n\tServingConfiguration string `split_words:\"true\" required:\"true\"`\n\n\t// ServingRevision is the name of service revision served by this pod\n\tServingRevision string `split_words:\"true\" required:\"true\"`\n\n\t// ServingPod is the pod name\n\tServingPod string `split_words:\"true\" required:\"true\"`\n\n\t// ServingPodIP is the pod ip address\n\tServingPodIP string `split_words:\"true\" required:\"true\"`\n}\n```\nEnv exposes parsed QP environment variables for use by Options (QP Extensions)\n\n```go\ntype Option func(*Defaults)\n```\n\n","path":"knative.dev/serving/pkg/queue/sharedmain","name":"sharedmain","synopsis":"","isRedistributable":true}
