models

package
v0.0.0-...-e474068 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2017 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None = iota
	Read
	Unread
	Any
)

Markers

View Source
const (
	Uncategorized = "uncategorized"
	Saved         = "saved"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	ID        uint      `json:"-" gorm:"primary_key"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`

	Key string `json:"token"`

	User   User `json:"-"`
	UserID uint `json:"-"`
}

type Category

type Category struct {
	ID        uint      `json:"-" gorm:"primary_key"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	UUID string `json:"id"`

	User   User `json:"-"`
	UserID uint `json:"-"`

	Feeds []Feed `json:"-"`

	Name string `json:"name"`
}

type Entry

type Entry struct {
	ID        uint      `json:"-" gorm:"primary_key"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	UUID string `json:"id"`

	User   User `json:"-"`
	UserID uint `json:"-"`

	Feed   Feed
	FeedID uint `json:"-"`

	Tags []Tag `json:"-"`

	GUID        string    `json:"-"`
	Title       string    `json:"title"`
	Link        string    `json:"link"`
	Description string    `json:"description"`
	Author      string    `json:"author"`
	Published   time.Time `json:"published"`
	Saved       bool      `json:"isSaved"`
	Mark        Marker    `json:"markedAs"`
}

type Feed

type Feed struct {
	ID        uint      `json:"-" gorm:"primary_key"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	UUID string `json:"id"`

	Category   Category
	CategoryID uint `json:"-"`

	User   User `json:"-"`
	UserID uint `json:"-"`

	Entries []Entry `json:"-"`

	Title        string    `json:"title,optional"`
	Description  string    `json:"description,omitempty"`
	Subscription string    `json:"subscription,required"`
	Source       string    `json:"source,omitempty"`
	TTL          int       `json:"ttl,omitempty"`
	Etag         string    `json:"-"`
	LastUpdated  time.Time `json:"-"`
	Status       string    `json:"status,omitempty"`
}

type Marker

type Marker int

Marker type alias

func MarkerFromString

func MarkerFromString(marker string) Marker

type Stats

type Stats struct {
	Unread int `json:"unread"`
	Read   int `json:"read"`
	Saved  int `json:"saved"`
	Total  int `json:"total"`
}

type Tag

type Tag struct {
	ID        uint      `json:"-" gorm:"primary_key"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	UUID string `json:"id"`

	EntryID uint `json:"-"`

	Name string
}

type User

type User struct {
	ID        uint       `json:"-" gorm:"primary_key"`
	CreatedAt time.Time  `json:"created_at,omitempty"`
	UpdatedAt time.Time  `json:"updated_at,omitempty"`
	DeletedAt *time.Time `json:"deleted_at,omitempty" sql:"index"`

	UUID string `json:"id"`

	Categories []Category `json:"categories,omitempty"`
	Feeds      []Feed     `json:"feeds,omitempty"`
	Entries    []Entry    `json:"entries,omitempty"`
	APIKeys    []APIKey   `json:"-"`

	Username                  string `json:"username,required"`
	Email                     string `json:"email,optional"`
	PasswordHash              []byte `json:"-"`
	PasswordSalt              []byte `json:"-"`
	UncategorizedCategoryUUID string `json:"-"`
	SavedCategoryUUID         string `json:"-"`
}

Jump to

Keyboard shortcuts

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