import "github.com/iansmith/parigot/api/plugin"
var NoReturnedStruct = uint64(0)
func InvokeImplFromStack[T proto.Message, U proto.Message](ctx context.Context, name string, m api.Module, stack []uint64, fn func(context.Context, T, U) int32, t T, u U)
InvokeImplFromStack is the primary interface between host code and the machinery to communicate with the guest. This function takes the parameters like an api.Module and a section of the stack provided by Wazero and then reads and writes an input and output protocol buffer to the guest memory. The name is provided here just for human error messages. This functions uses pullRequestFromStack and and pushResponseToStack to do the actual work of encoding and decoding the values to/from the guest memory.
ParigotInit is the interface that plugins must meet to be initialized. It is expected that they will use the supplied Engine in the call to Init to register Host functions.
type ParigotInit interface {
Init(ctx context.Context, e eng.Engine, h id.HostId) bool
}
func LoadAndReturnInit(ctx context.Context, pluginPath, pluginSymbol, _ string) (ParigotInit, error)
LoadAndReturnInit is a utility function for plugins that want the default implementation. This function accepts third string param (name) but ignores it.
import "github.com/iansmith/parigot/api/plugin/file"
type FilePlugin struct{}
func (*FilePlugin) Init(ctx context.Context, e eng.Engine, _ id.HostId) bool
enum for file status
type FileStatus int
const (
Fs_Write FileStatus = iota
Fs_Read
Fs_Close
)
func (fs FileStatus) String() string
import "github.com/iansmith/parigot/api/plugin/queue"
type CreateIdToKeyMappingParams struct {
IDLow sql.NullInt64
IDHigh sql.NullInt64
QueueKey sql.NullInt64
}
type CreateMessageParams struct {
IDLow sql.NullInt64
IDHigh sql.NullInt64
QueueKey sql.NullInt64
Sender []byte
Payload []byte
}
type DBTX interface {
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
PrepareContext(context.Context, string) (*sql.Stmt, error)
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}
type LocateRow struct {
IDHigh sql.NullInt64
IDLow sql.NullInt64
}
type MarkDoneParams struct {
QueueKey sql.NullInt64
IDLow sql.NullInt64
IDHigh sql.NullInt64
}
type ParigotTestMessage struct {
IDLow sql.NullInt64
IDHigh sql.NullInt64
QueueKey sql.NullInt64
LastReceived sql.NullString
ReceivedCount sql.NullInt64
OriginalSent sql.NullString
MarkedDone sql.NullString
Sender []byte
Payload []byte
}
type ParigotTestQueue struct {
ID int64
Name string
}
type ParigotTestQueueIDToKey struct {
IDLow sql.NullInt64
IDHigh sql.NullInt64
QueueKey sql.NullInt64
}
type Queries struct {
// contains filtered or unexported fields
}
func New(db DBTX) *Queries
func (q *Queries) CreateIdToKeyMapping(ctx context.Context, arg CreateIdToKeyMappingParams) (ParigotTestQueueIDToKey, error)
func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (ParigotTestMessage, error)
func (q *Queries) CreateQueue(ctx context.Context, name string) (ParigotTestQueue, error)
func (q *Queries) DeleteQueue(ctx context.Context, id int64) error
func (q *Queries) GetQueue(ctx context.Context, id int64) (ParigotTestQueue, error)
func (q *Queries) Length(ctx context.Context, queueKey sql.NullInt64) (int64, error)
func (q *Queries) Locate(ctx context.Context, name string) (LocateRow, error)
func (q *Queries) MarkDone(ctx context.Context, arg MarkDoneParams) error
func (q *Queries) RetrieveMessage(ctx context.Context, arg RetrieveMessageParams) ([]ParigotTestMessage, error)
func (q *Queries) TestNameExists(ctx context.Context, name string) (int64, error)
func (q *Queries) UpdateMessageRetrieved(ctx context.Context, arg UpdateMessageRetrievedParams) error
func (q *Queries) WithTx(tx *sql.Tx) *Queries
type QueuePlugin struct{}
func (*QueuePlugin) Init(ctx context.Context, e eng.Engine, _ id.HostId) bool
This init functions points the host functions at the functions that are the ones to a short setup before calling the real implementation.
type RetrieveMessageParams struct {
IDHigh sql.NullInt64
IDLow sql.NullInt64
}
type UpdateMessageRetrievedParams struct {
QueueKey sql.NullInt64
IDLow sql.NullInt64
IDHigh sql.NullInt64
}
import "github.com/iansmith/parigot/api/plugin/syscall"
var ParigotInitialize apiplugin.ParigotInit = &SyscallPlugin{}
type SyscallPlugin struct {
}
func (*SyscallPlugin) Init(ctx context.Context, e eng.Engine, _ id.HostId) bool
Generated by gomarkdoc