Documentation
¶
Index ¶
- func Slugify(s string) string
- type Giphys
- type GiphysDisabled
- type GiphysExtractor
- type Journal
- type Journals
- func (js *Journals) CreateTable() error
- func (js *Journals) EnsureUniqueSlug(slug string, addition int) string
- func (js *Journals) FetchAll() []Journal
- func (js *Journals) FetchPaginated(query database.PaginationQuery) ([]Journal, database.PaginationInformation)
- func (js *Journals) FindBySlug(slug string) Journal
- func (js *Journals) FindNext(id int) Journal
- func (js *Journals) FindPrev(id int) Journal
- func (js *Journals) Save(j Journal) Journal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Giphys ¶
Giphys Common resource link for Giphy actions
func (*Giphys) ConvertIDsToIframes ¶
ConvertIDsToIframes Convert any IDs in the content into <iframe> embeds
func (*Giphys) ExtractContentsAndSearchAPI ¶
ExtractContentsAndSearchAPI Convert any searches, connecting to Giphy where required
type GiphysDisabled ¶ added in v0.2.2
GiphysDisabled Whne no API key available, perform no action
func (*GiphysDisabled) ExtractContentsAndSearchAPI ¶ added in v0.2.2
func (gs *GiphysDisabled) ExtractContentsAndSearchAPI(s string) string
ExtractContentsAndSearchAPI Perform no action without an API key
type GiphysExtractor ¶
GiphysExtractor Interface for extracting a Giphy search
func GiphyAdapter ¶ added in v0.2.2
func GiphyAdapter(c *app.Container) GiphysExtractor
GiphyAdapter Get the correct adapter to use depending on wither an API key is available
type Journal ¶
type Journal struct {
ID int `json:"id"`
Slug string `json:"slug"`
Title string `json:"title"`
Date string `json:"date"`
Content string `json:"content"`
}
Journal model
func (Journal) GetEditableDate ¶
GetEditableDate Get the date string for editing
func (Journal) GetExcerpt ¶ added in v0.4.1
GetExcerpt returns a small extract of the entry
type Journals ¶
type Journals struct {
Container *app.Container
Gs GiphysExtractor
}
Journals Common database resource link for Journal actions
func (*Journals) CreateTable ¶
CreateTable Create the actual table
func (*Journals) EnsureUniqueSlug ¶
EnsureUniqueSlug Make sure the current slug is unique
func (*Journals) FetchPaginated ¶ added in v0.4.1
func (js *Journals) FetchPaginated(query database.PaginationQuery) ([]Journal, database.PaginationInformation)
FetchPaginated returns a set of paginated journal entries
func (*Journals) FindBySlug ¶
FindBySlug Find a journal by slug