Documentation
¶
Index ¶
- Constants
- func GetAll() []*ext.Extension
- func LoadPlugin(dir string) []error
- type Context
- func (c *Context) BaseURL() string
- func (c *Context) Cancel()
- func (c *Context) ClearValue()
- func (c *Context) Deadline() (time.Time, bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) GetValue(key any) (any, bool)
- func (c *Context) Logger() *slog.Logger
- func (c *Context) SetValue(key any, value any)
- func (c *Context) URL() string
- func (c *Context) Value(key any) any
- type Options
Constants ¶
const ( // DefaultTimeout The Context default timeout DefaultTimeout = time.Minute )
Variables ¶
This section is empty.
Functions ¶
func LoadPlugin ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context The Parser context
func NewContext ¶
NewContext creates a new Context with Options
func (*Context) Cancel ¶
func (c *Context) Cancel()
Cancel this context releases resources associated with it, so code should call cancel as soon as the operations running in this Context complete.
func (*Context) Deadline ¶
Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.
func (*Context) Done ¶
func (c *Context) Done() <-chan struct{}
Done returns a channel that's closed when work done on behalf of this context should be canceled. Done may return nil if this context can never be canceled. Successive calls to Done return the same value. The close of the Done channel may happen asynchronously, after the cancel function returns.
func (*Context) Err ¶
Err If Done is not yet closed, Err returns nil. If Done is closed, Err returns a non-nil error explaining why: Canceled if the context was canceled or DeadlineExceeded if the context's deadline passed. After Err returns a non-nil error, successive calls to Err return the same error.
func (*Context) GetValue ¶
GetValue returns the value associated with this context for key, or nil if no value is associated with key. Successive calls to Value with the same key returns the same result.