adapter

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package adapter exports top-level adapter logic.

Index

Constants

View Source
const (
	// Name of the adapter.
	Name = "newrelic-k8s-metrics-adapter"
	// DefaultSecurePort is a default port adapter will be listening on using HTTPS.
	DefaultSecurePort = 6443
)

Variables

This section is empty.

Functions

func ParseFlags

func ParseFlags(args []string, extraFlags *pflag.FlagSet, adapter *basecmd.AdapterBase) error

ParseFlags parses given arguments as custom custom-metrics-apiserver into given adapter base.

It also allows specifying extra flags if one wants to add extra flags to API server built on top of adapter base.

If adapter is nil, temporary adapter will be used.

Extra flags are also optional.

Types

type Adapter

type Adapter interface {
	Run(<-chan struct{}) error
}

Adapter represents adapter functionality.

func NewAdapter

func NewAdapter(options Options) (Adapter, error)

NewAdapter validates given adapter options and creates new runnable adapter instance.

type Options

type Options struct {
	Args                    []string
	ExtraFlags              *pflag.FlagSet
	ExternalMetricsProvider provider.ExternalMetricsProvider
}

Options holds the configuration for the adapter.

Jump to

Keyboard shortcuts

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