1package store23import "context"45// ContextKey is the store context key.6var ContextKey = &struct{ string }{"store"}78// FromContext returns the store from the given context.9func FromContext(ctx context.Context) Store {10 if s, ok := ctx.Value(ContextKey).(Store); ok {11 return s12 }1314 return nil15}1617// WithContext returns a new context with the given store.18func WithContext(ctx context.Context, s Store) context.Context {19 return context.WithValue(ctx, ContextKey, s)20}