kubernetes: k8s.io/kubernetes/pkg/util/configz Index | Files

package configz

import "k8s.io/kubernetes/pkg/util/configz"

Package configz serves ComponentConfig objects from running components.

Each component that wants to serve its ComponentConfig creates a Config object, and the program should call InstallHandler once. e.g.,

func main() {
	boatConfig := getBoatConfig()
	planeConfig := getPlaneConfig()

	bcz, err := configz.New("boat")
	if err != nil {
		panic(err)
	}
	bcz.Set(boatConfig)

	pcz, err := configz.New("plane")
	if err != nil {
		panic(err)
	}
	pcz.Set(planeConfig)

	configz.InstallHandler(http.DefaultServeMux)
	http.ListenAndServe(":8080", http.DefaultServeMux)
}

Index

Package Files

configz.go

func Delete Uses

func Delete(name string)

Delete removes the named ComponentConfig from this package's "/configz" handler.

func InstallHandler Uses

func InstallHandler(m mux)

InstallHandler adds an HTTP handler on the given mux for the "/configz" endpoint which serves all registered ComponentConfigs in JSON format.

type Config Uses

type Config struct {
    // contains filtered or unexported fields
}

Config is a handle to a ComponentConfig object. Don't create these directly; use New() instead.

func New Uses

func New(name string) (*Config, error)

New creates a Config object with the given name. Each Config is registered with this package's "/configz" handler.

func (*Config) MarshalJSON Uses

func (v *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ComponentConfig as JSON data.

func (*Config) Set Uses

func (v *Config) Set(val interface{})

Set sets the ComponentConfig for this Config.

Package configz imports 4 packages (graph) and is imported by 115 packages. Updated 2019-01-07. Refresh now. Tools for package owners.