instance

package
v0.19.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const UPDATE_PERIOD = time.Second * 5

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Context() context.Context
	IsWithValueKey(key any) bool
	RegisterRewrite(token string, rewrite func(tail string) path.Rewrite)
	UnregisterRewrite(token string)
	CSP() *common.CSP
	Conf() *common.Conf
	SetCookies(w http.ResponseWriter, id string, maxAge time.Duration)
	PathMaker() path.PathMaker
	RemoveSession(id string)
	ResourceRegistry() resources.Registry
	Logger() *slog.Logger
	InstanceCreated()
	InstanceDeleted()
	Migrating() bool
	PrinterMiddleware() func(next gox.Printer) gox.Printer
}

type Instance

type Instance = *instance

func (Instance) CSPCollector

func (inst Instance) CSPCollector() common.CSPCollector

func (Instance) Connect

func (inst Instance) Connect(w http.ResponseWriter, r *http.Request)

func (Instance) ID

func (inst Instance) ID() string

func (Instance) InitializeTabState added in v0.15.5

func (inst Instance) InitializeTabState(data map[string]json.RawMessage) bool

func (Instance) LastSeen added in v0.14.2

func (inst Instance) LastSeen() time.Time

func (Instance) Location added in v0.12.1

func (inst Instance) Location() beam.Source[path.Location]

func (Instance) Logger added in v0.12.15

func (inst Instance) Logger() *slog.Logger

func (Instance) Serve

func (inst Instance) Serve(w http.ResponseWriter, r *http.Request, page Page) (err error, handled bool)

func (Instance) Session added in v0.12.1

func (inst Instance) Session() core.Session

func (Instance) Store added in v0.12.1

func (inst Instance) Store() ctex.Store

func (Instance) TitleMeta added in v0.12.1

func (inst Instance) TitleMeta() core.TitleMeta

func (Instance) TriggerHook

func (inst Instance) TriggerHook(hookID uint64, w http.ResponseWriter, r *http.Request, track uint64) bool

func (Instance) UpdateLocation added in v0.12.1

func (inst Instance) UpdateLocation(l path.Location) bool

func (Instance) UserCall added in v0.10.0

func (c Instance) UserCall(ctx context.Context, action actions.Action, onResult func(json.RawMessage, error), onCancel func(), params actions.CallParams, door uint64, depSeq uint64)

func (Instance) UserCallCheck added in v0.15.2

func (c Instance) UserCallCheck(group uint64, batch uint64, target uint64, check func() bool, action actions.Action, onResult func(json.RawMessage, error), onCancel func(), params actions.CallParams)

type Page added in v0.12.1

type Page = func(ctx context.Context, w http.ResponseWriter, r *http.Request) gox.Comp

type Session

type Session = *session

func NewSession

func NewSession(a App, id string) Session

func (Session) ID

func (sess Session) ID() string

func (Session) Instance added in v0.12.1

func (sess Session) Instance(loc path.Location, head bool) (Instance, bool)

func (Session) InstanceCount

func (sess Session) InstanceCount() (n int)

type TabState added in v0.15.5

type TabState = utils.TabState

type TabStateDerive added in v0.15.5

type TabStateDerive[T any] struct {
	Key   string
	Equal func(T, T) bool
	// contains filtered or unexported fields
}

func (*TabStateDerive[T]) Derive added in v0.15.5

func (s *TabStateDerive[T]) Derive()

func (*TabStateDerive[T]) Get added in v0.15.5

func (s *TabStateDerive[T]) Get() beam.Lens[TabState, *T]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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