core

package
v0.19.0-rc11 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App added in v0.12.1

type App interface {
	Logger() *slog.Logger
	PathMaker() path.PathMaker
	ResourceRegistry() resources.Registry
	Conf() *common.Conf
	Migrating() bool
	PrinterMiddleware() func(next gox.Printer) gox.Printer
	IsWithValueKey(key any) bool
	RegisterRewrite(token string, rewrite func(tail string) path.Rewrite)
	UnregisterRewrite(token string)
}

type Core

type Core = *core

func NewCore

func NewCore(door Door) Core

func (Core) App added in v0.12.13

func (c Core) App() App

func (Core) Cinema

func (c Core) Cinema() beam.Cinema

func (Core) Door

func (c Core) Door() Door

func (Core) Instance

func (c Core) Instance() Instance

func (Core) InstanceID

func (c Core) InstanceID() string

type Door

type Door interface {
	Instance() Instance
	Cinema() beam.Cinema
	ID() uint64
	RegisterHook(onTrigger func(ctx context.Context, w http.ResponseWriter, r *http.Request) bool, race Race, batch bool, portable bool) (Hook, bool)
	Reload(ctx context.Context) <-chan error
	DeferredInner(ctx context.Context, content any) <-chan error
	DeferredOuter(ctx context.Context, content any) <-chan error
	DeferredStatic(ctx context.Context, content any) <-chan error
	RootCore() Core
	UserCall(ctx context.Context, action actions.Action, onScheduled func(), onResult func(json.RawMessage, error), onCancel func(), params actions.CallParams)
	CleanFrame() shredder.Frame
	ReadyFrame() shredder.ReleaseFrame
}

type Hook

type Hook struct {
	HookID   uint64
	Cancel   context.CancelFunc
	Portable string
}

type Instance

type Instance interface {
	TabState(TabStateDeriver)
	Session() Session
	Logger() *slog.Logger
	Store() ctex.Store
	UserCall(ctx context.Context, action actions.Action, onResult func(json.RawMessage, error), onCancel func(), params actions.CallParams, door uint64, depSeq uint64)
	UserCallCheck(group uint64, batch uint64, target uint64, check func() bool, action actions.Action, onResult func(json.RawMessage, error), onCancel func(), params actions.CallParams)
	CSPCollector() common.CSPCollector
	ModuleRegistry() ModuleRegistry
	ID() string
	LastSeen() time.Time
	RootID() uint64
	NewID() uint64
	Runtime() shredder.Runtime
	SetStatus(int)
	Location() beam.Source[path.Location]
	Kill()
	TitleMeta() TitleMeta
}

type ModuleRegistry

type ModuleRegistry interface {
	Add(specifier string, path string)
}

type Race added in v0.16.0

type Race int
const (
	RaceSerial Race = iota
	RaceParallel
	RaceStrict
	RaceLatest
)

type Session added in v0.12.1

type Session interface {
	Logger() *slog.Logger
	App() App
	ID() string
	Expire(time.Duration)
	LastSeen() time.Time
	Context() context.Context
	Store() ctex.Store
	Kill()
}

type TabStateDeriver added in v0.15.5

type TabStateDeriver interface {
	Derive()
}

type TitleMeta added in v0.12.1

type TitleMeta interface {
	gox.Comp
	UpdateTitle(value string, attrs gox.Attrs) context.CancelFunc
	UpdateMeta(prop bool, name string, attrs gox.Attrs) context.CancelFunc
}

Jump to

Keyboard shortcuts

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