feat(platform-ops): 增加平台只读统计接口与超管入口
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package platformscope
|
||||
|
||||
import "context"
|
||||
|
||||
type contextKey struct{}
|
||||
|
||||
func WithScope(ctx context.Context) context.Context {
|
||||
return context.WithValue(ctx, contextKey{}, true)
|
||||
}
|
||||
|
||||
func IsScope(ctx context.Context) bool {
|
||||
enabled, _ := ctx.Value(contextKey{}).(bool)
|
||||
return enabled
|
||||
}
|
||||
Reference in New Issue
Block a user