mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
27 lines
369 B
Go
27 lines
369 B
Go
|
package adapters
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
|
||
|
C "github.com/Dreamacro/clash/constant"
|
||
|
)
|
||
|
|
||
|
type Base struct {
|
||
|
name string
|
||
|
tp C.AdapterType
|
||
|
}
|
||
|
|
||
|
func (b *Base) Name() string {
|
||
|
return b.name
|
||
|
}
|
||
|
|
||
|
func (b *Base) Type() C.AdapterType {
|
||
|
return b.tp
|
||
|
}
|
||
|
|
||
|
func (b *Base) MarshalJSON() ([]byte, error) {
|
||
|
return json.Marshal(map[string]string{
|
||
|
"type": b.Type().String(),
|
||
|
})
|
||
|
}
|