conduit/store/context.go
Evan Reichard 0722e5f032
All checks were successful
continuous-integration/drone/push Build is passing
chore: tunnel recorder & slight refactor
2025-09-27 17:49:59 -04:00

19 lines
349 B
Go

package store
import (
"context"
)
type contextKey struct{}
var recordIDKey = contextKey{}
func withRecord(ctx context.Context, rec *TunnelRecord) context.Context {
return context.WithValue(ctx, recordIDKey, rec)
}
func getRecord(ctx context.Context) (*TunnelRecord, bool) {
id, ok := ctx.Value(recordIDKey).(*TunnelRecord)
return id, ok
}