db

package
v0.0.0-...-dbde576 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const POKEY_ARCHIVE_URL = "http://www.yellow5.com/pokey/archive/"

Variables

This section is empty.

Functions

This section is empty.

Types

type Comic

type Comic struct {
	Id     int64   `json:"-"`
	Index  uint32  `sql:"not null;unique" json:"index"`
	Title  string  `sql:"size:255;not null" json:"title"`
	Url    string  `sql:"size:255;not null;unique" json:"url"`
	Image  string  `sql:"size:255;not null;unique" json:"image"`
	Images []Image `json:"images,omitempty"`
	Tags   []Tag   `gorm:"many2many:pokey_comic_tags;" json:"tags,omitempty"`
}

func (Comic) TableName

func (c Comic) TableName() string

type Database

type Database struct {
	// contains filtered or unexported fields
}

func Open

func Open() (Database, error)

func (*Database) Clear

func (d *Database) Clear()

func (*Database) Init

func (d *Database) Init()

func (*Database) LoadAllComics

func (d *Database) LoadAllComics(comics *[]Comic, loadImages bool, loadTags bool)

func (*Database) LoadImages

func (d *Database) LoadImages(comic *Comic)

func (*Database) LoadTags

func (d *Database) LoadTags(comic *Comic)

func (*Database) Populate

func (d *Database) Populate()

type Image

type Image struct {
	Id      int64  `json:"-"`
	ComicId int64  `json:"-"`
	Order   int16  `sql:"not null" json:"-"`
	Url     string `sql:"size:255;not null" json:"url"`
}

func (Image) TableName

func (i Image) TableName() string

type Tag

type Tag struct {
	Id     int64   `json:"-"`
	Name   string  `sql:"size:255;not null;unique" json:"name"`
	Comics []Comic `gorm:"many2many:pokey_comic_tags;" json:"-"`
}

func (Tag) TableName

func (t Tag) TableName() string

Jump to

Keyboard shortcuts

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