Skip to content

bonk

import "go.bonk.build/api/go"

Index

Constants

const PluginType = "bonk"

Variables

var Handshake = goplugin.HandshakeConfig{
    ProtocolVersion:  0,
    MagicCookieKey:   "BONK_PLUGIN",
    MagicCookieValue: "backend",
}

func Serve

func Serve(backends ...BonkBackend)

Call from main() to start the plugin gRPC server.

type BonkBackend

Represents a backend capable of performing tasks.

type BonkBackend struct {
    Name         string
    Outputs      []string
    ParamsSchema cue.Value
    Exec         func(context.Context, TaskParams[cue.Value]) error
}

func NewBackend

func NewBackend[Params any](name string, outputs []string, exec func(context.Context, *TaskParams[Params]) error) BonkBackend

Factory to create a new task backend.

type TaskParams

The inputs passed to a task backend.

type TaskParams[Params any] struct {
    Params Params
    Inputs []string
    OutDir string
}

Generated by gomarkdoc