codeexec

package
v0.0.0-...-d931726 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailableFactories = []string{"ranna", "jdoodle"}

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Exec(Payload) (Response, error)
}

type Factory

type Factory interface {
	Name() string
	Specs() (models.SpecMap, error)
	NewExecutor(guildID string) (Executor, error)
}

type JdoodleExecutor

type JdoodleExecutor struct {
	// contains filtered or unexported fields
}

func (*JdoodleExecutor) Exec

func (e *JdoodleExecutor) Exec(p Payload) (res Response, err error)

type JdoodleFactory

type JdoodleFactory struct {
	// contains filtered or unexported fields
}

func NewJdoodleFactory

func NewJdoodleFactory(container di.Container) (e *JdoodleFactory)

func (*JdoodleFactory) Name

func (e *JdoodleFactory) Name() string

func (*JdoodleFactory) NewExecutor

func (e *JdoodleFactory) NewExecutor(guildID string) (exec Executor, err error)

func (*JdoodleFactory) Specs

func (e *JdoodleFactory) Specs() (models.SpecMap, error)

type Payload

type Payload struct {
	Language    string
	Code        string
	Args        []string
	Environment map[string]string
	Inline      bool
}

type RannaExecutor

type RannaExecutor struct {
	// contains filtered or unexported fields
}

func (*RannaExecutor) Exec

func (e *RannaExecutor) Exec(p Payload) (res Response, err error)

type RannaFactory

type RannaFactory struct {
	// contains filtered or unexported fields
}

func NewRannaFactory

func NewRannaFactory(container di.Container) (e *RannaFactory, err error)

func (*RannaFactory) Name

func (e *RannaFactory) Name() string

func (*RannaFactory) NewExecutor

func (e *RannaFactory) NewExecutor(guildID string) (exec Executor, err error)

func (*RannaFactory) Specs

func (e *RannaFactory) Specs() (specs models.SpecMap, err error)

type Response

type Response struct {
	StdOut   string
	StdErr   string
	ExecTime time.Duration
	MemUsed  string
	CpuUsed  string
}

Jump to

Keyboard shortcuts

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