mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
36 lines
663 B
Go
36 lines
663 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 WithInUser(user string) Addition {
|
|
return func(metadata *C.Metadata) {
|
|
metadata.InUser = user
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|