Skip to content

Commit

Permalink
[OC-71] - Add helper methods to context to set metatada token values …
Browse files Browse the repository at this point in the history
…for the API (#760)

* Add helper methods to context to set metatada token values for the API.

* Rename to SetParent.
  • Loading branch information
ahrav authored Aug 31, 2022
1 parent a35786d commit ad1c96c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ var (
type Context interface {
context.Context
Logger() logr.Logger
Parent() context.Context
SetParent(ctx context.Context) Context
}

// Parent returns the parent context.
func (l logCtx) Parent() context.Context {
return l.Context
}

// SetParent sets the parent context on the context.
func (l logCtx) SetParent(ctx context.Context) Context {
l.Context = ctx
return l
}

type CancelFunc context.CancelFunc
Expand Down

0 comments on commit ad1c96c

Please sign in to comment.