The current repo belongs to Paused status, and some functions are restricted. For details, please refer to the description of repo status
2 Star 0 Fork 1

JUMEI_ARCH / go-plugins
Paused

Gitee — Enterprise-level DevOps R&D management platform
Join Gitee
Clone or download
options.go 440 Bytes
Copy Edit Raw Blame History
Asim Aslam authored 2018-03-03 12:28 . switch to stdlib context
package label
import (
"context"
"github.com/micro/go-micro/selector"
)
type labelKey struct{}
type label struct {
key string
val string
}
// Label used in the priority label list
func Label(k, v string) selector.Option {
return func(o *selector.Options) {
l, ok := o.Context.Value(labelKey{}).([]label)
if !ok {
l = []label{}
}
l = append(l, label{k, v})
o.Context = context.WithValue(o.Context, labelKey{}, l)
}
}

Comment ( 0 )

Sign in for post a comment

Go
1
https://gitee.com/JMArch/go-plugins.git
git@gitee.com:JMArch/go-plugins.git
JMArch
go-plugins
go-plugins
v0.14.1

Search

122604 9befe709 551147 122411 94cd1624 551147