runtime

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package runtime はページで使用する交換可能なGo実行環境を定義する。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	Document        *dom.Document
	Events          *events.Dispatcher
	BaseURL         *url.URL
	Fetch           func(context.Context, *network.Request) (*network.Response, error)
	Navigate        func(*url.URL) error
	HistoryPush     func(string, *url.URL) error
	HistoryReplace  func(string, *url.URL) error
	HistoryTraverse func(int) error
	HistoryInfo     func() (int, string)
	LocalStorage    *storagecore.Area
	SessionStorage  *storagecore.Area
	OnMutation      func()
	RequestFrame    func()
	FrameScope      func(time.Time, func())
	ConsoleLog      func(message string)
}

Environment はRuntimeへ公開するページの状態を保持する。

type Factory

type Factory func() Runtime

Factory はページごとに独立したRuntimeを生成する。

type LocationUpdater added in v0.9.0

type LocationUpdater interface {
	UpdateLocation(*url.URL)
}

LocationUpdater はsame-document Navigationを現在Runtimeへ通知する。

type NavigationEventDispatcher interface {
	DispatchPopState(state string)
	DispatchHashChange(oldURL, newURL string)
}

NavigationEventDispatcher はNavigation Eventを現在Runtimeへ配送する。

type Runtime

type Runtime interface {
	Load(ctx context.Context, scripts []Script, environment Environment) error
	Start(ctx context.Context) error
	Stop() error
}

Runtime は1ページに属するGoスクリプトを実行する。

type Script

type Script struct {
	SourceURL *url.URL
	Source    string
	Inline    bool
}

Script は文書内で見つかった1つのGoソースを表す。

Directories

Path Synopsis
Package yaegi はYaegiを使ったGrowseページのRuntimeを実装する。
Package yaegi はYaegiを使ったGrowseページのRuntimeを実装する。

Jump to

Keyboard shortcuts

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