12345678910111213141516171819202122232425262728293031 |
- package ciphers
- import "context"
- type contextKey string
- func (c contextKey) String() string {
- return "WPCipherContext(" + string(c) + ")"
- }
- const (
-
- contextKeyEncryptSerial contextKey = "EncryptSerial"
- )
- func setEncryptSerial(ctx context.Context, serial string) context.Context {
- return context.WithValue(ctx, contextKeyEncryptSerial, serial)
- }
- func getEncryptSerial(ctx context.Context) (string, bool) {
- serial, ok := ctx.Value(contextKeyEncryptSerial).(string)
- return serial, ok
- }
|