Documentation
¶
Overview ¶
Package providers defines the Provider interface and common types for embed providers.
Index ¶
- type DifyProvider
- func (p *DifyProvider) Description() string
- func (p *DifyProvider) ID() string
- func (p *DifyProvider) Name() string
- func (p *DifyProvider) RenderBody(settings map[string]string) template.HTML
- func (p *DifyProvider) RenderHead(_ map[string]string) template.HTML
- func (p *DifyProvider) SettingsSchema() []SettingField
- func (p *DifyProvider) Validate(settings map[string]string) error
- type Provider
- type SelectOption
- type SettingField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DifyProvider ¶
type DifyProvider struct{}
DifyProvider implements the Provider interface for Dify AI chat.
func (*DifyProvider) Description ¶
func (p *DifyProvider) Description() string
Description returns the provider description.
func (*DifyProvider) RenderBody ¶
func (p *DifyProvider) RenderBody(settings map[string]string) template.HTML
RenderBody returns the custom Dify chat widget.
func (*DifyProvider) RenderHead ¶
func (p *DifyProvider) RenderHead(_ map[string]string) template.HTML
RenderHead returns HTML for the <head> section.
func (*DifyProvider) SettingsSchema ¶
func (p *DifyProvider) SettingsSchema() []SettingField
SettingsSchema returns the configuration fields for Dify.
type Provider ¶
type Provider interface {
// ID returns the unique identifier for the provider (e.g., "dify", "youtube")
ID() string
// Name returns the display name for the provider
Name() string
// Description returns a brief description of the provider
Description() string
// SettingsSchema returns the configuration fields for the provider
SettingsSchema() []SettingField
// Validate validates the provider settings
// Returns nil if valid, or an error describing the issue
Validate(settings map[string]string) error
// RenderHead returns HTML to inject in the <head> section
RenderHead(settings map[string]string) template.HTML
// RenderBody returns HTML to inject before </body>
RenderBody(settings map[string]string) template.HTML
}
Provider defines the interface for embed providers. Each provider implements a specific third-party service integration.
type SelectOption ¶
SelectOption represents an option for select fields.
type SettingField ¶
type SettingField struct {
// ID is the unique identifier for the field (used in JSON storage)
ID string
// Name is the display name for the field
Name string
// Description provides additional context for the field
Description string
// Type is the field type: "text", "textarea", "url", "color", "select", "checkbox"
Type string
// Options are the available choices for "select" type fields
Options []SelectOption
// Required indicates if the field must have a value when enabled
Required bool
// Default is the default value for the field
Default string
// Placeholder is the placeholder text for input fields
Placeholder string
}
SettingField defines a configuration field for a provider.
Click to show internal directories.
Click to hide internal directories.