Documentation
¶
Index ¶
- Constants
- func AsBytes(s string) []byte
- func AsString(buf *[]byte) string
- func Catch(f func()) (err error)
- func CatchValue[V any](f func() V) (value V, err error)
- func ClearBlockingCtx(ctx context.Context) context.Context
- func Debug(a any) string
- func GetChildren(ctx context.Context) (context.Context, templ.Component, bool)
- func Hash(input []byte) string
- func InitDefaults(s *SystemConf)
- func IsBlockingCtx(ctx context.Context) bool
- func IsNill(i any) bool
- func LogBlockingWarning(ctx context.Context, entity string, operation string)
- func MarshalJSON(value any) ([]byte, error)
- func MinifyCSS(input []byte) ([]byte, error)
- func RandId() string
- func RenderError(msg string) templ.Component
- func RenderErrorLog(ctx context.Context, w io.Writer, message string, args ...any) error
- func ResultChannel(ctx context.Context, action string) (chan error, bool)
- func SetBlockingCtx(ctx context.Context) context.Context
- func StripN(buf []byte) []byte
- func Ts()
- func Zip(input []byte) ([]byte, error)
- type Attrs
- type CSP
- type CSPCollector
- type Call
- type CallData
- type ClientConf
- type FuncCollector
- type Primea
- type RenderMap
- type RenderWriter
- type Set
- type SolitaireConf
- type SystemConf
- type Writable
- type WritableNone
- type WritableRenderMap
Constants ¶
View Source
const ( InstanceCtxKey ctxKey = iota DoorCtxKey ThreadCtxKey RenderMapCtxKey BlockingCtxKey AdaptersCtxKey SessionStoreCtxKey InstanceStoreCtxKey ParentCtxKey AttrsCtxKey )
Variables ¶
This section is empty.
Functions ¶
func CatchValue ¶
func InitDefaults ¶
func InitDefaults(s *SystemConf)
func IsBlockingCtx ¶
func LogBlockingWarning ¶
func MarshalJSON ¶
func RenderError ¶
func RenderErrorLog ¶
Types ¶
type Attrs ¶
type Attrs struct {
// contains filtered or unexported fields
}
func (*Attrs) AppendArray ¶
func (*Attrs) SetRaw ¶
func (a *Attrs) SetRaw(attrs templ.Attributes)
type CSP ¶
type CSP struct { // nil or empty = 'self' DefaultSources []string ScriptStrictDynamic bool // Add extra sources besides imported hashes and nonces ScriptSources []string // Add extra sources besides imported hashes and nonces StyleSources []string // Add extra sources besides self ConnectSources []string // nill or empty = 'none' (framework handeles via js) FormActions []string // nil - none // If null empty 'none' ObjectSources []string // If null empty 'none' FrameSources []string // If null empty 'none' FrameAcestors []string // If null empty 'none' BaseURIAllow []string // If null empy directive will not be added ImgSources []string // If null empy directive will not be added FontSources []string // If null empy directive will not be added MediaSources []string // If null empy directive will not be added Sandbox []string // If null empy directive will not be added WorkerSources []string // Inlines ScriptLocal* and StyleLocal* with nonce, impoves first time loading, not recommended. Adds nonce to style and script direcrives in header InlineLocal bool }
func (*CSP) NewCollector ¶
func (c *CSP) NewCollector() *CSPCollector
type CSPCollector ¶
type CSPCollector struct {
// contains filtered or unexported fields
}
func (*CSPCollector) Generate ¶
func (c *CSPCollector) Generate() string
func (*CSPCollector) Nonce ¶
func (c *CSPCollector) Nonce() string
func (*CSPCollector) ScriptHash ¶
func (c *CSPCollector) ScriptHash(hash []byte)
func (*CSPCollector) ScriptSource ¶
func (c *CSPCollector) ScriptSource(source string)
func (*CSPCollector) StyleHash ¶
func (c *CSPCollector) StyleHash(hash []byte)
func (*CSPCollector) StyleSource ¶
func (c *CSPCollector) StyleSource(source string)
type ClientConf ¶
type ClientConf struct { TTL time.Duration RequestTimeout time.Duration SleepTimeout time.Duration }
func GetClientConf ¶
func GetClientConf(s *SystemConf) *ClientConf
type FuncCollector ¶
type FuncCollector struct {
// contains filtered or unexported fields
}
func NewFuncCollector ¶
func NewFuncCollector() *FuncCollector
func (*FuncCollector) Add ¶
func (c *FuncCollector) Add(f func())
func (*FuncCollector) Apply ¶
func (c *FuncCollector) Apply()
type RenderMap ¶
type RenderMap struct {
// contains filtered or unexported fields
}
func NewRenderMap ¶
func NewRenderMap() *RenderMap
type RenderWriter ¶
type RenderWriter struct {
// contains filtered or unexported fields
}
func (*RenderWriter) Len ¶
func (rw *RenderWriter) Len() int
func (*RenderWriter) Submit ¶
func (rw *RenderWriter) Submit()
func (*RenderWriter) SubmitEmpty ¶
func (rw *RenderWriter) SubmitEmpty()
func (*RenderWriter) SubmitError ¶
func (rw *RenderWriter) SubmitError(err error, args ...any)
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func NewSet ¶
func NewSet[T comparable]() Set[T]
type SolitaireConf ¶
type SolitaireConf struct { Request time.Duration RollSize int RollTime time.Duration RollPendingTime time.Duration Queue int Pending int }
func GetSolitaireConf ¶
func GetSolitaireConf(s *SystemConf) *SolitaireConf
type SystemConf ¶
type SystemConf struct { // SessionInstanceLimit controls the maximum number of page instances that can // exist simultaneously within a single session. When this limit is exceeded, // the oldest and least active instances are suspended to make room for new ones. // Default: 6. SessionInstanceLimit int // SessionExpiration sets the session expiration timeout. The session will be // automatically cleaned up after this duration of inactivity, regardless of // whether instances are present. // Default: 0 (session cleaned up when no more instances left). SessionExpiration time.Duration // SessionCookieExpiration sets the expiration time for the session cookie sent // to the client's browser. This should typically be longer than SessionExpiration // to allow for proper session restoration. // Default and recommended: 0 (session cookies expire when browser closes). SessionCookieExpiration time.Duration // InstanceGoroutineLimit sets the maximum number of goroutines that can be spawned // per page instance. This controls resource usage for render tasks and reactive // updates within each instance. Default: 16. InstanceGoroutineLimit int // InstanceTTL (Time To Live) sets how long an inactive page instance remains alive // before being automatically killed. Instances are considered active when they // have ongoing connections or recent client interactions. Default: 15 minutes // or at least twice SolitaireRequestTimeout (whichever is greater). InstanceTTL time.Duration // ServerDisableGzip disables gzip compression for HTTP responses when set to true. // Compression is enabled by default to reduce bandwidth usage, but may be disabled // for debugging or when using external compression. Default: false. ServerDisableGzip bool // DisconnectHiddenTimer controls how long hidden/background page instances keep // connection active. This helps manage CPU/RAM usage when many tabs are open // but not actively viewed. Default: 10 minutes. DisconnectHiddenTimer time.Duration // SolitaireRollSize sets the maximum number of bytes that can be sent in a single // response before commanding the client to roll to a new request. Default: 8 KB. SolitaireRollSize int // SolitaireRequestTimeout sets the maximum duration a client-server communication // request can remain open. Default: 30 seconds. SolitaireRequestTimeout time.Duration // SolitaireRollPendingTime sets how long the server waits if there are pending calls // before commanding the client to roll to a new request, even if SolitaireRollSize // hasn't been reached. This balances latency against request efficiency. // Default: 100 milliseconds. SolitaireRollPendingTime time.Duration // SolitaireQueue sets the maximum number of client calls that can be queued // waiting to be sent to the client. When this limit is exceeded, the instance // will be terminated to prevent memory exhaustion. Default: 1024. SolitaireQueue int // SolitairePending sets the maximum number of calls that can be sent to the // client but not yet acknowledged. Default: 256. SolitairePending int }
SystemConf contains system-wide configuration options that control various aspects of the doors framework including session management, instance lifecycle, performance settings, and client-server communication parameters.
type WritableNone ¶
type WritableNone struct{}
func (WritableNone) Destroy ¶
func (w WritableNone) Destroy()
type WritableRenderMap ¶
func (*WritableRenderMap) Destroy ¶
func (wrm *WritableRenderMap) Destroy()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.