Implement initial login functionality

This commit is contained in:
Tom Wiesing 2022-12-05 16:14:54 +01:00
parent a3bd0db78c
commit 3aa79b0d23
No known key found for this signature in database
36 changed files with 908 additions and 70 deletions

24
pkg/cancel/values.go Normal file
View file

@ -0,0 +1,24 @@
package cancel
import "context"
// ValuesOf returns a new context that has the same deadline and cancelation behviour as parent.
// However when requesting values from the context, checks the values in context first.
func ValuesOf(parent, values context.Context) context.Context {
return &valuesOf{
Context: parent,
values: values,
}
}
type valuesOf struct {
context.Context
values context.Context
}
func (vv *valuesOf) Value(key any) any {
if value := vv.values.Value(key); value != nil {
return value
}
return vv.Context.Value(key)
}