package lemmy
import "olowe.co/lemmy"
Package lemmy provides a client interface to the Lemmy HTTP API version 3.
Index ¶
- Constants
- Variables
- func ParseCommentPath(s string) []int
- type Client
- func (c *Client) Authenticated() bool
- func (c *Client) Comments(post int, mode ListMode) ([]Comment, error)
- func (c *Client) Communities(mode ListMode) ([]Community, error)
- func (c *Client) Login(name, password string) error
- func (c *Client) LookupComment(id int) (Comment, error)
- func (c *Client) LookupCommunity(name string) (Community, Counts, error)
- func (c *Client) LookupPost(id int) (Post, error)
- func (c *Client) Posts(community string, mode ListMode) ([]Post, error)
- func (c *Client) Reply(post int, parent int, msg string) error
- type Comment
- func (c *Comment) IsDir() bool
- func (c *Comment) ModTime() time.Time
- func (c *Comment) Mode() fs.FileMode
- func (c *Comment) Name() string
- func (c *Comment) Size() int64
- func (c *Comment) Sys() interface{}
- type Community
- func (c *Community) IsDir() bool
- func (c *Community) ModTime() time.Time
- func (c *Community) Mode() fs.FileMode
- func (c *Community) Name() string
- func (c *Community) Size() int64
- func (c Community) String() string
- func (c *Community) Sys() interface{}
- type Counts
- type ListMode
- type Person
- type Post
Constants ¶
const ( ListAll ListMode = "All" ListLocal = "Local" ListSubscribed = "Subscribed" )
Variables ¶
Functions ¶
func ParseCommentPath ¶
ParseCommentPath returns the comment IDs referenced by a Comment.
Types ¶
type Client ¶
type Client struct { *http.Client Address string // If true, HTTP request summaries are printed to standard error. Debug bool // contains filtered or unexported fields }
func (*Client) Authenticated ¶
func (*Client) Comments ¶
func (*Client) Communities ¶
func (*Client) Login ¶
func (*Client) LookupComment ¶
func (*Client) LookupCommunity ¶
func (*Client) LookupPost ¶
func (*Client) Posts ¶
func (*Client) Reply ¶
type Comment ¶
type Comment struct { ID int PostID int `json:"post_id"` // Holds ordered comment IDs referenced by this comment // for threading. Path string Content string CreatorID int `json:"creator_id"` Published time.Time Updated time.Time ActivityURL string `json:"ap_id"` Creator Person `json:"-"` }
func (*Comment) IsDir ¶
func (*Comment) ModTime ¶
func (*Comment) Mode ¶
func (*Comment) Name ¶
func (*Comment) Size ¶
func (*Comment) Sys ¶
func (c *Comment) Sys() interface{}
type Community ¶
type Community struct { ID int `json:"id"` FName string `json:"name"` Title string `json:"title"` Local bool ActorID string `json:"actor_id"` Published time.Time }
func (*Community) IsDir ¶
func (*Community) ModTime ¶
func (*Community) Mode ¶
func (*Community) Name ¶
func (*Community) Size ¶
func (Community) String ¶
func (*Community) Sys ¶
func (c *Community) Sys() interface{}
type Counts ¶
type Counts struct { Posts int Comments int CommunityID int `json:"community_id"` PostID int `json:"post_id"` }
type ListMode ¶
type ListMode string
type Person ¶
type Person struct { ID int `json:"id"` Name string `json:"name"` ActorID string `json:"actor_id"` Local bool `json:"local"` }
func (Person) String ¶
type Post ¶
type Post struct { ID int Title string `json:"name"` Body string CreatorID int `json:"creator_id"` URL string Published time.Time Updated time.Time Creator Person `json:"-"` }
func (*Post) IsDir ¶
func (*Post) ModTime ¶
func (*Post) Mode ¶
func (*Post) Name ¶
func (*Post) Size ¶
func (*Post) Sys ¶
func (p *Post) Sys() interface{}
Source Files ¶
auth.go cache.go client.go decode.go lemmy.go
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/Lemmy | |
fs | FS is a read-only filesystem interface to a Lemmy instance. |
- Version
- v0.0.0-20240412102151-35bde0c11e41 (latest)
- Published
- Apr 12, 2024
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 4 days ago –
Tools for package owners.