models

package
v0.0.0-...-bd6ff0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2016 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSite

func CreateSite(user User, repository *github.Repository, template, domain string) error

func Init

func Init() error

func RegisterUser

func RegisterUser(user *goth.User) error

Types

type CombinedSite

type CombinedSite struct {
	Repository githubapi.Repository
	Site       *Site
}

type Owner

type Owner struct {
	ID        int64
	Name      string
	Slug      string
	AvatarURL string
}

type Site

type Site struct {
	ID          int64
	Title       string
	Description string
	GitHubURL   string `orm:"unique"`
	Template    string
	Version     string
	Domain      string `orm:"unique"`
	Analytics   string
	User        *User     `orm:"rel(fk)"`
	Created     time.Time `orm:"auto_now_add;type(datetime)"`
	Updated     time.Time `orm:"auto_now;type(datetime)"`
}

func SiteByOwner

func SiteByOwner(siteID, userID int64) (*Site, error)

func (*Site) Delete

func (s *Site) Delete() error

type Sites

type Sites struct {
	*github.Repositories
	All []*CombinedSite
}

func LoadSites

func LoadSites(repos *github.Repositories) (*Sites, error)

type Template

type Template struct {
	ID          int64  `json:"-"`
	Path        string `json:"-",orm:"unique"`
	BasePath    string `json:"-",orm:"unique"`
	Name        string `json:"name",orm:"unique"`
	Home        string `json:"home"`
	Description string `json:"description"`
}

func AllTemplates

func AllTemplates() []*Template

func GetTemplate

func GetTemplate(basePath string) (Template, error)

type User

type User struct {
	ID        int64
	Name      string
	AvatarURL string
	Slug      string    `orm:"unique"`
	UUID      string    `orm:"unique"`
	Email     string    `orm:"unique"`
	Created   time.Time `orm:"auto_now_add;type(datetime)"`
}

func GetUser

func GetUser(slug string) (User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL