Documentation
¶
Index ¶
- Variables
- func AllowAll(nm string, pm core.PermissionAction) core.Permission
- func AllowOne(nm string, pm core.PermissionAction, scope string) core.Permission
- func Import(deps ...core.ComponentImport) []core.ComponentImport
- func MCPIcon(filename string) mcpModTask
- func MCPInstructions(ins string) mcpModTask
- func NewMCPTool[T any](fn func(input T, t *TaskContext) *MCPToolResult, cfg MCPToolConfig) mcpModTask
- type Container
- func (c *Container) GetKeychain() core.Keychain
- func (c *Container) GetStorage() core.Storage
- func (c *Container) HasPermission(act core.PermissionAction, scope string) bool
- func (c *Container) MakeDirectory(name string) bool
- func (c *Container) Namespace() string
- func (c *Container) ReadFile(name string) ([]byte, bool)
- func (c *Container) TemporaryFile() string
- func (c *Container) WriteFile(name string, contents []byte) bool
- type ContainerEntityStorage
- func (s *ContainerEntityStorage[T]) Delete(id int64)
- func (s *ContainerEntityStorage[T]) DeleteWhere(filter FilterFn[T])
- func (s *ContainerEntityStorage[T]) Find(filter FilterFn[T]) []T
- func (s *ContainerEntityStorage[T]) Get(id int64) *T
- func (s *ContainerEntityStorage[T]) Insert(record T) int64
- func (s *ContainerEntityStorage[T]) Update(id int64, record T)
- type FilterFn
- type HourSpecificTask
- type MCPDate
- type MCPTask
- type MCPToolConfig
- type MCPToolResult
- type MCPToolType
- type RouteResult
- type RouteResultStatus
- type RouteTask
- type RouteTaskFunction
- type RouteTaskNoInput
- type Runtime
- type StartupTask
- type Task
- func NewMCPTask(name, version string, tools ...mcpModTask) Task
- func NewPublicRouteTask[T any](fn RouteTaskFunction[T]) Task
- func NewRouteTask[T any](fn RouteTaskFunction[T]) Task
- func NewStartupTask(handler func(*TaskContext)) Task
- func NewTask(fn any, impl TaskImpl) Task
- func NewTimeSpecificTask(hour int, minute int, handler func(*TaskContext)) Task
- func NewTimedTask(duration time.Duration, handler func(*TaskContext)) Task
- func NewTriggerTask[T any](trigger component.ComponentTrigger[T], fn TriggerTaskFn[T]) Task
- type TaskAttachContext
- func (tac *TaskAttachContext) HTTP(path string, handler http.HandlerFunc)
- func (tac *TaskAttachContext) TaskContext(ctx context.Context) *TaskContext
- func (tac *TaskAttachContext) TaskContextGlobal() *TaskContext
- func (tac *TaskAttachContext) Trigger(ns, name string, body func([]byte))
- func (tac *TaskAttachContext) VerifyAuthentication(secret string) bool
- type TaskContext
- func (c *TaskContext) ExecuteFunction(cname, fname string, args any) ([]byte, error)
- func (c *TaskContext) OpenUrl(url string) bool
- func (c *TaskContext) Run(maxTime time.Duration, cmd string, args ...string) core.TerminalResult
- func (c *TaskContext) RunInDirectory(maxTime time.Duration, wd, cmd string, args ...string) core.TerminalResult
- type TaskImpl
- type TimedEveryTask
- type TriggerTaskFn
- type TriggeredTask
Constants ¶
This section is empty.
Variables ¶
View Source
var ImportBinary = core.ImportBinary
View Source
var ImportGit = core.ImportGit
View Source
var ImportGitSubdirectory = core.ImportGitSubdirectory
View Source
var ImportLocal = core.ImportLocal
Functions ¶
func AllowAll ¶ added in v1.2.1
func AllowAll(nm string, pm core.PermissionAction) core.Permission
func AllowOne ¶ added in v1.2.1
func AllowOne(nm string, pm core.PermissionAction, scope string) core.Permission
func Import ¶
func Import(deps ...core.ComponentImport) []core.ComponentImport
func MCPInstructions ¶ added in v1.3.1
func MCPInstructions(ins string) mcpModTask
func NewMCPTool ¶ added in v1.1.0
func NewMCPTool[T any](fn func(input T, t *TaskContext) *MCPToolResult, cfg MCPToolConfig) mcpModTask
Types ¶
type Container ¶
type Container struct {
Storage core.Storage
Keychain core.Keychain
StorageDir string
// contains filtered or unexported fields
}
func (*Container) GetKeychain ¶ added in v1.3.0
func (*Container) GetStorage ¶ added in v1.3.0
func (*Container) HasPermission ¶
func (c *Container) HasPermission(act core.PermissionAction, scope string) bool
func (*Container) MakeDirectory ¶ added in v1.3.0
func (*Container) TemporaryFile ¶ added in v1.3.0
type ContainerEntityStorage ¶
type ContainerEntityStorage[T any] struct { // contains filtered or unexported fields }
func NewEntityStorage ¶
func NewEntityStorage[T any](c *Container) *ContainerEntityStorage[T]
func (*ContainerEntityStorage[T]) Delete ¶
func (s *ContainerEntityStorage[T]) Delete(id int64)
func (*ContainerEntityStorage[T]) DeleteWhere ¶
func (s *ContainerEntityStorage[T]) DeleteWhere(filter FilterFn[T])
func (*ContainerEntityStorage[T]) Find ¶
func (s *ContainerEntityStorage[T]) Find(filter FilterFn[T]) []T
func (*ContainerEntityStorage[T]) Get ¶
func (s *ContainerEntityStorage[T]) Get(id int64) *T
func (*ContainerEntityStorage[T]) Insert ¶
func (s *ContainerEntityStorage[T]) Insert(record T) int64
func (*ContainerEntityStorage[T]) Update ¶
func (s *ContainerEntityStorage[T]) Update(id int64, record T)
type HourSpecificTask ¶
type HourSpecificTask struct {
// contains filtered or unexported fields
}
func (*HourSpecificTask) Attach ¶
func (tt *HourSpecificTask) Attach(ctx *TaskAttachContext)
type MCPDate ¶ added in v1.1.1
func (*MCPDate) UnmarshalJSON ¶ added in v1.1.1
type MCPTask ¶ added in v1.1.0
type MCPTask struct {
Name string
Version string
Instructions string
Icon *mcpTaskIcon
Tools map[string]mcpTool
}
func (*MCPTask) Attach ¶ added in v1.1.0
func (tt *MCPTask) Attach(ctx *TaskAttachContext)
type MCPToolConfig ¶ added in v1.1.0
type MCPToolConfig struct {
Title string
Description string
ToolType MCPToolType
}
type MCPToolResult ¶ added in v1.1.0
func ToolError ¶ added in v1.1.1
func ToolError(msg string) *MCPToolResult
func ToolSuccess ¶ added in v1.1.1
func ToolSuccess(res any) *MCPToolResult
type MCPToolType ¶ added in v1.1.0
type MCPToolType int
const ( MCPToolTypeDestructive MCPToolType = iota MCPToolTypeReadOnly MCPToolTypeIdempotent )
type RouteResult ¶
type RouteResult struct {
// contains filtered or unexported fields
}
func RouteRequestInvalid ¶
func RouteRequestInvalid(error string) *RouteResult
func RouteResultSuccess ¶
func RouteResultSuccess(data any) *RouteResult
type RouteResultStatus ¶
type RouteResultStatus int
const ( RouteResultStatusSuccess RouteResultStatus = 200 RouteResultStatusBadRequest RouteResultStatus = 400 RouteResultStatusServerError RouteResultStatus = 500 )
type RouteTask ¶
type RouteTask struct {
// contains filtered or unexported fields
}
func (*RouteTask) Attach ¶
func (tt *RouteTask) Attach(ctx *TaskAttachContext)
type RouteTaskFunction ¶
type RouteTaskFunction[T any] func(input T, container *TaskContext) *RouteResult
type RouteTaskNoInput ¶
type RouteTaskNoInput struct{}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(tasks []Task, deps []core.ComponentImport, approvedPermissions ...core.Permission) *Runtime
type StartupTask ¶
type StartupTask struct {
// contains filtered or unexported fields
}
func (*StartupTask) Attach ¶
func (tt *StartupTask) Attach(ctx *TaskAttachContext)
type Task ¶
func NewMCPTask ¶ added in v1.1.0
func NewPublicRouteTask ¶
func NewPublicRouteTask[T any](fn RouteTaskFunction[T]) Task
func NewRouteTask ¶
func NewRouteTask[T any](fn RouteTaskFunction[T]) Task
func NewStartupTask ¶
func NewStartupTask(handler func(*TaskContext)) Task
func NewTimeSpecificTask ¶
func NewTimeSpecificTask(hour int, minute int, handler func(*TaskContext)) Task
func NewTimedTask ¶
func NewTimedTask(duration time.Duration, handler func(*TaskContext)) Task
func NewTriggerTask ¶
func NewTriggerTask[T any](trigger component.ComponentTrigger[T], fn TriggerTaskFn[T]) Task
type TaskAttachContext ¶
type TaskAttachContext struct {
Logger core.Logger
Container *Container
Context context.Context
// contains filtered or unexported fields
}
func (*TaskAttachContext) HTTP ¶
func (tac *TaskAttachContext) HTTP(path string, handler http.HandlerFunc)
func (*TaskAttachContext) TaskContext ¶
func (tac *TaskAttachContext) TaskContext(ctx context.Context) *TaskContext
func (*TaskAttachContext) TaskContextGlobal ¶
func (tac *TaskAttachContext) TaskContextGlobal() *TaskContext
func (*TaskAttachContext) Trigger ¶
func (tac *TaskAttachContext) Trigger(ns, name string, body func([]byte))
func (*TaskAttachContext) VerifyAuthentication ¶
func (tac *TaskAttachContext) VerifyAuthentication(secret string) bool
type TaskContext ¶
type TaskContext struct {
Container *Container
Logger core.Logger
// contains filtered or unexported fields
}
func BuildTaskContext ¶
func BuildTaskContext(container *Container, logger core.Logger, cmps map[string]*runtimecomponent.Runner, ctx context.Context) *TaskContext
func (*TaskContext) ExecuteFunction ¶
func (c *TaskContext) ExecuteFunction(cname, fname string, args any) ([]byte, error)
func (*TaskContext) OpenUrl ¶
func (c *TaskContext) OpenUrl(url string) bool
func (*TaskContext) Run ¶
func (c *TaskContext) Run(maxTime time.Duration, cmd string, args ...string) core.TerminalResult
func (*TaskContext) RunInDirectory ¶
func (c *TaskContext) RunInDirectory(maxTime time.Duration, wd, cmd string, args ...string) core.TerminalResult
type TaskImpl ¶
type TaskImpl interface {
Attach(ctx *TaskAttachContext)
}
type TimedEveryTask ¶
type TimedEveryTask struct {
// contains filtered or unexported fields
}
func (*TimedEveryTask) Attach ¶
func (tt *TimedEveryTask) Attach(ctx *TaskAttachContext)
type TriggerTaskFn ¶
type TriggerTaskFn[T any] = func(input T, container *TaskContext)
type TriggeredTask ¶
type TriggeredTask struct {
// contains filtered or unexported fields
}
func (*TriggeredTask) Attach ¶
func (tt *TriggeredTask) Attach(ctx *TaskAttachContext)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
strata
command
|
|
|
Generated by Passport.
|
Generated by Passport. |
|
Generated by Passport.
|
Generated by Passport. |
|
internal
|
|
|
componentipc
Generated by Passport.
|
Generated by Passport. |
Click to show internal directories.
Click to hide internal directories.