site.go
package models
import "github.com/readysite/readysite/pkg/database"
// Site represents a hosted ReadySite instance.
// The ID is a URL-safe slug derived from the name (e.g. "my-portfolio").
type Site struct {
database.Model
UserID string
Name string
Plan string // "free" / "pro"
Status string // "launching" / "active" / "failed" / "stopped" / "deleted" / "shutdown"
Description string
AuthSecret string // JWT signing secret shared with the site's website container
}
// IsPro returns true if this site is on the Pro plan.
func (s *Site) IsPro() bool { return s.Plan == "pro" }
// Subdomain returns the default subdomain for this site (the slug ID).
func (s *Site) Subdomain() string {
return s.ID
}
// Owner returns the user who owns this site.
func (s *Site) Owner() (*User, error) {
return Users.Get(s.UserID)
}