sdk

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 4

README

Kumbuka SDK

Go SDK and development tooling for Kumbuka plugins.

Install a plugin

  1. Download the plugin's .kumbukaplugin file.
  2. Open Administration → Plugins in Kumbuka.
  3. Upload the package and select Install and enable.

For plugin development, SDK usage, manifests, capabilities, package formats, and the wire protocol, see the Kumbuka documentation.

License

Licensed under the Apache License 2.0.

Documentation

Overview

Package sdk provides the public Go SDK for Kumbuka plugins.

Index

Constants

View Source
const Version = api.Version

Version is the Kumbuka plugin API version supported by this SDK.

Variables

This section is empty.

Functions

func Icon

func Icon(name string, size int) (string, error)

Icon requests a host-rendered icon.

func Log

func Log(message string) error

Log sends a bounded log entry to Kumbuka.

func PermissionFor

func PermissionFor(method string) (string, bool)

PermissionFor returns the manifest permission required for a host capability.

func RegisterMacro

func RegisterMacro[T any](id string, parse func(string) (T, bool), render func(T) (Result, error))

RegisterMacro hides the parse/render transport and invocation serialization.

func RegisterModule

func RegisterModule(id string, handler Handler)

RegisterModule registers a handler for a manifest module. Call during init.

func ValidPermission

func ValidPermission(permission string) bool

ValidPermission reports whether permission is part of the public API contract.

func ValidRenderPolicy

func ValidRenderPolicy(name string) bool

ValidRenderPolicy reports whether name identifies a supported render policy.

func ValidSyntax

func ValidSyntax(name string) bool

ValidSyntax reports whether name identifies a supported declarative Markdown grammar.

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 NewClient

func NewClient(transport Transport) Client

NewClient creates a client. A nil transport uses the Kumbuka host.

func (Client) Attachments

func (c Client) Attachments() AttachmentClient

Attachments returns attachment operations on this client.

func (Client) Icon

func (c Client) Icon(name string, size int) (string, error)

Icon renders an icon through the public host capability.

func (Client) Log

func (c Client) Log(message string) error

Log records a host log message.

func (Client) Pages

func (c Client) Pages() PageClient

Pages returns page operations on this client.

func (Client) Settings

func (c Client) Settings() Values

Settings returns the calling plugin's settings namespace.

func (Client) Storage

func (c Client) Storage() Values

Storage returns the calling plugin's data namespace.

type Handler

type Handler func(Request) Result

Handler implements a declared module's render operation.

type IconRequest

type IconRequest = api.IconRequest

IconRequest identifies an icon to render through the host.

type LogMessage

type LogMessage = api.LogMessage

LogMessage carries one bounded plugin log entry.

type NavigationNode = api.NavigationNode

NavigationNode is an authorized navigation entry.

type Page

type Page = api.Page

Page is authorized public page metadata.

type PageClient

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

PageClient provides permission-checked page operations.

func Pages

func Pages() PageClient

Pages returns the host page capabilities.

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) Navigation

func (p PageClient) Navigation() ([]NavigationNode, error)

Navigation returns the prepared navigation tree.

func (PageClient) Search

func (p PageClient) Search(query PageQuery) ([]Page, error)

Search returns authorized pages matching a bounded query.

type PageContent

type PageContent = api.PageContent

PageContent is authorized Markdown source.

type PageQuery

type PageQuery = api.PageQuery

PageQuery is a bounded page search query.

type PageRef

type PageRef = api.PageRef

PageRef identifies one page for a capability request.

type Part

type Part = api.RenderPart

Part is literal intermediate output or Markdown rendered by Kumbuka.

type Property

type Property = api.Property

Property is one public page metadata property.

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 Request

type Request = api.RenderRequest

Request is a render invocation supplied by Kumbuka.

type Result

type Result = api.RenderResult

Result contains intermediate output returned to Kumbuka.

func Dispatch

func Dispatch(request Request) (result Result)

Dispatch runs a registered handler. It also supports native unit tests without WASM.

func Failure

func Failure(err error) Result

Failure returns a render error.

func Markdown

func Markdown(source string) Result

Markdown asks Kumbuka to render a nested Markdown fragment.

func Text

func Text(text string) Result

Text returns literal intermediate output; Kumbuka still applies its sanitizer.

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

type Transport func(method string, params, result any) error

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.

func Settings

func Settings() Values

Settings returns this plugin's settings namespace.

func Storage

func Storage() Values

Storage returns this plugin's data namespace.

func (Values) Get

func (v Values) Get(key string) (StoredValue, error)

Get reads a key, preserving the distinction between absent and empty values.

func (Values) Set

func (v Values) Set(key string, value []byte) error

Set writes opaque bytes. Kumbuka enforces permissions and namespace quotas.

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.

Jump to

Keyboard shortcuts

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