Documentation
¶
Index ¶
- Variables
- func APIConfigGetName() string
- func APIConfigGetName_test(t *testing.T)
- func CssConfigGetName() string
- func FilterAllowedQueryParams(req *http.Request, allowedKeys []string) url.Values
- func HTMLConfigGetName() string
- func JavaScriptConfigGetName() string
- func LocalJSONConfigGetName() string
- func MenuConfigGetName() string
- func MultipleImagesConfigGetName() string
- func PluginRenderGetName() string
- func SingleImageConfigGetName() string
- func SortHyperMediasBySection(pagesBySection map[string][]composite.HyperMediaConfig, options SortOptions) (map[string][]composite.HyperMediaConfig, error)
- func StyleConfigGetName() string
- func TextConfigGetName() string
- type APIConfig
- type APIRenderer
- type ApiRenderConfig
- type CssConfig
- type CssRenderer
- type HTMLConfig
- type HTMLRenderer
- type HyperMediaConfig
- type ImageProcessor
- type JavaScriptConfig
- type JavaScriptRenderer
- type LocalJSONConfig
- type LocalJSONRenderer
- type MenuConfig
- type MenuRenderer
- type MultipleImagesConfig
- type MultipleImagesRenderer
- type PluginConfig
- type PluginRenderer
- type RenderImageConfig
- type SingleImageConfig
- type SingleImageRenderer
- type SortOptions
- type StyleConfig
- type StyleRenderer
- type TextConfig
- type TextRenderer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func APIConfigGetName ¶
func APIConfigGetName() string
func APIConfigGetName_test ¶
func CssConfigGetName ¶
func CssConfigGetName() string
func FilterAllowedQueryParams ¶
FilterAllowedQueryParams returns only the query parameters whose keys are in allowedKeys. If allowedKeys is empty, it returns an empty url.Values (no parameters).
func HTMLConfigGetName ¶
func HTMLConfigGetName() string
func JavaScriptConfigGetName ¶
func JavaScriptConfigGetName() string
func LocalJSONConfigGetName ¶
func LocalJSONConfigGetName() string
func MenuConfigGetName ¶
func MenuConfigGetName() string
func MultipleImagesConfigGetName ¶
func MultipleImagesConfigGetName() string
func PluginRenderGetName ¶
func PluginRenderGetName() string
func SingleImageConfigGetName ¶
func SingleImageConfigGetName() string
func SortHyperMediasBySection ¶
func SortHyperMediasBySection(pagesBySection map[string][]composite.HyperMediaConfig, options SortOptions) (map[string][]composite.HyperMediaConfig, error)
func StyleConfigGetName ¶
func StyleConfigGetName() string
func TextConfigGetName ¶
func TextConfigGetName() string
Types ¶
type APIConfig ¶
type APIConfig struct {
shared.Component `mapstructure:",squash"`
ApiRenderConfig `mapstructure:",squash"`
MetaDocDescription string `mapstructure:"@doc" description:"<API_RENDER> description" example:"{!{api-render-@doc.hyperbricks}}"`
}
type APIRenderer ¶
type APIRenderer struct {
renderer.ComponentRenderer
}
func (*APIRenderer) Render ¶
func (pr *APIRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*APIRenderer) Types ¶
func (r *APIRenderer) Types() []string
type ApiRenderConfig ¶
type ApiRenderConfig struct {
Endpoint string `mapstructure:"endpoint" validate:"required" description:"The API endpoint" example:"{!{api-render-endpoint.hyperbricks}}"`
Method string `` /* 162-byte string literal not displayed */
Headers map[string]string `mapstructure:"headers" description:"Optional HTTP headers for API requests" example:"{!{api-render-headers.hyperbricks}}"`
Body string `` /* 205-byte string literal not displayed */
Template string `` /* 152-byte string literal not displayed */
Inline string `` /* 168-byte string literal not displayed */
Values map[string]interface{} `mapstructure:"values" description:"Key-value pairs for template rendering" example:"{!{api-render-values.hyperbricks}}"`
Username string `mapstructure:"username" description:"Username for basic auth" example:"{!{api-render-username.hyperbricks}}"`
Password string `mapstructure:"password" description:"Password for basic auth" example:"{!{api-render-password.hyperbricks}}"`
Status int `mapstructure:"status" exclude:"true"` // This adds {{.Status}} to the root level of the template data
SetCookie string `mapstructure:"setcookie" description:"Set template for cookie" example:"{!{api-render-setcookie.hyperbricks}}"`
AllowedQueryKeys []string `mapstructure:"querykeys" description:"Set allowed proxy query keys" example:"{!{api-render-querykeys.hyperbricks}}"`
QueryParams map[string]string `` /* 131-byte string literal not displayed */
JwtSecret string `` /* 221-byte string literal not displayed */
JwtClaims map[string]string `mapstructure:"jwtclaims" description:"jwt claim map" example:"{!{api-render-jwt-claims.hyperbricks}}"`
Debug bool `mapstructure:"debug" description:"Debug the response data" example:"{!{api-render-debug.hyperbricks}}"`
DebugPanel bool `` /* 190-byte string literal not displayed */
}
type CssConfig ¶
type CssRenderer ¶
type CssRenderer struct{}
func (*CssRenderer) Render ¶
func (sr *CssRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*CssRenderer) Types ¶
func (r *CssRenderer) Types() []string
type HTMLConfig ¶
type HTMLConfig struct {
shared.Component `mapstructure:",squash"`
Value string `mapstructure:"value" validate:"required" description:"The raw HTML content" example:"{!{html-value.hyperbricks}}"`
TrimSpace bool `` /* 168-byte string literal not displayed */
}
func (*HTMLConfig) Validate ¶
func (hc *HTMLConfig) Validate() []error
type HTMLRenderer ¶
type HTMLRenderer struct{}
func (*HTMLRenderer) Render ¶
func (hr *HTMLRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*HTMLRenderer) Types ¶
func (r *HTMLRenderer) Types() []string
type HyperMediaConfig ¶
type ImageProcessor ¶
type ImageProcessor struct{}
func (*ImageProcessor) ProcessMultipleImages ¶
func (ir *ImageProcessor) ProcessMultipleImages(config MultipleImagesConfig) (string, error)
func (*ImageProcessor) ProcessSingleImage ¶
func (ir *ImageProcessor) ProcessSingleImage(config SingleImageConfig) (string, error)
type JavaScriptConfig ¶
type JavaScriptConfig struct {
shared.Component `mapstructure:",squash"`
Inline string `` /* 168-byte string literal not displayed */
Link string `mapstructure:"link" description:"Use link for a script tag with a src attribute" example:"{!{javascript-link.hyperbricks}}"`
File string `` /* 168-byte string literal not displayed */
}
func (*JavaScriptConfig) Validate ¶
func (js *JavaScriptConfig) Validate() []error
type JavaScriptRenderer ¶
type JavaScriptRenderer struct{}
func (*JavaScriptRenderer) Render ¶
func (jsr *JavaScriptRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*JavaScriptRenderer) Types ¶
func (r *JavaScriptRenderer) Types() []string
type LocalJSONConfig ¶
type LocalJSONConfig struct {
shared.Component `mapstructure:",squash"`
FilePath string `mapstructure:"file" validate:"required" description:"Path to the local JSON file" example:"{!{json-file.hyperbricks}}"`
Template string `` /* 146-byte string literal not displayed */
Inline string `` /* 167-byte string literal not displayed */
Values map[string]interface{} `mapstructure:"values" description:"Key-value pairs for template rendering" example:"{!{json-values.hyperbricks}}"`
Debug bool `mapstructure:"debug" description:"Debug the response data" example:"{!{json-debug.hyperbricks}}"`
}
func (*LocalJSONConfig) Validate ¶
func (config *LocalJSONConfig) Validate() []error
type LocalJSONRenderer ¶
func (*LocalJSONRenderer) Render ¶
func (renderer *LocalJSONRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*LocalJSONRenderer) Types ¶
func (r *LocalJSONRenderer) Types() []string
type MenuConfig ¶
type MenuConfig struct {
shared.Component `mapstructure:",squash"`
Section string `` /* 132-byte string literal not displayed */
Order string `` /* 148-byte string literal not displayed */
Sort string `` /* 169-byte string literal not displayed */
Active string `` /* 129-byte string literal not displayed */
Item string `mapstructure:"item" validate:"required" description:"Template for regular menu items." example:"{!{menu-item.hyperbricks}}"`
Enclose string `mapstructure:"enclose" description:"Template to enclose the menu items." example:"{!{menu-enclose.hyperbricks}}"`
HyperMediasBySection map[string][]composite.HyperMediaConfig
}
func (*MenuConfig) Validate ¶
func (mc *MenuConfig) Validate() []error
type MenuRenderer ¶
type MenuRenderer struct {
TemplateProvider func(templateName string) (string, bool)
HyperMediasBySection map[string][]composite.HyperMediaConfig
CurrentRoute string
}
func (*MenuRenderer) Render ¶
func (mr *MenuRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*MenuRenderer) Types ¶
func (r *MenuRenderer) Types() []string
type MultipleImagesConfig ¶
type MultipleImagesConfig struct {
shared.Component `mapstructure:",squash"`
Directory string `` /* 143-byte string literal not displayed */
Width int `` /* 147-byte string literal not displayed */
Height int `` /* 150-byte string literal not displayed */
Id string `mapstructure:"id" description:"Id of images with a index added to it" example:"{!{images-id.hyperbricks}}"`
Class string `mapstructure:"class" description:"CSS class for styling the image" example:"{!{images-class.hyperbricks}}"`
IsStatic bool `mapstructure:"is_static" description:"Flag indicating if the images are static" example:"{!{images-is_static.hyperbricks}}"`
Alt string `mapstructure:"alt" description:"Alternative text for the image" example:"{!{images-alt.hyperbricks}}"`
Title string `mapstructure:"title" description:"The title attribute of the image" example:"{!{images-title.hyperbricks}}"`
Quality int `mapstructure:"quality" description:"Image quality for optimization" example:"{!{images-quality.hyperbricks}}"`
Loading string `mapstructure:"loading" description:"Lazy loading strategy (e.g., 'lazy', 'eager')" example:"{!{images-loading.hyperbricks}}"`
}
func (*MultipleImagesConfig) Validate ¶
func (config *MultipleImagesConfig) Validate() []error
type MultipleImagesRenderer ¶
type MultipleImagesRenderer struct {
ImageProcessorInstance *ImageProcessor
}
func (*MultipleImagesRenderer) Render ¶
func (mir *MultipleImagesRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*MultipleImagesRenderer) Types ¶
func (r *MultipleImagesRenderer) Types() []string
type PluginConfig ¶
type PluginConfig struct {
shared.Component `mapstructure:",squash"`
PluginName string `mapstructure:"plugin" description:"Name of the plugin for lookup"`
Classes []string `mapstructure:"classes" description:"Optional CSS classes for the link" example:"{!{plugin-classes.hyperbricks}}"`
Data map[string]interface{} `mapstructure:"data"`
}
type PluginRenderer ¶
type PluginRenderer struct {
renderer.CompositeRenderer
}
func (*PluginRenderer) LoadAndRender ¶
func (r *PluginRenderer) LoadAndRender(instance interface{}, ctx context.Context) (string, []error)
func (*PluginRenderer) Render ¶
func (r *PluginRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*PluginRenderer) Types ¶
func (r *PluginRenderer) Types() []string
type RenderImageConfig ¶
type RenderImageConfig struct {
Single *SingleImageConfig `mapstructure:"single"`
Multiple *MultipleImagesConfig `mapstructure:"multiple"`
}
type SingleImageConfig ¶
type SingleImageConfig struct {
shared.Component `mapstructure:",squash"`
Src string `mapstructure:"src" validate:"required" description:"The source URL of the image" example:"{!{image-src.hyperbricks}}"`
Width int `` /* 145-byte string literal not displayed */
Height int `` /* 148-byte string literal not displayed */
Alt string `mapstructure:"alt" description:"Alternative text for the image" example:"{!{image-alt.hyperbricks}}"`
Title string `mapstructure:"title" description:"The title attribute of the image" example:"{!{image-title.hyperbricks}}"`
Id string `mapstructure:"id" description:"Id of image" example:"{!{image-id.hyperbricks}}"`
Class string `mapstructure:"class" description:"CSS class for styling the image" example:"{!{image-class.hyperbricks}}"`
Quality int `mapstructure:"quality" description:"Image quality for optimization" example:"{!{image-quality.hyperbricks}}"`
Loading string `mapstructure:"loading" description:"Lazy loading strategy (e.g., 'lazy', 'eager')" example:"{!{image-loading.hyperbricks}}"`
IsStatic bool `mapstructure:"is_static" description:"Flag indicating if the image is static" example:"{!{image-is_static.hyperbricks}}"`
}
func (*SingleImageConfig) Validate ¶
func (config *SingleImageConfig) Validate() []error
type SingleImageRenderer ¶
type SingleImageRenderer struct {
ImageProcessorInstance *ImageProcessor
}
func (*SingleImageRenderer) Render ¶
func (sir *SingleImageRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*SingleImageRenderer) Types ¶
func (r *SingleImageRenderer) Types() []string
type SortOptions ¶
type StyleConfig ¶
type StyleConfig struct {
shared.Component `mapstructure:",squash"`
File string `mapstructure:"file" validate:"required" description:"Path to the CSS file" example:"{!{styles-file.hyperbricks}}"`
}
func (*StyleConfig) Validate ¶
func (style *StyleConfig) Validate() []error
type StyleRenderer ¶
type StyleRenderer struct{}
func (*StyleRenderer) Render ¶
func (sr *StyleRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*StyleRenderer) Types ¶
func (r *StyleRenderer) Types() []string
type TextConfig ¶
type TextConfig struct {
shared.Component `mapstructure:",squash"`
Value string `mapstructure:"value" validate:"required" description:"The paragraph content" example:"{!{text-value.hyperbricks}}"`
}
func (*TextConfig) Validate ¶
func (tc *TextConfig) Validate() []error
type TextRenderer ¶
type TextRenderer struct{}
func (*TextRenderer) Render ¶
func (tr *TextRenderer) Render(instance interface{}, ctx context.Context) (string, []error)
func (*TextRenderer) Types ¶
func (r *TextRenderer) Types() []string
Click to show internal directories.
Click to hide internal directories.