kubernetes

package
v0.0.0-...-43e5fc7 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubernetesSchema = "kubernetes"
)

Variables

This section is empty.

Functions

func Builder

func Builder() naming.Builder

Types

type Address

type Address struct {
	IP        string           `json:"ip"`
	TargetRef *ObjectReference `json:"targetRef,omitempty"`
}

type Endpoints

type Endpoints struct {
	Kind       string   `json:"kind"`
	ApiVersion string   `json:"apiVersion"`
	Metadata   Metadata `json:"metadata"`
	Subsets    []Subset `json:"subsets"`
}

type Event

type Event struct {
	Type   EventType `json:"type"`
	Object Endpoints `json:"object"`
}

Event represents a single event to a watched resource.

type EventType

type EventType string
const (
	Added    EventType = "ADDED"
	Modified EventType = "MODIFIED"
	Deleted  EventType = "DELETED"
	Error    EventType = "ERROR"
)

type K8S

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

func (*K8S) Build

func (k *K8S) Build(target string, options ...naming.BuildOpt) naming.Resolver

func (*K8S) Scheme

func (k *K8S) Scheme() string

type K8sClient

type K8sClient interface {
	Do(req *http.Request) (*http.Response, error)
	GetRequest(url string) (*http.Request, error)
	Host() string
}

func NewInClusterK8sClient

func NewInClusterK8sClient() (K8sClient, error)

NewInClusterK8sClient creates K8sClient if it is inside Kubernetes

func NewInsecureK8sClient

func NewInsecureK8sClient(apiURL string) K8sClient

NewInsecureK8sClient creates an insecure k8s client which is suitable to connect kubernetes api behind proxy

type K8sResolver

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

func (*K8sResolver) Close

func (r *K8sResolver) Close() error

func (*K8sResolver) Fetch

func (r *K8sResolver) Fetch(ctx context.Context) (State resolver.State, ok bool)

func (*K8sResolver) Watch

func (r *K8sResolver) Watch() <-chan struct{}

func (*K8sResolver) Watchk8sAPI

func (r *K8sResolver) Watchk8sAPI() error

type Metadata

type Metadata struct {
	Name            string            `json:"name"`
	Namespace       string            `json:"namespace"`
	ResourceVersion string            `json:"resourceVersion"`
	Labels          map[string]string `json:"labels"`
}

type ObjectReference

type ObjectReference struct {
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type Port

type Port struct {
	Name string `json:"name"`
	Port int    `json:"port"`
}

type Subset

type Subset struct {
	Addresses []Address `json:"addresses"`
	Ports     []Port    `json:"ports"`
}

Jump to

Keyboard shortcuts

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