Documentation ¶
Index ¶
- func AddToCache(key string, value interface{})
- func AddToCacheWithExpiration(key string, value interface{}, expiration time.Duration)
- func GetFromCache(key string) (interface{}, bool)
- func HandleAPIRequestBest(c *gin.Context)
- func HandleItemRequest(c *gin.Context)
- func InitializeCache()
- type Base
- type BaseWithKids
- type Comment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToCache ¶
func AddToCache(key string, value interface{})
func GetFromCache ¶
func HandleAPIRequestBest ¶
func HandleItemRequest ¶
HandleItemRequest handles the request for an individual item.
func InitializeCache ¶
func InitializeCache()
Types ¶
type Base ¶
type Base struct { ID int `json:"id" binding:"required"` Type string `json:"type" binding:"required"` By string `json:"by"` Time int `json:"time"` Kids []int `json:"kids,omitempty"` Dead bool `json:"-"` Deleted bool `json:"-"` Descendants int `json:"descendants"` Score int `json:"score"` Title string `json:"title,omitempty"` Parent int `json:"parent,omitempty"` URL string `json:"url,omitempty"` Text string `json:"text,omitempty"` }
Base contains possible fields for any response non-required fields are optional and may not exist
type BaseWithKids ¶
type BaseWithKids struct { ID int `json:"id" binding:"required"` Type string `json:"type" binding:"required"` By string `json:"by"` Time int `json:"time"` Kids []interface{} `json:"kids,omitempty"` Dead bool `json:"-"` Deleted bool `json:"-"` Descendants int `json:"descendants"` Score int `json:"score"` Title string `json:"title,omitempty"` Parent int `json:"parent,omitempty"` URL string `json:"url,omitempty"` Text string `json:"text,omitempty"` }
type Comment ¶
type Comment struct { ID int `json:"id" binding:"required"` Type string `json:"type" binding:"required"` By string `json:"by"` Time int `json:"time"` Kids []interface{} `json:"kids,omitempty"` Dead bool `json:"-"` Deleted bool `json:"-"` Descendants int `json:"descendants"` Score int `json:"score"` Parent int `json:"parent,omitempty"` Text string `json:"text,omitempty"` }
Click to show internal directories.
Click to hide internal directories.