models

package
v0.0.0-...-3f6dde8 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HasEngine bool

	DbCfg struct {
		Type, Host, Name, User, Passwd, Path, SSLMode string
	}

	EnableSQLite3 bool
	EnableTidb    bool
)

Functions

func DumpDatabase

func DumpDatabase(filePath string) error

DumpDatabase dumps all data from database to file system.

func FeedCount

func FeedCount() (int64, error)

func HasSite

func HasSite(host string) (has bool, e error)

func LoadConfigs

func LoadConfigs()

func NewEngine

func NewEngine() (err error)

func NewTestEngine

func NewTestEngine(x *xorm.Engine) (err error)

func Ping

func Ping() error

func SaveSite

func SaveSite(s *Site) error

func SaveSiteFeed

func SaveSiteFeed(sf *SiteFeed) error

func SetEngine

func SetEngine() (err error)

func SiteCount

func SiteCount() (int64, error)

func SiteFeedCount

func SiteFeedCount(siteId int64) (int64, error)

func SiteFetchNewFeed

func SiteFetchNewFeed(siteId int64) error

func SiteLinkFetched

func SiteLinkFetched(link string) (bool, error)

func SiteSetHasFeed

func SiteSetHasFeed(id int64, hf bool) error

Types

type Engine

type Engine interface {
	Delete(interface{}) (int64, error)
	Exec(string, ...interface{}) (sql.Result, error)
	Find(interface{}, ...interface{}) error
	Get(interface{}) (bool, error)
	Insert(...interface{}) (int64, error)
	InsertOne(interface{}) (int64, error)
	Id(interface{}) *xorm.Session
	Sql(string, ...interface{}) *xorm.Session
	Where(string, ...interface{}) *xorm.Session
}

Engine represents a xorm engine or session.

type Site

type Site struct {
	Id     int64
	Domain string `xorm:"unique"`
	Title  string
	Www    bool
	Https  bool

	PreviewUrl string

	HasFeed bool

	Processed bool
	AliasTo   int64
	AddedBy   int64

	FeedFetched time.Time
	Created     time.Time
	Deleted     time.Time
	Updated     time.Time
}

func GetSite

func GetSite(id int64) (*Site, error)

func NewSite

func NewSite(link, title string) (*Site, error)

func SiteList

func SiteList(page int) (res []*Site, e error)

func (Site) Preview

func (s Site) Preview() string

type SiteFeed

type SiteFeed struct {
	Id    int64
	Title string
	Body  string `xorm:"LONGTEXT"`

	ImagePreview string
	Image        string

	Published time.Time
	Source    string `xorm:"unique"`
	SiteId    int64  `xorm:"index"`

	Created time.Time `xorm:"created"`
	Updated time.Time `xorm:"updated"`
}

func GetFeed

func GetFeed(p int) ([]*SiteFeed, error)

func GetSiteFeed

func GetSiteFeed(siteId int64, p int) ([]*SiteFeed, error)

func GetSiteFeedItem

func GetSiteFeedItem(id int64) (*SiteFeed, error)

func NewSiteFeedFromArticle

func NewSiteFeedFromArticle(art *articler.Article) *SiteFeed

type Statistic

type Statistic struct {
	Counter struct {
		User, Org, PublicKey,
		Repo, Watch, Star, Action, Access,
		Issue, Comment, Oauth, Follow,
		Mirror, Release, LoginSource, Webhook,
		Milestone, Label, HookTask,
		Team, UpdateTask, Attachment int64
	}
}

type User

type User struct {
	Id   int64
	Name string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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