Documentation
¶
Overview ¶
Package sdk provides the public Go SDK for Kumbuka plugins.
Index ¶
- Constants
- func Icon(name string, size int) (string, error)
- func Log(message string) error
- func PermissionFor(method string) (string, bool)
- func RegisterMacro[T any](id string, parse func(string) (T, bool), render func(T) (Result, error))
- func RegisterModule(id string, handler Handler)
- func RegisterWidget(id string, render func(WidgetContext) (Result, error))
- func RenderPolicyEnabled(features map[string]bool, name string) bool
- func RenderPolicyFeature(name string) string
- func ValidPermission(permission string) bool
- func ValidRenderPolicy(name string) bool
- func ValidSyntax(name string) bool
- func ValidWidgetSurface(surface string) bool
- type Attachment
- type AttachmentClient
- type AttachmentRead
- type CapabilityRequest
- type CapabilityResponse
- type Client
- type Handler
- type IconRequest
- type LogMessage
- type NavigationNode
- type Page
- type PageClient
- func (p PageClient) Content(slug string) (PageContent, error)
- func (p PageClient) Get(slug string) (Page, error)
- func (p PageClient) Links(slug string) (PageLinks, error)
- func (p PageClient) Navigation() ([]NavigationNode, error)
- func (p PageClient) Revisions(query RevisionQuery) (RevisionHistory, error)
- func (p PageClient) Search(query PageQuery) ([]Page, error)
- type PageContent
- type PageLink
- type PageLinks
- type PageQuery
- type PageRef
- type Part
- type Property
- type RenderPart
- type RenderRequest
- type RenderResult
- type Request
- type Result
- type Revision
- type RevisionHistory
- type RevisionQuery
- type StorageValue
- type StoredValue
- type Transport
- type Values
- type WidgetAction
- type WidgetContext
Constants ¶
const Version = api.Version
Version is the Kumbuka plugin API version supported by this SDK.
Variables ¶
This section is empty.
Functions ¶
func PermissionFor ¶
PermissionFor returns the manifest permission required for a host capability.
func RegisterMacro ¶
RegisterMacro hides the parse/render transport and invocation serialization.
func RegisterModule ¶
RegisterModule registers a handler for a manifest module. Call during init.
func RegisterWidget ¶ added in v0.4.0
func RegisterWidget(id string, render func(WidgetContext) (Result, error))
RegisterWidget registers a widget renderer for one manifest widget module.
func RenderPolicyEnabled ¶ added in v0.3.0
RenderPolicyEnabled reports whether one render-policy marker is active for a request.
func RenderPolicyFeature ¶ added in v0.3.0
RenderPolicyFeature returns the request feature key for one render-policy marker.
func ValidPermission ¶
ValidPermission reports whether permission is part of the public API contract.
func ValidRenderPolicy ¶
ValidRenderPolicy reports whether name is a valid public render-policy marker.
func ValidSyntax ¶
ValidSyntax reports whether name identifies a supported declarative Markdown grammar.
func ValidWidgetSurface ¶ added in v0.4.0
ValidWidgetSurface reports whether surface is a supported widget placement.
Types ¶
type Attachment ¶
type Attachment = api.Attachment
Attachment contains authorized attachment bytes and metadata.
type AttachmentClient ¶
type AttachmentClient struct {
// contains filtered or unexported fields
}
AttachmentClient reads attachments authorized by the current request scope.
func Attachments ¶
func Attachments() AttachmentClient
Attachments returns the host attachment capability.
func (AttachmentClient) Read ¶
func (a AttachmentClient) Read(request AttachmentRead) (Attachment, error)
Read requests a bounded attachment byte range.
type AttachmentRead ¶
type AttachmentRead = api.AttachmentRead
AttachmentRead requests a bounded attachment range.
type CapabilityRequest ¶
type CapabilityRequest = api.CapabilityRequest
CapabilityRequest is the low-level host capability request envelope.
type CapabilityResponse ¶
type CapabilityResponse = api.CapabilityResponse
CapabilityResponse is the low-level host capability response envelope.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides typed capabilities bound to one transport.
func (Client) Attachments ¶
func (c Client) Attachments() AttachmentClient
Attachments returns attachment operations on this client.
func (Client) Pages ¶
func (c Client) Pages() PageClient
Pages returns page operations on this client.
type IconRequest ¶
type IconRequest = api.IconRequest
IconRequest identifies an icon to render through the host.
type NavigationNode ¶
type NavigationNode = api.NavigationNode
NavigationNode is an authorized navigation entry.
type PageClient ¶
type PageClient struct {
// contains filtered or unexported fields
}
PageClient provides permission-checked page operations.
func (PageClient) Content ¶
func (p PageClient) Content(slug string) (PageContent, error)
Content reads authorized Markdown source.
func (PageClient) Get ¶
func (p PageClient) Get(slug string) (Page, error)
Get returns authorized metadata for a canonical page slug.
func (PageClient) Links ¶ added in v0.4.0
func (p PageClient) Links(slug string) (PageLinks, error)
Links returns authorized incoming and outgoing wiki-link relationships.
func (PageClient) Navigation ¶
func (p PageClient) Navigation() ([]NavigationNode, error)
Navigation returns the prepared navigation tree.
func (PageClient) Revisions ¶ added in v0.4.0
func (p PageClient) Revisions(query RevisionQuery) (RevisionHistory, error)
Revisions returns bounded public revision metadata for one authorized page.
type Part ¶
type Part = api.RenderPart
Part is literal intermediate output or Markdown rendered by Kumbuka.
type RenderPart ¶
type RenderPart = api.RenderPart
RenderPart is one wire-level render output fragment.
type RenderRequest ¶
type RenderRequest = api.RenderRequest
RenderRequest is the wire-level render request used by the Kumbuka host.
type RenderResult ¶
type RenderResult = api.RenderResult
RenderResult is the wire-level render result used by the Kumbuka host.
type Result ¶
type Result = api.RenderResult
Result contains intermediate output returned to Kumbuka.
func Dispatch ¶
Dispatch runs a registered handler. It also supports native unit tests without WASM.
type RevisionHistory ¶ added in v0.4.0
type RevisionHistory = api.RevisionHistory
RevisionHistory contains bounded revision metadata and the total count.
type RevisionQuery ¶ added in v0.4.0
type RevisionQuery = api.RevisionQuery
RevisionQuery selects bounded page revision metadata.
type StorageValue ¶
type StorageValue = api.StorageValue
StorageValue carries a plugin storage key and optional value.
type StoredValue ¶
type StoredValue = api.StoredValue
StoredValue distinguishes an absent key from an empty value.
type Transport ¶
Transport enables native tests to supply fake host capabilities. Production clients use Kumbuka's WASM transport; permissions remain enforced by the host.
type Values ¶
type Values struct {
// contains filtered or unexported fields
}
Values is the calling plugin's host-managed key/value namespace.
type WidgetAction ¶ added in v0.4.0
type WidgetAction = api.WidgetAction
WidgetAction is one safe host-rendered widget control.
type WidgetContext ¶ added in v0.4.0
type WidgetContext = api.WidgetContext
WidgetContext describes one host widget invocation.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
kumbuka-plugin
command
Command kumbuka-plugin develops Go plugins for Kumbuka's WASI runtime.
|
Command kumbuka-plugin develops Go plugins for Kumbuka's WASI runtime. |
|
internal
|
|
|
api
Package api contains the versioned wire types shared by Kumbuka and WASM plugins.
|
Package api contains the versioned wire types shared by Kumbuka and WASM plugins. |
|
build
Package build implements development-time validation and standard Go/WASI packaging.
|
Package build implements development-time validation and standard Go/WASI packaging. |
|
cli
Package cli implements the kumbuka-plugin command.
|
Package cli implements the kumbuka-plugin command. |
|
Package markdown provides reusable Markdown parsing helpers for Kumbuka plugins.
|
Package markdown provides reusable Markdown parsing helpers for Kumbuka plugins. |
|
Package pluginpackage reads bounded, versioned .kumbukaplugin ZIP archives.
|
Package pluginpackage reads bounded, versioned .kumbukaplugin ZIP archives. |