2023-07-12 16:55:09 +01:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2023-07-22 01:11:47 +01:00
|
|
|
"github.com/1f349/violet/target"
|
2023-07-12 16:55:09 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type sourceJson struct {
|
|
|
|
Src string `json:"src"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s sourceJson) GetSource() string { return s.Src }
|
|
|
|
|
|
|
|
type routeSource target.Route
|
|
|
|
|
|
|
|
func (r routeSource) GetSource() string { return r.Src }
|
|
|
|
|
|
|
|
type redirectSource target.Redirect
|
|
|
|
|
|
|
|
func (r redirectSource) GetSource() string { return r.Src }
|
|
|
|
|
|
|
|
var (
|
|
|
|
_ sourceGetter = sourceJson{}
|
|
|
|
_ sourceGetter = routeSource{}
|
|
|
|
_ sourceGetter = redirectSource{}
|
|
|
|
)
|
|
|
|
|
|
|
|
type sourceGetter interface{ GetSource() string }
|