mirror of
https://github.com/1f349/violet.git
synced 2024-11-22 11:21:35 +00:00
28 lines
517 B
Go
28 lines
517 B
Go
|
package api
|
||
|
|
||
|
import (
|
||
|
"github.com/MrMelon54/violet/target"
|
||
|
)
|
||
|
|
||
|
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 }
|