accounts

package
v0.0.0-...-a05749a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package accounts is telephant's account "plugin" system.

Package accounts is telephant's account "plugin" system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account interface {
	Authenticate(code, redirectURI string) (string, string, string, string, error)
	Run(eventChan chan interface{}) error

	Post(message string) error
	Reply(replyid string, message string) error
	Share(id string) error
	Unshare(id string) error
	Like(id string) error
	Unlike(id string) error
	Follow(id string) error
	Unfollow(id string) error

	LoadConversation(id string) ([]MessageEvent, error)
	LoadAccount(id string) (ProfileEvent, []MessageEvent, error)
}

Account describes the interface every implementation of a Telephant social media account must fulfill.

type DeleteEvent

type DeleteEvent struct {
	ID string
}

type ErrorEvent

type ErrorEvent struct {
	Message  string
	Internal bool
}

ErrorEvent describes an error that occurred.

type Follow

type Follow struct {
	Account    string
	Name       string
	Avatar     string
	ProfileURL string
	ProfileID  string
	Following  bool
	FollowedBy bool
}

Follow describes an incoming follow event.

type LoginEvent

type LoginEvent struct {
	Username      string
	Name          string
	Avatar        string
	ProfileURL    string
	ProfileID     string
	Posts         int64
	FollowCount   int64
	FollowerCount int64
	PostSizeLimit int64
}

LoginEvent describes a login event.

type Media

type Media struct {
	ID      string
	Preview string
	URL     string
}

Media describes a media item.

type MessageEvent

type MessageEvent struct {
	Account      string
	Name         string
	Reply        bool
	Forward      bool
	Mention      bool
	Like         bool
	Followed     bool
	Notification bool
	Notify       bool
	Post         Post
	Follow       Follow
	Media        []Media
}

MessageEvent describes an incoming message event.

type Pane

type Pane struct {
	ID      string
	Title   string
	Sticky  bool
	Default bool
	Stream  func(ch chan interface{}) error
}

type Post

type Post struct {
	MessageID     string
	Body          string
	Sensitive     bool
	Warning       string
	Author        string
	AuthorURL     string
	AuthorName    string
	AuthorID      string
	Actor         string
	ActorName     string
	ActorID       string
	ReplyToID     string
	ReplyToAuthor string
	Avatar        string
	PostID        string
	URL           string
	Mentions      []User
	CreatedAt     time.Time
	Liked         bool
	Shared        bool
	RepliesCount  int64
	LikesCount    int64
	SharesCount   int64
	Visibility    string
}

Post represents a message.

type ProfileEvent

type ProfileEvent struct {
	Username      string
	Name          string
	Avatar        string
	ProfileURL    string
	ProfileID     string
	Posts         int64
	FollowCount   int64
	FollowerCount int64
	Following     bool
	FollowedBy    bool
}

ProfileEvent describes a profile event.

type User

type User struct {
	ID   string
	Name string
	URL  string
}

User describes a user object

Directories

Path Synopsis
Package mastodon is a Mastodon account for Telephant.
Package mastodon is a Mastodon account for Telephant.
Package twitter is a Twitter account for Telephant.
Package twitter is a Twitter account for Telephant.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL