Documentation ¶
Overview ¶
Package for stacker.news API access
Index ¶
- Variables
- func CheckForErrors(graphqlErrors []GraphQLError) error
- func CheckNotifications() (bool, error)
- func CreateComment(parentId int, text string) (int, error)
- func Dupes(url string) (*[]Dupe, error)
- func FormatLink(id int) string
- func MakeStackerNewsRequest(body GraphQLPayload) (*http.Response, error)
- func PostLink(url string, title string, sub string) (int, error)
- func RefreshSession() error
- type Comment
- type CreateCommentsResponse
- type Dupe
- type DupesError
- type DupesResponse
- type GraphQLError
- type GraphQLPayload
- type HasNewNotesResponse
- type Item
- type ItemsCursor
- type ItemsQuery
- type ItemsResponse
- type Rss
- type RssAuthor
- type RssChannel
- type RssDate
- type RssItem
- type UpsertLinkResponse
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // stacker.news URL SnUrl = "https://stacker.news" // stacker.news API URL SnApiUrl = "https://stacker.news/api/graphql" // stacker.news session cookie SnAuthCookie string )
View Source
var (
StackerNewsRssFeedUrl = "https://stacker.news/rss"
)
Functions ¶
func CheckForErrors ¶
func CheckForErrors(graphqlErrors []GraphQLError) error
Returns error if any error was found
func CheckNotifications ¶ added in v0.1.1
Check for new notifications
func CreateComment ¶
Create a new comment
func MakeStackerNewsRequest ¶
func MakeStackerNewsRequest(body GraphQLPayload) (*http.Response, error)
Make GraphQL request using raw payload
func RefreshSession ¶ added in v0.2.0
func RefreshSession() error
Types ¶
type CreateCommentsResponse ¶
type CreateCommentsResponse struct { Errors []GraphQLError `json:"errors"` Data struct { CreateComment Comment `json:"createComment"` } `json:"data"` }
type DupesError ¶
func (*DupesError) Error ¶
func (e *DupesError) Error() string
type DupesResponse ¶
type DupesResponse struct { Errors []GraphQLError `json:"errors"` Data struct { Dupes []Dupe `json:"dupes"` } `json:"data"` }
type GraphQLError ¶
type GraphQLError struct {
Message string `json:"message"`
}
type GraphQLPayload ¶
type HasNewNotesResponse ¶
type HasNewNotesResponse struct { Errors []GraphQLError `json:"errors"` Data struct { HasNewNotes bool `json:"hasNewNotes"` } `json:"data"` }
type ItemsCursor ¶ added in v0.3.0
func Items ¶ added in v0.3.0
func Items(query *ItemsQuery) (*ItemsCursor, error)
type ItemsQuery ¶ added in v0.3.0
type ItemsResponse ¶
type ItemsResponse struct { Errors []GraphQLError `json:"errors"` Data struct { Items ItemsCursor `json:"items"` } `json:"data"` }
type Rss ¶ added in v0.3.0
type Rss struct {
Channel RssChannel `xml:"channel"`
}
type RssChannel ¶ added in v0.3.0
type RssDate ¶ added in v0.3.0
func (*RssDate) UnmarshalXML ¶ added in v0.3.0
type UpsertLinkResponse ¶
type UpsertLinkResponse struct { Errors []GraphQLError `json:"errors"` Data struct { UpsertLink Item `json:"upsertLink"` } `json:"data"` }
Click to show internal directories.
Click to hide internal directories.