45 lines
748 B
Go
45 lines
748 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type PublishTargetType int
|
|
|
|
const (
|
|
PublishTargetTypeNone PublishTargetType = 0
|
|
PublishTargetTypeLocalFS PublishTargetType = 1
|
|
PublishTargetTypeNetlify PublishTargetType = 2
|
|
)
|
|
|
|
func ParsePublishTargetType(s string) (PublishTargetType, error) {
|
|
switch s {
|
|
case "localfs":
|
|
return PublishTargetTypeLocalFS, nil
|
|
case "netlify":
|
|
return PublishTargetTypeNetlify, nil
|
|
default:
|
|
return PublishTargetTypeNone, nil
|
|
}
|
|
}
|
|
|
|
type Site struct {
|
|
ID int64
|
|
OwnerID int64
|
|
GUID string
|
|
Created time.Time
|
|
|
|
Title string
|
|
Tagline string
|
|
}
|
|
|
|
type SitePublishTarget struct {
|
|
ID int64
|
|
SiteID int64
|
|
GUID string
|
|
Enabled bool
|
|
|
|
BaseURL string
|
|
TargetType string
|
|
TargetRef string
|
|
TargetKey string
|
|
}
|