compiler

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

compiler is the code charged to compile no already compiled GO code in the xamboo server. It will use the xamboo go.mod environment and gopath to compile. It is thread safe and will compile only once even if there are more than one request at the same time It will keep the compiler results in Plugin object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PleaseCompile

func PleaseCompile(ctx *context.Context, plugin *Plugin) error

Types

type Pile

type Pile struct {
	Workers map[string]*Worker
	// contains filtered or unexported fields
}
var CPile *Pile

func (*Pile) PleaseCompile

func (p *Pile) PleaseCompile(ctx *context.Context, plugin *Plugin) error

type Plugin

type Plugin struct {
	Mutex       sync.RWMutex
	SourcePath  string
	PluginPath  string
	PluginVPath string
	Version     int
	Messages    string
	Error       error
	Status      int // 0: not loaded/compile, 1: OK, 2: compile error (see messages)
	Lib         *plugin.Plugin
	Libs        map[string]*plugin.Plugin

	// standard libraries function (can be nil if not a page library)
	Run func(*context.Context, *xcore.XTemplate, *xcore.XLanguage, interface{}) interface{}
}

type Worker

type Worker struct {
	Subscribers []chan bool
	// contains filtered or unexported fields
}

func (*Worker) Broadcast

func (w *Worker) Broadcast()

func (*Worker) Compile

func (w *Worker) Compile(ctx *context.Context, plugin *Plugin)

func (*Worker) Subscribe

func (w *Worker) Subscribe() chan bool

Jump to

Keyboard shortcuts

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