-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jörn Dreyer <[email protected]> Signed-off-by: Christian Richter <[email protected]>
- Loading branch information
1 parent
f4f0554
commit 5744f5a
Showing
5 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ocdav | ||
|
||
import ( | ||
"context" | ||
|
||
cs3storage "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" | ||
) | ||
|
||
type tokenStatInfoKey struct{} | ||
|
||
func ContextWithTokenStatInfo(ctx context.Context, info *cs3storage.ResourceInfo) context.Context { | ||
return context.WithValue(ctx, tokenStatInfoKey{}, info) | ||
} | ||
|
||
func TokenStatInfoFromContext(ctx context.Context) (*cs3storage.ResourceInfo, bool) { | ||
v, ok := ctx.Value(tokenStatInfoKey{}).(*cs3storage.ResourceInfo) | ||
return v, ok | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters