template-monorepo/internal/logic/member/actor.go

24 lines
691 B
Go

package member
import (
"context"
"gateway/internal/library/actor"
)
// Actor aliases library/actor.Actor so existing logic code keeps
// referring to `member.Actor` without an import change.
type Actor = actor.Actor
// WithActor stores tenant/uid on the context for member logic handlers.
// Delegates to library/actor so AuthJWT middleware and downstream
// readers share the same context key.
func WithActor(ctx context.Context, tenantID, uid string) context.Context {
return actor.WithActor(ctx, tenantID, uid)
}
// ActorFromContext reads the actor injected by AuthJWT middleware.
func ActorFromContext(ctx context.Context) (Actor, error) {
return actor.ActorFromContext(ctx)
}