github.com/sagernet/sing@v0.4.0-beta.19.0.20240518125136-f67a0988a636/service/pause/context.go (about)

     1  package pause
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/sagernet/sing/service"
     7  )
     8  
     9  // Deprecated: use service.ContextWith instead.
    10  func ManagerFromContext(ctx context.Context) Manager {
    11  	return service.FromContext[Manager](ctx)
    12  }
    13  
    14  // Deprecated: use service.ContextWith instead.
    15  func ContextWithManager(ctx context.Context, manager Manager) context.Context {
    16  	return service.ContextWith[Manager](ctx, manager)
    17  }
    18  
    19  // Deprecated: use WithDefaultManager instead.
    20  func ContextWithDefaultManager(ctx context.Context) context.Context {
    21  	return WithDefaultManager(ctx)
    22  }