mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 05:31:18 +08:00
30 lines
555 B
Go
30 lines
555 B
Go
package inbound
|
|
|
|
import (
|
|
C "github.com/Dreamacro/clash/constant"
|
|
)
|
|
|
|
type Addition func(metadata *C.Metadata)
|
|
|
|
func (a Addition) Apply(metadata *C.Metadata) {
|
|
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
|
|
}
|
|
}
|
|
|
|
func WithSpecialProxy(specialProxy string) Addition {
|
|
return func(metadata *C.Metadata) {
|
|
metadata.SpecialProxy = specialProxy
|
|
}
|
|
}
|