devportal

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler exposes both an API and a UI for a set of APIPortals. The handler can be safely updated to support more APIPortals as they come and go.

func NewHandler

func NewHandler() *Handler

NewHandler builds a new instance of Handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*Handler) Update

func (h *Handler) Update(portals []portal) error

Update safely updates the current http.ServeMux with a new one built for serving the given portals.

type PortalAPI

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

PortalAPI is a handler that exposes APIPortal information.

func NewPortalAPI

func NewPortalAPI(portal *portal) (*PortalAPI, error)

NewPortalAPI creates a new PortalAPI handler.

func (*PortalAPI) ServeHTTP

func (p *PortalAPI) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP serves HTTP requests.

type PortalUI

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

PortalUI is a handler for exposing APIPortals' UI.

func NewPortalUI

func NewPortalUI(portals []portal) (*PortalUI, error)

NewPortalUI creates a new PortalUI handler.

func (*PortalUI) ServeHTTP

func (p *PortalUI) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP serves HTTP requests.

type UpdatableHandler

type UpdatableHandler interface {
	Update(portals []portal) error
}

UpdatableHandler is an updatable HTTP handler for serving dev portals.

type Watcher

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

Watcher watches APIPortals resources and builds configurations out of them.

func NewWatcher

NewWatcher returns a new watcher to track API management resources. It calls the given UpdatableHandler when a resource is modified.

func (*Watcher) OnAdd

func (w *Watcher) OnAdd(obj interface{})

OnAdd implements Kubernetes cache.ResourceEventHandler so it can be used as an informer event handler.

func (*Watcher) OnDelete

func (w *Watcher) OnDelete(oldObj interface{})

OnDelete implements Kubernetes cache.ResourceEventHandler so it can be used as an informer event handler.

func (*Watcher) OnUpdate

func (w *Watcher) OnUpdate(oldObj, newObj interface{})

OnUpdate implements Kubernetes cache.ResourceEventHandler so it can be used as an informer event handler.

func (*Watcher) Run

func (w *Watcher) Run(ctx context.Context)

Run starts listening for changes on the cluster.

Jump to

Keyboard shortcuts

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