Documentation ¶
Index ¶
- Constants
- func BinaryNameFor(ptr, size uint32) uint64
- func BinaryNameForModule(req *wasiv1.BinaryNameRequest) (*wasiv1.BinaryNameResponse, error)
- func GetInventory(*wasiv1.PluginInventoryRequest) (*wasiv1.PluginInventoryResponse, error)
- func GetState(req *remotev1.GetStateRequest) (*remotev1.GetStateResponse, error)
- func HelpFor(ptr, size uint32) uint64
- func HelpForModule(helpRequest *wasiv1.HelpRequest) (*wasiv1.HelpResponse, error)
- func Inventory(ptr, size uint32) uint64
- func LogMsg(taskLog *remotev1.TaskLog) (*remotev1.Result, error)
- func Register(cat Category, moduleName string, factory Factory)
- func Run(ptr, size uint32) uint64
- func SetState(req *remotev1.SetState) (*remotev1.Result, error)
- func StartTask(req *remotev1.StartTaskRequest) (*wasiv1.StartTaskResponse, error)
- type BinaryNamer
- type Category
- type Encoder
- type Example
- type ExecutionContext
- type Executor
- type Factory
- type FuncExportWrapper
- type Help
- type Helper
- type JSONStateEncoder
- type Module
- type ModuleFactoryFunc
- type Reference
- type Registration
- type RegistrationFunc
- type StateMetadata
- type StateProxy
- type TaskSpec
- type ToolModule
- type TypeRegistry
- type WASIHandler
Constants ¶
View Source
const ( CategoryTool = commonv1.Category_CategoryTool CategoryTask = commonv1.Category_CategoryTask CategoryBuild = commonv1.Category_CategoryBuild CategoryPackage = commonv1.Category_CategoryPackage CategoryRelease = commonv1.Category_CategoryRelease )
Variables ¶
This section is empty.
Functions ¶
func BinaryNameFor ¶
func BinaryNameForModule ¶
func BinaryNameForModule(req *wasiv1.BinaryNameRequest) (*wasiv1.BinaryNameResponse, error)
func GetInventory ¶
func GetInventory(*wasiv1.PluginInventoryRequest) (*wasiv1.PluginInventoryResponse, error)
func GetState ¶
func GetState(req *remotev1.GetStateRequest) (*remotev1.GetStateResponse, error)
func HelpForModule ¶
func HelpForModule(helpRequest *wasiv1.HelpRequest) (*wasiv1.HelpResponse, error)
func StartTask ¶
func StartTask(req *remotev1.StartTaskRequest) (*wasiv1.StartTaskResponse, error)
Types ¶
type BinaryNamer ¶
type BinaryNamer interface {
BinaryName() string
}
type ExecutionContext ¶
type ExecutionContext interface { context.Context WorkingDir() string OutDir() string BinariesDir() string StdOut() io.Writer StdErr() io.Writer Logger() *slog.Logger GetState(ctx context.Context, key string) ([]byte, StateMetadata, error) SetState(ctx context.Context, key string, value []byte) error }
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
type FuncExportWrapper ¶
type FuncExportWrapper[TRequest bapi.ProtoMessage, TResponse bapi.ProtoMessage] func(req TRequest) (TResponse, error)
func (FuncExportWrapper[TRequest, TResponse]) Call ¶
func (w FuncExportWrapper[TRequest, TResponse]) Call(reqPtr, reqSize uint32) uint64
type JSONStateEncoder ¶
type JSONStateEncoder[T any] struct { Context ExecutionContext }
func NewJSONStateEncoder ¶
func NewJSONStateEncoder[T any](ctx ExecutionContext) *JSONStateEncoder[T]
func (JSONStateEncoder[T]) Get ¶
func (j JSONStateEncoder[T]) Get(ctx context.Context, key string) (val T, ok bool, meta StateMetadata, err error)
type Module ¶
type Module interface { Execute(ctx ExecutionContext) error Category() Category Type() string }
type ModuleFactoryFunc ¶
type ModuleFactoryFunc func() Module
func (ModuleFactoryFunc) Create ¶
func (f ModuleFactoryFunc) Create() Module
type Registration ¶
type Registration interface {
RegisterAt(registry *TypeRegistry)
}
type RegistrationFunc ¶
type RegistrationFunc func(registry *TypeRegistry)
func (RegistrationFunc) RegisterAt ¶
func (f RegistrationFunc) RegisterAt(registry *TypeRegistry)
type StateProxy ¶
type StateProxy struct{}
func (StateProxy) Get ¶
func (s StateProxy) Get(key []byte) (state []byte, meta StateMetadata, err error)
func (StateProxy) Set ¶
func (s StateProxy) Set(key, state []byte) error
type TaskSpec ¶
type TaskSpec[T Module] struct { Module T ModuleName string Container *commonv1.ContainerSpec OutputDir string }
type ToolModule ¶
type ToolModule interface { Module BinaryNamer }
type TypeRegistry ¶
type TypeRegistry struct {
// contains filtered or unexported fields
}
func NewTypeRegistry ¶
func NewTypeRegistry() *TypeRegistry
func (*TypeRegistry) Add ¶
func (r *TypeRegistry) Add(cat Category, moduleName string, factory Factory)
func (*TypeRegistry) List ¶
func (r *TypeRegistry) List() (refs []Reference)
type WASIHandler ¶
func NewWASIHandler ¶
func NewWASIHandler() WASIHandler
Source Files ¶
Click to show internal directories.
Click to hide internal directories.