database

package
v0.0.0-...-78981bd Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2015 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildsPath string

Functions

func BuildPropsFromZip

func BuildPropsFromZip(filepath string) map[string]string

func CheckErr

func CheckErr(err error, msg string)

func CreateFile

func CreateFile(file File)

func CreateRelease

func CreateRelease(release Release)

func CreateUser

func CreateUser(username string, password string) error

func DeleteFile

func DeleteFile(file File)

func DeleteRelease

func DeleteRelease(release Release)

func InitDb

func InitDb(dbPath string, builds string) *gorp.DbMap

func Md5File

func Md5File(filepath string) string

func PruneMissingFiles

func PruneMissingFiles()

func PublishFile

func PublishFile(file File)

func RefreshBuilds

func RefreshBuilds()

func ReleasesIndexJSON

func ReleasesIndexJSON() []map[string]string

func ReleasesListJSON

func ReleasesListJSON(device string, channels []string) []map[string]string

func StringInSlice

func StringInSlice(a string, list []string) bool

func UnpublishFile

func UnpublishFile(file File)

func UpdateFile

func UpdateFile(file File)

func UpdateRelease

func UpdateRelease(release Release)

Types

type File

type File struct {
	Id          int64 `db:"file_id"`
	Created     int64
	Name        string
	Size        int64
	Md5         string
	BuildDate   string
	ApiLevel    string
	Incremental string
	Device      string
	User        string
	Published   bool
}

func Files

func Files() []File

func FilesIndex

func FilesIndex() []File

func FindFile

func FindFile(id int64) File

func FindFileByIncremental

func FindFileByIncremental(incremental string) (File, error)

func FindFileByName

func FindFileByName(name string) (File, error)

func (File) ChangelogUrl

func (b File) ChangelogUrl() string

func (File) DeleteUrl

func (b File) DeleteUrl() string

func (File) DownloadPath

func (b File) DownloadPath() string

func (File) DownloadUrl

func (b File) DownloadUrl() string

type LoginForm

type LoginForm struct {
	User     string `form:"user" binding:"required"`
	Password string `form:"password" binding:"required"`
}

type Release

type Release struct {
	Id        int64 `db:"release_id"`
	Created   int64
	FileId    int64
	FileName  string
	Changelog string
	Channel   string
}

func FindRelease

func FindRelease(id int64) Release

func FindReleaseByFile

func FindReleaseByFile(file File) Release

func NewRelease

func NewRelease() Release

func ReleasesIndex

func ReleasesIndex() []Release

func (Release) ChannelNightly

func (r Release) ChannelNightly() bool

func (Release) ChannelSnapshot

func (r Release) ChannelSnapshot() bool

func (Release) GetId

func (r Release) GetId() int64

type User

type User struct {
	Id       int64 `db:"user_id"`
	Created  int64
	Username string
	Password string
}

func FindUser

func FindUser(id int64) (User, error)

func FindUserByUsername

func FindUserByUsername(username string) (User, error)

func UserList

func UserList() []User

func (*User) CreatedAt

func (u *User) CreatedAt() time.Time

func (User) GetId

func (u User) GetId() int64

func (*User) HumanCreatedAt

func (u *User) HumanCreatedAt() string

Jump to

Keyboard shortcuts

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