embed

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package embed provides external embed integration for oCMS. Supports embedding third-party services like Dify AI chat.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbedListPage added in v0.9.0

func EmbedListPage(pc *adminviews.PageContext, data EmbedListViewData) templ.Component

func EmbedProviderPage added in v0.9.0

func EmbedProviderPage(pc *adminviews.PageContext, data EmbedProviderViewData) templ.Component

func GenerateSiteContentMarkdown added in v0.15.0

func GenerateSiteContentMarkdown(ctx context.Context, q *store.Queries) (string, error)

GenerateSiteContentMarkdown builds a markdown document from all published pages, posts, tags, and categories.

func GenerateUserGuideMarkdown added in v0.15.0

func GenerateUserGuideMarkdown(ctx context.Context, q *store.Queries) (string, error)

GenerateUserGuideMarkdown builds a markdown user guide based on actual site features detected from config, menus, categories, tags, and forms.

Types

type EmbedListViewData added in v0.9.0

type EmbedListViewData struct {
	Providers []ProviderListItem
}

EmbedListViewData holds data for the embed providers list page.

type EmbedProviderViewData added in v0.9.0

type EmbedProviderViewData struct {
	ProviderID   string
	ProviderName string
	ProviderDesc string
	IsEnabled    bool
	Schema       []providers.SettingField
}

EmbedProviderViewData holds data for the embed provider settings page.

type Module

type Module struct {
	module.BaseModule
	// contains filtered or unexported fields
}

Module implements the module.Module interface for the embed module.

func New

func New() *Module

New creates a new instance of the embed module.

func (*Module) AdminURL

func (m *Module) AdminURL() string

AdminURL returns the admin dashboard URL for the module.

func (*Module) Init

func (m *Module) Init(ctx *module.Context) error

Init initializes the module with the given context.

func (*Module) IssueProxyToken added in v0.18.1

func (m *Module) IssueProxyToken(origin string) (string, time.Time, error)

IssueProxyToken mints a signed proxy token bound to the given origin. Returns an error if the module has no proxy secret configured or the origin is empty. Used by providers at render time via RenderContext.

func (*Module) Migrations

func (m *Module) Migrations() []module.Migration

Migrations returns database migrations for the module.

func (*Module) RegisterAdminRoutes

func (m *Module) RegisterAdminRoutes(r chi.Router)

RegisterAdminRoutes registers admin routes for the module.

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(r chi.Router)

RegisterRoutes registers public routes for the module.

func (*Module) ReloadSettings

func (m *Module) ReloadSettings() error

ReloadSettings reloads settings from the database.

func (*Module) Shutdown

func (m *Module) Shutdown() error

Shutdown performs cleanup when the module is shutting down.

func (*Module) SidebarLabel

func (m *Module) SidebarLabel() string

SidebarLabel returns the display label for the admin sidebar.

func (*Module) TemplateFuncs

func (m *Module) TemplateFuncs() template.FuncMap

TemplateFuncs returns template functions provided by the module.

embedHead and embedBody accept (nonce, origin) as variadic args. The origin is required for providers that issue render-time proxy tokens bound to the page origin; callers that don't have an origin can pass an empty string, in which case token-dependent providers fall back to their "optional" configuration.

func (*Module) TranslationsFS

func (m *Module) TranslationsFS() embed.FS

TranslationsFS returns the embedded filesystem containing module translations.

type ProviderListItem

type ProviderListItem struct {
	ID           string
	Name         string
	Description  string
	IsEnabled    bool
	IsConfigured bool
}

ProviderListItem represents a provider in the list view.

type ProviderSettings

type ProviderSettings struct {
	ID         int64
	ProviderID string
	Settings   map[string]string
	IsEnabled  bool
	Position   int
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

ProviderSettings represents the stored settings for a provider.

Directories

Path Synopsis
Package providers defines the Provider interface and common types for embed providers.
Package providers defines the Provider interface and common types for embed providers.

Jump to

Keyboard shortcuts

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