Documentation ¶
Index ¶
- func InArray(val interface{}, array interface{}) (exists bool, index int)
- func NewDB() *firestore.Client
- func RemoveStringItem(slice []string, s int) []string
- func String(v string) *string
- func TruncateString(s string, maxLength int) string
- type AllArticles
- type ArticleDocument
- type GithubDB
- type MemDB
- type MemStorage
- type MessageCount
- type Model
- type PGSql
- type UserFavData
- type UserFavorite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveStringItem ¶ added in v0.2.0
RemoveStringItem: Remove string item from slice
func TruncateString ¶ added in v0.2.0
Types ¶
type AllArticles ¶
type AllArticles []ArticleDocument
ArticleDocument for sorting.
func (AllArticles) Len ¶
func (a AllArticles) Len() int
func (AllArticles) Less ¶
func (a AllArticles) Less(i, j int) bool
func (AllArticles) Swap ¶
func (a AllArticles) Swap(i, j int)
type ArticleDocument ¶
type ArticleDocument struct { ArticleID string `json:"article_id"` ArticleTitle string `json:"article_title"` Author string `json:"author"` Board string `json:"board"` Content string `json:"content"` Date string `json:"date"` IP string `json:"ip"` MessageCount MessageCount `bson:"message_count"` Messages []interface{} `json:"messages"` Timestamp int `json:"timestamp"` URL string `json:"url"` ImageLinks []string `json:"image_links"` }
func (*ArticleDocument) ToString ¶
func (d *ArticleDocument) ToString() (info string)
type GithubDB ¶
func NewGithubDB ¶
func (*GithubDB) Add ¶
func (u *GithubDB) Add(user UserFavorite)
func (*GithubDB) ShowAll ¶
func (u *GithubDB) ShowAll() (result []UserFavorite, err error)
ShowAll: Print all result.
func (*GithubDB) Update ¶
func (u *GithubDB) Update(user *UserFavorite) (err error)
type MemDB ¶
type MemDB struct {
Db MemStorage
}
func (*MemDB) Add ¶
func (u *MemDB) Add(user UserFavorite)
func (*MemDB) ShowAll ¶
func (u *MemDB) ShowAll() (result []UserFavorite, err error)
ShowAll: Print all result.
func (*MemDB) Update ¶
func (u *MemDB) Update(user *UserFavorite) (err error)
type MemStorage ¶
type MemStorage map[string]UserFavorite
type MessageCount ¶
type Model ¶
type Model struct { Db UserFavData Log *log.Logger }
type PGSql ¶
type PGSql struct { Db *pg.DB // contains filtered or unexported fields }
func (*PGSql) Add ¶
func (u *PGSql) Add(user UserFavorite)
func (*PGSql) ShowAll ¶
func (u *PGSql) ShowAll() (result []UserFavorite, err error)
ShowAll: Print all result.
func (*PGSql) Update ¶
func (u *PGSql) Update(user *UserFavorite) (err error)
type UserFavData ¶
type UserFavData interface { Add(user UserFavorite) Get(uid string) (result *UserFavorite, err error) ShowAll() (result []UserFavorite, err error) Update(user *UserFavorite) (err error) }
type UserFavorite ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.