2022-12-05 00:20:50 +08:00
|
|
|
package inbound
|
|
|
|
|
|
|
|
import (
|
|
|
|
C "github.com/Dreamacro/clash/constant"
|
|
|
|
)
|
|
|
|
|
2022-12-05 10:12:53 +08:00
|
|
|
type Addition func(metadata *C.Metadata)
|
2022-12-05 00:20:50 +08:00
|
|
|
|
|
|
|
func (a Addition) Apply(metadata *C.Metadata) {
|
2022-12-05 10:12:53 +08:00
|
|
|
a(metadata)
|
|
|
|
}
|
|
|
|
|
|
|
|
func WithInName(name string) Addition {
|
|
|
|
return func(metadata *C.Metadata) {
|
|
|
|
metadata.InName = name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func WithSpecialRules(specialRules string) Addition {
|
|
|
|
return func(metadata *C.Metadata) {
|
|
|
|
metadata.SpecialRules = specialRules
|
|
|
|
}
|
2022-12-05 00:20:50 +08:00
|
|
|
}
|