sdk

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package sdk defines the contract between the Gophenberg core and its plugins. It is the only Gophenberg package a plugin may import.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	DatabaseURL string
	Posts       PostReader
	Getenv      func(string) string
}

Deps carries the host-provided dependencies a plugin's Register function receives at registration.

type Migrator

type Migrator = pluginkit.Migrator

Migrator is implemented by plugins that own database schema, which the host migrates before starting any plugin.

type Plugin

type Plugin = pluginkit.Plugin

Plugin is an independently addable unit of functionality with a managed lifecycle.

type Post

type Post struct {
	ID          uuid.UUID
	Type        string
	Slug        string
	Title       string
	Excerpt     string
	Content     string
	PublishedAt time.Time
	UpdatedAt   time.Time
}

Post is a published content object as plugins see it: the Content field holds Gutenberg-serialized block HTML, sanitized for public delivery.

type PostReader

type PostReader interface {
	ListPublished(ctx context.Context, postType string, limit int) ([]Post, error)
}

PostReader gives plugins read access to published content.

type PublicPathProvider

type PublicPathProvider = pluginkit.PublicPathProvider

PublicPathProvider is implemented by plugins declaring session-exempt public paths.

type RouteProvider

type RouteProvider = pluginkit.RouteProvider

RouteProvider is implemented by plugins that expose HTTP endpoints under their own namespace.

Jump to

Keyboard shortcuts

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