Documentation
¶
Index ¶
- Variables
- func ContextSilent() (ctx context.Context)
- func ContextVerbose() (ctx context.Context)
- func GetLogLinePrefixFromCtx(ctx context.Context) (logLinePrefix string)
- func GetVerboseFromContext(ctx context.Context) (verbose bool)
- func GetVerbosityContextByBool(verbose bool) (ctx context.Context)
- func GetVerbosityContextByCobraCmd(cmd *cobra.Command) (ctx context.Context)
- func IsCacheIndicatorPresent(ctx context.Context) bool
- func IsCachedResult(ctx context.Context) (bool, error)
- func IsChangeIndicatorPresent(ctx context.Context) bool
- func IsChanged(ctx context.Context) bool
- func IsChangedResult(ctx context.Context) (bool, error)
- func SetCacheIndicator(ctx context.Context, cached bool)
- func SetChangeIndicator(ctx context.Context, change bool)
- func WithCacheIndicator(ctx context.Context) context.Context
- func WithChangeIndicator(ctx context.Context) context.Context
- func WithLogLinePrefix(ctx context.Context, logLinePrefix string) (ctxWithLogLinePrefix context.Context)
- func WithSilent(ctx context.Context) context.Context
- func WithVerbose(ctx context.Context) context.Context
- func WithVerbosityContextByBool(ctx context.Context, verbose bool) (ctxWithVerbosity context.Context)
- type CacheIndicator
- type ChangeIndicator
Constants ¶
This section is empty.
Variables ¶
var ErrorNoCacheIndicatorPresent = errors.New("no cache indicator present in given contest")
var ErrorNoChangeIndicatorPresent = errors.New("no change indicator present in given contest")
Functions ¶
func ContextSilent ¶
func ContextVerbose ¶
func GetLogLinePrefixFromCtx ¶
func GetVerboseFromContext ¶
func IsCacheIndicatorPresent ¶ added in v0.295.0
func IsCachedResult ¶ added in v0.295.0
true means the returned result bases on cached data, false means no cache was involved. If ctx has no CacheInidicator as Value it an error is returned.
func IsChangeIndicatorPresent ¶ added in v0.353.0
func IsChangedResult ¶ added in v0.353.0
true means the returned result bases on change data, false means no cache was involved. If ctx has no ChangeInidicator as Value it an error is returned.
func SetCacheIndicator ¶ added in v0.295.0
Use this to set the cache indication. Set the parameter 'cached' to true to indiacte the given result bases on caching.
If no cache indicator is present or ctx is nil the ctx stays untouched. This allows to use SetCahceIndicator wherever you want but it's only changing ctx if requested by a ctx with change indicator.
func SetChangeIndicator ¶ added in v0.353.0
Use this to set the cache indication. Set the parameter 'change' to true to indiacte the given result bases on caching.
If no cache indicator is present or ctx is nil the ctx stays untouched. This allows to use SetCahceIndicator wherever you want but it's only changing ctx if requested by a ctx with change indicator.
func WithCacheIndicator ¶ added in v0.295.0
Get a child context containing an cache indicator which can indicate if a result bases on cached data or not.
func WithChangeIndicator ¶ added in v0.353.0
Get a child context containing an cache indicator which can indicate if a result bases on change data or not.
func WithLogLinePrefix ¶
func WithSilent ¶ added in v0.315.0
Returns a child context with verbosity disabled.
func WithVerbose ¶ added in v0.315.0
Returns a child context with verbosity enabled.
Types ¶
type CacheIndicator ¶ added in v0.295.0
type CacheIndicator struct { // true indicates you received a cached result. CachedResult bool }
type ChangeIndicator ¶ added in v0.353.0
type ChangeIndicator struct { // true indicates you received a change result. ChangedResult bool }