runner

package
v0.0.0-...-4c42442 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const RunnerContextPath = "/context"

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Image       string
	ContextName string
	ContextPath string

	RequestId   string
	RequestBody []byte
}

func NewContext

func NewContext(
	image string,
	contextName, contextPath string,
	requestId string,
	requestBody []byte,
) (*Context, error)

func (*Context) AddContext

func (c *Context) AddContext(filename string, data []byte) error

func (*Context) GetContext

func (c *Context) GetContext(filename string) ([]byte, error)

func (Context) Mounts

func (c Context) Mounts() []mount.Mount

type ContextManager

type ContextManager struct {
	Docker      *client.Client
	ContextName string
	ContextPath string
}

func NewManager

func NewManager(
	client *client.Client,
	contextName, contextPath string,
) (*ContextManager, error)

func (*ContextManager) NewContext

func (m *ContextManager) NewContext(
	image string,
	body []byte,
) (*Context, error)

func (*ContextManager) NewContextWithId

func (m *ContextManager) NewContextWithId(
	id uuid.UUID,
	image string,
	body []byte,
) (*Context, error)

type Runner

type Runner struct {
	Function *database.Function
	Docker   *client.Client
}

func New

func New(
	client *client.Client,
	function *database.Function,
) (*Runner, error)

func (*Runner) Run

func (r *Runner) Run(ctx *Context) ([]byte, error)

Jump to

Keyboard shortcuts

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