Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct {
// Fields we care about in https-bot
ID int64 `json:"id"`
By string `json:"by"`
Text string `json:"text,omitempty"`
URL string `json:"url,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Dead bool `json:"dead,omitempty"`
// Fields we don't care about in https-bot
Type string `json:"type"`
Time TimestampSecond `json:"time"`
Parent int64 `json:"parent,omitempty"`
Poll int64 `json:"poll,omitempty"`
Kids []int64 `json:"kids,omitempty"`
Score int64 `json:"score,omitempty"`
Title string `json:"title,omitempty"`
Parts []int64 `json:"parts,omitempty"`
Descendants int64 `json:"descendants,omitempty"`
}
Item defines a firebase hacker news API item's json format.
Ref: https://github.com/HackerNews/API/blob/master/README.md#items.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
A Session is a logged in hn session that's able to reply.
func NewSession ¶
NewSession logs in.
type TimestampSecond ¶
TimestampSecond implements json encoding/decoding using seconds since EPOCH.
func (TimestampSecond) MarshalJSON ¶
func (ts TimestampSecond) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (TimestampSecond) String ¶
func (ts TimestampSecond) String() string
func (TimestampSecond) ToTime ¶
func (ts TimestampSecond) ToTime() time.Time
ToTime converts TimestampSecond back to time.Time.
func (*TimestampSecond) UnmarshalJSON ¶
func (ts *TimestampSecond) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.