models

package
v0.0.0-...-3426d20 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGroupsScanlation

func AddGroupsScanlation(m *GroupsScanlation) (err error)

AddGroupsScanlation insert a new GroupsScanlation into database and returns last inserted Name on success.

func AddLanguages

func AddLanguages(m *Languages) (id int64, err error)

AddLanguages insert a new Languages into database and returns last inserted Id on success.

func AddMultiChapterFiles

func AddMultiChapterFiles(files []SeriesChaptersFiles) (count int64, err error)

AddMultiChapterFiles adds multiple files to chapter ID

func AddMultiGroupUrl

func AddMultiGroupUrl(groups []GroupsScanlationUrls) (count int64, err error)

AddMultiGroupUrl adds multiple urls to group name

func AddMultiSeriesTags

func AddMultiSeriesTags(tags []*SeriesTags) (count int64, err error)

AddMultiSeriesTags adds multiple files to chapter ID

func AddMultiTags

func AddMultiTags(tags []*Tags) (count int64, err error)

AddMultiTagsTags adds multiple files to chapter ID

func AddNewSeriesRating

func AddNewSeriesRating(m *SeriesUserRatings) (id int64, err error)

func AddSeries

func AddSeries(m *Series) (id int64, err error)

AddSeries insert a new Series into database and returns last inserted Id on success.

func AddSeriesAlias

func AddSeriesAlias(m *SeriesAliases) (id int64, err error)

AddSeriesAlias insert a new Series into database and returns last inserted Id on success.

func AddSeriesChapterFiles

func AddSeriesChapterFiles(m *SeriesChaptersFiles) (id int64, err error)

AddSeries insert a new Series into database and returns last inserted Id on success.

func AddSeriesChapters

func AddSeriesChapters(m *SeriesChapters) (id int64, err error)

AddSeriesChapters insert a new SeriesChapters into database and returns last inserted Id on success.

func AddSeriesChaptersGroups

func AddSeriesChaptersGroups(m *SeriesChaptersGroups) (id int64, err error)

AddSeriesChaptersGroups insert a new SeriesChaptersGroups into database and returns last inserted Id on success.

func AddSeriesStatus

func AddSeriesStatus(m *SeriesStatus) (id int64, err error)

AddSeriesStatus insert a new SeriesStatus into database and returns last inserted Id on success.

func AddStatuses

func AddStatuses(m *Statuses) (id int64, err error)

AddStatuses insert a new Statuses into database and returns last inserted Id on success.

func AddTypes

func AddTypes(m *Types) (id int64, err error)

AddTypes insert a new Types into database and returns last inserted Id on success.

func AddUserGroups

func AddUserGroups(m *UsersGroups) (err error)

AddUserGroups insert a new UserGroups into database and returns last inserted Id on success.

func AddUsers

func AddUsers(m *Users) (id int64, err error)

AddUsers insert a new Users into database and returns last inserted Id on success.

func DeleteGroupsScanlation

func DeleteGroupsScanlation(name string) (err error)

DeleteGroupsScanlation deletes GroupsScanlation by Name and returns error if the record to be deleted doesn't exist

func DeleteLanguages

func DeleteLanguages(name string) (err error)

DeleteLanguages deletes Languages by Id and returns error if the record to be deleted doesn't exist

func DeleteSeries

func DeleteSeries(id int) (err error)

DeleteSeries deletes Series by Id and returns error if the record to be deleted doesn't exist

func DeleteSeriesChapters

func DeleteSeriesChapters(id int) (err error)

DeleteSeriesChapters deletes SeriesChapters by Id and returns error if the record to be deleted doesn't exist

func DeleteSeriesStatus

func DeleteSeriesStatus(id int) (err error)

DeleteSeriesStatus deletes SeriesStatus by Id and returns error if the record to be deleted doesn't exist

func DeleteUsers

func DeleteUsers(id int) (err error)

DeleteUsers deletes Users by Id and returns error if the record to be deleted doesn't exist

func EmailExists

func EmailExists(email string) (exists bool)

EmailExists checks to see if email exists returns bool

func Follow

func Follow(user_id, series_id int) (err error)

func Following

func Following(user_id, series_id int) (b bool)

func GetAllGroupsScanlation

func GetAllGroupsScanlation(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, count int64, err error)

GetAllGroupsScanlation retrieves all GroupsScanlation matches certain condition. Returns empty list if no records exist

func GetAllLanguages

func GetAllLanguages() (ml []interface{}, err error)

GetAllLanguages gets all languages and returns an array on success

func GetAllSeries

func GetAllSeries(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, count int64, err error)

GetAllSeries retrieves all Series matches certain condition. Returns empty list if no records exist

func GetAllSeriesChapters

func GetAllSeriesChapters(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, count int64, err error)

GetAllSeriesChapters retrieves all SeriesChapters matches certain condition. Returns empty list if no records exist

func GetAllSeriesStatus

func GetAllSeriesStatus(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, count int64, err error)

GetAllSeriesStatus retrieves all SeriesStatus matches certain condition. Returns empty list if no records exist

func GetAllStatuses

func GetAllStatuses() (ml []interface{}, err error)

GetAllStatuses gets all Types and returns an array on success

func GetAllTags

func GetAllTags(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, count int64, err error)

GetAllTags retrieves all Tags matches certain condition. Returns empty list if no records exist

func GetAllUsers

func GetAllUsers(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllUsers retrieves all Users matches certain condition. Returns empty list if no records exist

func GetRecentFollowedSeriesByChapter

func GetRecentFollowedSeriesByChapter(user_id int, offset int64, limit int64) (ml []interface{}, count int64, err error)

GetRecentFollowedSeriesByChapter Gets followed Series in order of chapter updates

func GetSeriesChaptersFilesCount

func GetSeriesChaptersFilesCount(id int) (count int64, err error)

GetSeriesChaptersByHash retrieves SeriesChapters by Id. Returns error if Id doesn't exist

func GroupsScanlationNameExists

func GroupsScanlationNameExists(name string) (exists bool)

GroupsScanlationNameExists checks to see if name exists returns bool

func SeriesNameExists

func SeriesNameExists(name string) (exists bool)
checks to see if username exists

returns bool

func Unfollow

func Unfollow(user_id, series_id int) (err error)

func UpdateGroupsScanlationByName

func UpdateGroupsScanlationByName(m *GroupsScanlation) (err error)

UpdateGroupsScanlation updates GroupsScanlation by Name and returns error if the record to be updated doesn't exist

func UpdateSeriesById

func UpdateSeriesById(m *Series) (err error)

UpdateSeries updates Series by Id and returns error if the record to be updated doesn't exist

func UpdateSeriesChaptersById

func UpdateSeriesChaptersById(m *SeriesChapters) (err error)

UpdateSeriesChapters updates SeriesChapters by Id and returns error if the record to be updated doesn't exist

func UpdateSeriesStatusById

func UpdateSeriesStatusById(m *SeriesStatus) (err error)

UpdateSeriesStatus updates SeriesStatus by Id and returns error if the record to be updated doesn't exist

func UpdateUsersById

func UpdateUsersById(m *Users) (err error)

UpdateUsers updates Users by Id and returns error if the record to be updated doesn't exist

func UsernameExists

func UsernameExists(username string) (exists bool)

UsernameExists checks to see if username exists returns bool

Types

type GroupsScanlation

type GroupsScanlation struct {
	Name                 string                  `orm:"column(name);pk"`
	Description          string                  `orm:"column(description)"`
	ReleaseDelay         int                     `orm:"column(release_delay);null"`
	GroupsScanlationUrls []*GroupsScanlationUrls `orm:"reverse(many)"`
}

func GetGroupsScanlationByName

func GetGroupsScanlationByName(name string) (v *GroupsScanlation, err error)

GetGroupsScanlationByName retrieves GroupsScanlation by Name. Returns error if Name doesn't exist

func (*GroupsScanlation) TableName

func (t *GroupsScanlation) TableName() string

type GroupsScanlationUrls

type GroupsScanlationUrls struct {
	GroupName *GroupsScanlation `orm:"column(group_name);rel(fk);pk"`
	Url       string            `orm:"column(url)"`
}

func GetAllGroupUrlsByName

func GetAllGroupUrlsByName(name string) (urls []GroupsScanlationUrls, err error)

func (*GroupsScanlationUrls) TableName

func (t *GroupsScanlationUrls) TableName() string

type Languages

type Languages struct {
	Name string `orm:"column(name);pk"`
	Code string `orm:"column(code)"`
}

func (*Languages) TableName

func (t *Languages) TableName() string

type Login

type Login struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Series

type Series struct {
	Id            int              `orm:"auto"`
	Name          string           `orm:"column(name)"`
	Description   string           `orm:"column(description)"`
	CoverImage    string           `orm:"column(cover_image)"`
	TypeName      string           `orm:"column(type_name)"`
	TypeDemonym   string           `orm:"column(type_demonym)"`
	Status        *Statuses        `orm:"column(status);rel(fk)"`
	SeriesTags    []*SeriesTags    `orm:"reverse(many)"`
	SeriesAliases []*SeriesAliases `orm:"reverse(many)"`
	SeriesRatings []*SeriesRatings `orm:"reverse(many)"`
}

func GetAllSeriesArray

func GetAllSeriesArray() (series []*Series, err error)

GetAllSeries gets all languages and returns an array on success

func GetSeriesById

func GetSeriesById(id int) (v *Series, err error)

GetSeriesById retrieves Series by Id. Returns error if Id doesn't exist

func GetSeriesByName

func GetSeriesByName(name string) (v Series, err error)

GetSeriesByName retrieves Series by Name. Returns error if Id doesn't exist

func (*Series) TableName

func (t *Series) TableName() string

type SeriesAliases

type SeriesAliases struct {
	SeriesId *Series `orm:"column(series_id);rel(fk);pk"`
	Name     string  `orm:"column(name)"`
}

func GetAllSeriesAliases

func GetAllSeriesAliases(id int) (aliases []*SeriesAliases, err error)
GetSeriesAliases checks to see if username exists

returns bool

func (*SeriesAliases) TableName

func (t *SeriesAliases) TableName() string

type SeriesChapters

type SeriesChapters struct {
	Id                    int                     `orm:"auto"`
	SeriesId              *Series                 `orm:"column(series_id);rel(fk)"`
	Title                 string                  `orm:"column(title)"`
	ChapterNumberAbsolute string                  `orm:"column(chapter_number_absolute)"`
	ChapterNumberVolume   string                  `orm:"column(chapter_number_volume);null"`
	VolumeNumber          string                  `orm:"column(volume_number);null"`
	ChapterLanguage       *Languages              `orm:"column(chapter_language);rel(fk)"`
	ContributorId         *Users                  `orm:"column(contributor_id);rel(fk)"`
	TimeUploaded          time.Time               `orm:"column(time_uploaded);type(timestamp without time zone);auto_now_add"`
	Hash                  string                  `orm:"column(hash)"`
	SeriesChaptersGroups  []*SeriesChaptersGroups `orm:"reverse(many)"`
	SeriesChaptersFiles   []*SeriesChaptersFiles  `orm:"reverse(many)"`
}

func GetRecentSeriesByChapter

func GetRecentSeriesByChapter(offset int, limit int) (b []SeriesChapters, err error)

GetRecentSeriesByChapter Gets Series in order of chapter updates

func GetSeriesChaptersByHash

func GetSeriesChaptersByHash(hash string) (v SeriesChapters, err error)

GetSeriesChaptersByHash retrieves SeriesChapters by Id. Returns error if Id doesn't exist

func GetSeriesChaptersById

func GetSeriesChaptersById(id int) (v *SeriesChapters, err error)

GetSeriesChaptersById retrieves SeriesChapters by Id. Returns error if Id doesn't exist

func GetSeriesChaptersBySeriesId

func GetSeriesChaptersBySeriesId(id int) (v SeriesChapters, err error)

GetSeriesChaptersBySeriesId retrieves SeriesChapters by Id. Returns error if Id doesn't exist

func (*SeriesChapters) TableName

func (t *SeriesChapters) TableName() string

type SeriesChaptersFiles

type SeriesChaptersFiles struct {
	ChapterId *SeriesChapters `orm:"column(chapter_id);rel(fk); pk"`
	Name      string          `orm:"column(name)"`
}

func GetAllChapterFilesById

func GetAllChapterFilesById(id int, limit int64, offset int64) (v []*SeriesChaptersFiles, err error)

GetAllChapterFilesById gets all files by id

func (*SeriesChaptersFiles) TableName

func (t *SeriesChaptersFiles) TableName() string

type SeriesChaptersGroups

type SeriesChaptersGroups struct {
	ChapterId *SeriesChapters `orm:"column(chapter_id);rel(fk);pk"`
	GroupName string          `orm:"column(group_name)"`
}

func (*SeriesChaptersGroups) TableName

func (t *SeriesChaptersGroups) TableName() string

type SeriesRatings

type SeriesRatings struct {
	SeriesId *Series `orm:"column(series_id);rel(fk);pk"`
	UserId   *Users  `orm:"column(user_id);rel(fk)"`
	Rating   int     `orm:"column(rating)"`
}

func (*SeriesRatings) TableName

func (t *SeriesRatings) TableName() string

type SeriesStatus

type SeriesStatus struct {
	Id     int    `orm:"auto"`
	Status string `orm:"column(status);null"`
}

func GetSeriesStatusById

func GetSeriesStatusById(id int) (v *SeriesStatus, err error)

GetSeriesStatusById retrieves SeriesStatus by Id. Returns error if Id doesn't exist

func (*SeriesStatus) TableName

func (t *SeriesStatus) TableName() string

type SeriesTags

type SeriesTags struct {
	SeriesId     *Series `orm:"column(series_id);rel(fk);pk;reverse(many)"`
	TagName      string  `orm:"column(tag_name)"`
	TagNamespace string  `orm:"column(tag_namespace)"`
}

func GetAllTagsById

func GetAllTagsById(id int) (v []*SeriesTags, err error)

GetAllTagsById gets all tag by id

func (*SeriesTags) TableName

func (t *SeriesTags) TableName() string

type SeriesUserRatings

type SeriesUserRatings struct {
	SeriesId *Series `orm:"column(series_id);rel(fk);pk"`
	UserId   *Users  `orm:"column(user_id);rel(fk)"`
	Rating   int     `orm:"column(rating);null"`
}

func GetAverageSeriesRating

func GetAverageSeriesRating(series_id int64) (u SeriesUserRatings, err error)

func (*SeriesUserRatings) TableName

func (t *SeriesUserRatings) TableName() string

type Signup

type Signup struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

type Statuses

type Statuses struct {
	Name string `orm:"column(name);pk"`
}

func (*Statuses) TableName

func (t *Statuses) TableName() string

type Tags

type Tags struct {
	Name      string `orm:"column(name);pk"`
	Namespace string `orm:"column(namespace)"`
}

func (*Tags) TableName

func (t *Tags) TableName() string

type Types

type Types struct {
	ID            int    `orm:pk`
	Name          string `orm:"column(name)"`
	OriginDemonym string `orm:"column(origin_demonym)"`
}

func GetAllTypes

func GetAllTypes() (types []*Types, err error)

GetAllTypes gets all Types and returns an array on success

func (*Types) TableName

func (t *Types) TableName() string

type Users

type Users struct {
	Id                   int                     `orm:"auto"`
	Username             string                  `orm:"column(username)"`
	Email                string                  `orm:"column(email);null"`
	PasswordHash         string                  `orm:"column(password_hash)"`
	UsersFollowingSeries []*UsersFollowingSeries `orm:"reverse(many)"`
	UsersGroups          []*UsersGroups          `orm:"reverse(many)"`
}

func GetUserByUsername

func GetUserByUsername(username string) (v *Users, err error)

GetUsersByUsername retrieves Users by Id. Returns error if username doesn't exist

func GetUsersById

func GetUsersById(id int) (v *Users, err error)

GetUsersById retrieves Users by Id. Returns error if Id doesn't exist

func (*Users) TableName

func (t *Users) TableName() string

type UsersFollowingSeries

type UsersFollowingSeries struct {
	UserId   *Users  `orm:"column(user_id);rel(fk);pk"`
	SeriesId *Series `orm:"column(series_id);rel(fk)"`
}

func (*UsersFollowingSeries) TableName

func (t *UsersFollowingSeries) TableName() string

type UsersGroups

type UsersGroups struct {
	Id        int    `orm:"auto"`
	UserId    *Users `orm:"column(user_id);rel(fk)"`
	GroupName string `orm:"column(group_name)"`
}

func (*UsersGroups) TableName

func (t *UsersGroups) TableName() string

Jump to

Keyboard shortcuts

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