internal

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnoDescription = "ingress-dashboard/description"
	AnnoLogoURL     = "ingress-dashboard/logo-url"
	AnnoTitle       = "ingress-dashboard/title"
	AnnoHide        = "ingress-dashboard/hide"       // do not display ingress in dashboard
	AnnoURL         = "ingress-dashboard/url"        // custom ingress URL (could be used with load-balancers or reverse-proxies)
	AnnoAssumeTLS   = "ingress-dashboard/assume-tls" // force protocol as HTTPS (for SSL termination on load-balancers)

)
View Source
const (
	SoonExpiredInterval = 14 * 24 * time.Hour // 2 weeks
)

Variables

This section is empty.

Functions

func WatchKubernetes

func WatchKubernetes(global context.Context, clientset kubernetes.Interface, receiver interface {
	Set(ingresses []Ingress)
})

Types

type CertInfo added in v0.2.0

type CertInfo struct {
	Expiration time.Time
	Domains    []string
	Issuer     string
}

func Expiration added in v0.1.0

func Expiration(ctx context.Context, host string) (CertInfo, error)

Expiration time of TLS certificate.

type Ingress

type Ingress struct {
	ID          string   `yaml:"-"`           // human readable ID (namespace with name)
	UID         string   `yaml:"-"`           // machine readable ID (guid in Kube)
	Title       string   `yaml:"-"`           // custom title in dashboard, overwrites Name
	Name        string   `yaml:"name"`        // ingress name as in Kube
	Namespace   string   `yaml:"namespace"`   // Kube namespace for ingress
	Description string   `yaml:"description"` // optional, human-readable description of Ingress
	Hide        bool     `yaml:"-"`           // hidden Ingresses will not appear in UI
	LogoURL     string   `yaml:"logo_url"`    // custom URL for icon
	Class       string   `yaml:"-"`           // Ingress class
	Static      bool     `yaml:"-"`
	Refs        []Ref    `yaml:"-"`
	TLS         bool     `yaml:"-"`
	Cert        CertInfo `yaml:"-"`
}

func LoadDefinitions added in v0.0.4

func LoadDefinitions(location string) ([]Ingress, error)

LoadDefinitions scans location (file or dir) for YAML/JSON (.yml, .yaml, .json) definitions of Ingress. Directories scanned recursive and each file can contain multiple definitions.

Empty location is a special case and cause returning empty slice.

func (Ingress) HasDeadRefs added in v0.1.0

func (ingress Ingress) HasDeadRefs() bool

func (Ingress) IsTLSExpired added in v0.1.0

func (ingress Ingress) IsTLSExpired() bool

func (Ingress) IsTLSSoonExpire added in v0.1.0

func (ingress Ingress) IsTLSSoonExpire() bool

func (Ingress) Label

func (ingress Ingress) Label() string
func (ingress Ingress) Logo() string

func (Ingress) WhenTLSExpires added in v0.1.0

func (ingress Ingress) WhenTLSExpires() string

type Receiver added in v0.0.4

type Receiver interface {
	Set(ingresses []Ingress)
}

type Ref added in v0.1.0

type Ref struct {
	URL    string // link to ingress
	Pods   int    // number of pods linked to the service
	Static bool   // is reference defined statically (for static refs, pods number has no sense)
}

type Service

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

func New

func New() *Service

func (*Service) Get

func (svc *Service) Get() []Ingress

func (*Service) Prepend added in v0.0.4

func (svc *Service) Prepend(ingress []Ingress)

Prepend static list of ingresses.

func (*Service) ServeHTTP

func (svc *Service) ServeHTTP(writer http.ResponseWriter, request *http.Request)

func (*Service) Set

func (svc *Service) Set(ingress []Ingress)

type UIContext

type UIContext struct {
	Ingresses []Ingress
	User      *auth.User
}

type UIDetailsContext added in v0.2.0

type UIDetailsContext struct {
	UIContext
	Ingress     Ingress
	ByNamespace map[string][]Ingress
	Namespaces  []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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