frontend

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIHTTPClient

func NewAPIHTTPClient() *http.Client

NewAPIHTTPClient builds the instrumented client required by a separately composed frontend presentation.

func WithRequestEditor

func WithRequestEditor(ctx context.Context, editor api.RequestEditorFn) context.Context

WithRequestEditor adds distribution metadata to frontend API requests.

Types

type CommunityPresentation

type CommunityPresentation struct{}

CommunityPresentation is the explicit route presentation for Community builds.

func (CommunityPresentation) RegisterPublicRoutes

func (CommunityPresentation) RegisterPublicRoutes(app *fiber.App, _ ManagedHost)

func (CommunityPresentation) RegisterWorkspaceRoutes

func (CommunityPresentation) RegisterWorkspaceRoutes(fiber.Router, ManagedHost)

type ManagedHost

type ManagedHost interface {
	OrganizationPage(fiber.Ctx, string, slug.Slug) OrganizationPage
	ProjectPage(fiber.Ctx, string, slug.Slug, slug.Slug) ProjectPage
	RequestEditor(fiber.Ctx) func(context.Context, *http.Request) error
	Render(fiber.Ctx, templ.Component) error
	RedirectToLogin(fiber.Ctx, string) error
	PublicPresentation(fiber.Ctx) PublicPresentation
	APIBaseURL() string
}

ManagedHost is the narrow core frontend contract available to route presentations. It preserves core authentication, shell, rendering, and request-forwarding behavior.

type OrganizationPage

type OrganizationPage struct {
	Shell     views.AuthenticatedShellData
	CanDelete bool
}

OrganizationPage supplies the shell and permissions for a distribution-owned organization page.

type ProjectPage

type ProjectPage struct {
	Shell             views.AuthenticatedShellData
	CanUpdateProjects bool
}

ProjectPage is the core shell and authorization state required by a managed project page.

type PublicPresentation

type PublicPresentation struct {
	GA4MeasurementID    string
	PublicOrigin        string
	DocumentationURL    string
	ApplicationURL      string
	RegistrationEnabled bool
}

PublicPresentation is the configured public-page state made available to hosted routes.

type RoutePresentation

type RoutePresentation interface {
	RegisterPublicRoutes(*fiber.App, ManagedHost)
	RegisterWorkspaceRoutes(fiber.Router, ManagedHost)
}

RoutePresentation supplies an explicit hosted or Community route set to the core frontend. The composition root must choose exactly one implementation.

type Router

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

func NewRouter

func NewRouter(
	frontendURL string,
	logger *slog.Logger,
	sessionStore *session.Store,
) (*Router, error)

func (*Router) RegisterRoutes

func (r *Router) RegisterRoutes(app *fiber.App, presentation RoutePresentation)

func (*Router) SetAllowPrivateDataSourceHosts

func (r *Router) SetAllowPrivateDataSourceHosts(enabled bool)

SetAllowPrivateDataSourceHosts controls private-host controls on data source forms.

func (*Router) SetApplicationURL

func (r *Router) SetApplicationURL(applicationURL string)

SetApplicationURL keeps account links on the browser origin, including when the landing page uses another host.

func (*Router) SetDocumentationURL

func (r *Router) SetDocumentationURL(documentationURL string)

SetDocumentationURL configures the validated public documentation destination.

func (*Router) SetPublicAnalytics

func (r *Router) SetPublicAnalytics(destinations map[string]string)

SetPublicAnalytics binds validated measurement IDs to their public origins.

func (*Router) SetPublicOrigins

func (r *Router) SetPublicOrigins(publicOrigins []string)

SetPublicOrigins configures the validated browser origins used for public URLs.

func (*Router) SetSelfServiceRegistrationEnabled

func (r *Router) SetSelfServiceRegistrationEnabled(enabled bool)

SetSelfServiceRegistrationEnabled controls whether unauthenticated users can create accounts.

func (*Router) SetWorkspacePrivacyURL

func (r *Router) SetWorkspacePrivacyURL(value string)

SetWorkspacePrivacyURL configures workspace privacy help.

Directories

Path Synopsis
Package dsparser provides connection URI parsers for each supported datasource type.
Package dsparser provides connection URI parsers for each supported datasource type.
e2e
support/http-oauth-fixture command
This fixture runs production SSR against synthetic API replies; it does not implement the OAuth protocol or persistence.
This fixture runs production SSR against synthetic API replies; it does not implement the OAuth protocol or persistence.
Package runlineage projects an immutable pipeline version and persisted run facts into the read-only lineage shown on run detail surfaces.
Package runlineage projects an immutable pipeline version and persisted run facts into the read-only lineage shown on run detail surfaces.
templ: version: v0.3.1020
templ: version: v0.3.1020

Jump to

Keyboard shortcuts

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