context

package
v0.0.0-...-a644469 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	types.Logger
	context.Context
	types.GarbageCollector
	Config    *types.LuetConfig
	NoSpinner bool
	// contains filtered or unexported fields
}

func NewContext

func NewContext(opts ...ContextOption) *Context

NewContext returns a new context. It accepts a Garbage collector, a config and a logger as an option

func (*Context) Clone

func (c *Context) Clone() types.Context

Copy returns a context copy with a reset logging context

func (*Context) GetAnnotation

func (c *Context) GetAnnotation(s string) interface{}

GetAnnotation gets generic annotations to hold in a context

func (*Context) GetConfig

func (c *Context) GetConfig() types.LuetConfig

func (*Context) SetAnnotation

func (c *Context) SetAnnotation(s string, i interface{})

SetAnnotation sets generic annotations to hold in a context

func (*Context) Warn

func (c *Context) Warn(mess ...interface{})

func (*Context) Warnf

func (c *Context) Warnf(t string, mess ...interface{})

func (*Context) Warning

func (c *Context) Warning(mess ...interface{})

func (*Context) Warningf

func (c *Context) Warningf(t string, mess ...interface{})

func (*Context) WithLoggingContext

func (c *Context) WithLoggingContext(name string) types.Context

WithLoggingContext returns a copy of the context with a contextualized logger

type ContextOption

type ContextOption func(c *Context) error

func WithConfig

func WithConfig(cc *types.LuetConfig) ContextOption

WithConfig sets the luet config

func WithGarbageCollector

func WithGarbageCollector(l types.GarbageCollector) ContextOption

WithGarbageCollector sets the Garbage collector for the given context

func WithLogger

func WithLogger(l types.Logger) ContextOption

WithLogger sets the logger

Jump to

Keyboard shortcuts

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