25 lines
558 B
Go
25 lines
558 B
Go
package workers
|
|
|
|
// Context represents execution context for a Lua script
|
|
type Context struct {
|
|
// Generic map for any context values (route params, HTTP request info, etc.)
|
|
Values map[string]any
|
|
}
|
|
|
|
// NewContext creates a new context with initialized maps
|
|
func NewContext() *Context {
|
|
return &Context{
|
|
Values: make(map[string]any),
|
|
}
|
|
}
|
|
|
|
// Set adds a value to the context
|
|
func (c *Context) Set(key string, value any) {
|
|
c.Values[key] = value
|
|
}
|
|
|
|
// Get retrieves a value from the context
|
|
func (c *Context) Get(key string) any {
|
|
return c.Values[key]
|
|
}
|