host

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 45 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorResponseWriter

func GetErrorResponseWriter(w http.ResponseWriter) *errorResponseWriter

Types

type AnalysisCache

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

AnalysisCache stores the results of the InferenceEngine for a short period so that the redirected user can view the report.

func NewAnalysisCache

func NewAnalysisCache() *AnalysisCache

func (*AnalysisCache) Get

func (*AnalysisCache) Store

func (ac *AnalysisCache) Store(result *sniffer.AnalysisResult) string

type CheckRequest added in v0.2.9

type CheckRequest struct {
	Checks []string `json:"checks"`
}

type CheckResponse added in v0.2.9

type CheckResponse struct {
	Passed []string `json:"passed"`
}

type FeedbackTheme

type FeedbackTheme struct {
	// CLI Colors (ANSI)
	CLIHeader  string
	CLISuccess string
	CLIWarning string
	CLIDim     string
	CLILineNum string
	CLIReset   string

	// HTML Colors (CSS)
	BgPage        string
	BgSidebar     string
	BgCard        string
	BgCode        string
	Border        string
	TextPrimary   string
	TextSecondary string
	TextAccent    string
	TextLint      string
	TextCode      string
	MethodGet     string
	MethodPost    string
	MethodPut     string
	MethodDelete  string
	BtnSuccess    string
	BtnHover      string
}

type HostHandler

type HostHandler struct {
	Mux          *http.ServeMux
	Name         string
	Namespace    string
	Pages        *page.PageStore
	Translations Translations
	// contains filtered or unexported fields
}

func NewHostHandler

func NewHostHandler(c client.Client, name string, namespace string, log logr.Logger, cacheManager cache.CacheManager) *HostHandler

func (*HostHandler) AddOrUpdateTranslation

func (hh *HostHandler) AddOrUpdateTranslation(name string, translation *kdexv1alpha1.KDexTranslationSpec)

func (*HostHandler) AddOrUpdateUtilityPage

func (hh *HostHandler) AddOrUpdateUtilityPage(ph page.PageHandler)

func (*HostHandler) BuildMenuEntries

func (hh *HostHandler) BuildMenuEntries(
	ctx context.Context,
	entry *render.PageEntry,
	l *language.Tag,
	isDefaultLanguage bool,
	parent *page.PageHandler,
)

func (*HostHandler) CheckHandler added in v0.2.9

func (hh *HostHandler) CheckHandler(w http.ResponseWriter, r *http.Request)

func (*HostHandler) Checksum added in v0.2.7

func (hh *HostHandler) Checksum() string

func (*HostHandler) DesignMiddleware

func (hh *HostHandler) DesignMiddleware(next http.Handler) http.Handler

func (*HostHandler) FootScriptToHTML

func (hh *HostHandler) FootScriptToHTML(handler page.PageHandler) string

func (*HostHandler) GeneratePageCacheKey added in v0.2.7

func (hh *HostHandler) GeneratePageCacheKey(ph page.PageHandler, l language.Tag) string

func (*HostHandler) GetCacheManager

func (hh *HostHandler) GetCacheManager() cache.CacheManager

func (*HostHandler) GetOpenAPIBuilder

func (hh *HostHandler) GetOpenAPIBuilder() *ko.Builder

func (*HostHandler) GetStatus

func (hh *HostHandler) GetStatus() HostStatus

func (*HostHandler) GetUtilityPageHandler

func (hh *HostHandler) GetUtilityPageHandler(name kdexv1alpha1.KDexUtilityPageType) page.PageHandler

func (*HostHandler) HeadScriptToHTML

func (hh *HostHandler) HeadScriptToHTML(handler page.PageHandler) string

func (*HostHandler) InspectHandler

func (hh *HostHandler) InspectHandler(w http.ResponseWriter, r *http.Request)

InspectHandler serves the feedback UI

func (*HostHandler) IsAuthEnabled added in v0.2.10

func (hh *HostHandler) IsAuthEnabled() bool

func (*HostHandler) L10nRender

func (hh *HostHandler) L10nRender(
	handler page.PageHandler,
	pageMap map[string]any,
	l language.Tag,
	extraTemplateData map[string]any,
	translations *Translations,
) (string, error)

func (*HostHandler) L10nRenders

func (hh *HostHandler) L10nRenders(
	handler page.PageHandler,
	pageMaps map[language.Tag]map[string]any,
	translations *Translations,
) map[string]string

func (*HostHandler) LoginGet

func (hh *HostHandler) LoginGet(w http.ResponseWriter, r *http.Request)

func (*HostHandler) LoginPost

func (hh *HostHandler) LoginPost(w http.ResponseWriter, r *http.Request)

func (*HostHandler) LogoutPost

func (hh *HostHandler) LogoutPost(w http.ResponseWriter, r *http.Request)

func (*HostHandler) MetaToString

func (hh *HostHandler) MetaToString(handler page.PageHandler, l language.Tag) string

func (*HostHandler) NavigationGet

func (hh *HostHandler) NavigationGet(w http.ResponseWriter, r *http.Request)

func (*HostHandler) OpenAPIGet

func (hh *HostHandler) OpenAPIGet(w http.ResponseWriter, r *http.Request)

func (*HostHandler) RebuildMux

func (hh *HostHandler) RebuildMux()

func (*HostHandler) RemoveTranslation

func (hh *HostHandler) RemoveTranslation(name string)

func (*HostHandler) RemoveUtilityPage

func (hh *HostHandler) RemoveUtilityPage(name string)

func (*HostHandler) SchemaGet

func (hh *HostHandler) SchemaGet(w http.ResponseWriter, r *http.Request)

func (*HostHandler) SecuritySchemes

func (hh *HostHandler) SecuritySchemes() *openapi.SecuritySchemes

func (*HostHandler) ServeHTTP

func (hh *HostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HostHandler) SetHost

func (hh *HostHandler) SetHost(
	ctx context.Context,
	host *kdexv1alpha1.KDexHostSpec,
	status *kdexv1alpha1.KDexObjectStatus,
	packageReferences []kdexv1alpha1.PackageReference,
	themeAssets []kdexv1alpha1.Asset,
	scripts []kdexv1alpha1.ScriptDef,
	importmap string,
	paths map[string]ko.PathInfo,
	functions []kdexv1alpha1.KDexFunction,
	authExchanger *auth.Exchanger,
	authConfig *auth.Config,
	scheme string,
	snif *sniffer.RequestSniffer,
	reconcileTime time.Time,
)

TODO: add individual cache configurations

func (*HostHandler) ThemeAssetsToString

func (hh *HostHandler) ThemeAssetsToString() string

func (*HostHandler) TranslationGet

func (hh *HostHandler) TranslationGet(w http.ResponseWriter, r *http.Request)

type HostStatus

type HostStatus string
const (
	HostStatusInitializing HostStatus = "Initializing"
	HostStatusReady        HostStatus = "Ready"
	HostStatusDegraded     HostStatus = "Degraded"
	HostStatusProgressing  HostStatus = "Progressing"
)

type KDexFunctionHandler

type KDexFunctionHandler struct {
	Function *kdexv1alpha1.KDexFunction
	Handler  http.Handler
	// contains filtered or unexported fields
}

func (*KDexFunctionHandler) ServeHTTP

func (h *KDexFunctionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MintRequest added in v0.2.9

type MintRequest struct {
	Action   string `json:"action"`
	Audience string `json:"aud"`
	Scope    string `json:"scope"`
	Sub      string `json:"sub"`
	TTL      string `json:"ttl"`
}

type MintResponse added in v0.2.9

type MintResponse struct {
	Token string `json:"token"`
}

type Translations

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

func NewTranslations

func NewTranslations(defaultLanguage string, translations map[string]kdexv1alpha1.KDexTranslationSpec) (*Translations, error)

func (*Translations) Catalog

func (t *Translations) Catalog() *catalog.Builder

func (*Translations) Keys

func (t *Translations) Keys() []string

func (*Translations) Languages

func (t *Translations) Languages() []language.Tag

type VerifyRequest added in v0.2.9

type VerifyRequest struct {
	Token string `json:"token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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