Documentation ¶
Index ¶
- Constants
- func ConvertHttpToWebsocket(rawUrl string) (*url.URL, error)
- func PrintAuthenticateURL(w io.Writer, u string)
- func RecieveAuthenticateCode(queryName string, validator func(string) bool) (string, error)
- type Account
- type Announcement
- type Client
- type ClientCredential
- type CreatePostOpts
- type DecodeError
- type Endpoint
- type HTTPError
- type Mention
- type Post
- type Profile
- type Reaction
- type Relationship
- type RequestError
- type StreamingListTimelineOpts
- type StreamingTimelineOpts
- type Tag
- type User
- type UserCredential
Constants ¶
View Source
const ( // AuthCallbackAddr : コールバックを待つサーバーのアドレス AuthCallbackAddr = "localhost:3000" // AuthCallbackURL : コールバックURL AuthCallbackURL = "http://localhost:3000/callback" )
Variables ¶
This section is empty.
Functions ¶
func ConvertHttpToWebsocket ¶
ConvertHttpToWebsocket : スキーマをWSに変換
func PrintAuthenticateURL ¶
PrintAuthenticateURL : 認証用URLを出力
Types ¶
type Account ¶
type Account struct { // ID : ユーザーID ID string // Username : ユーザー名 + ドメイン名 Username string // DisplayName : 表示名 DisplayName string // Private : 非公開アカウントか Private bool // Bot : ボットアカウントか Bot bool // Verified : 認証アカウントか Verified bool // BIO : 自己紹介文 BIO string // CreatedAt : アカウント作成日 CreatedAt time.Time // FollowersCount : フォロワー数 FollowersCount int // FollowingCount : フォロイー数 FollowingCount int // PostsCount : 投稿数 PostsCount int // Profiles : プロフィール一覧 Profiles []Profile }
Account : アカウント
type Announcement ¶
type Announcement struct { ID string PublishedAt time.Time UpdatedAt *time.Time Title string Text string }
Announcement : サービスからのお知らせ
type Client ¶
type Client interface { // IsStreamingSupported : ストリーミングをサポートしているか IsStreamingSupported() bool // GetVisibilityList : 公開範囲の種類を取得 GetVisibilityList() []string // CreatePostURL : 投稿のURLを作成 CreatePostURL(post *Post) (string, error) // RegisterNewApplication : サーバーにアプリケーションを登録 RegisterNewApplication() (string, string, error) // Authenticate : アプリケーション認証を行なってアクセストークンを取得 Authenticate(w io.Writer) (string, error) // GetAnnouncements : サーバーからのお知らせを取得 GetAnnouncements() ([]*Announcement, error) // CreatePost : 投稿を作成 CreatePost(opts *CreatePostOpts) (*Post, error) // QuotePost : 投稿を引用 QuotePost(id string, opts *CreatePostOpts) (*Post, error) // ReplyPost : 投稿に返信 ReplyPost(id string, opts *CreatePostOpts) (*Post, error) // DeletePost : 投稿を削除 DeletePost(id string) error // UploadMedia : メディアをアップロード (画像のみ対応) UploadMedia(filename string, src io.Reader) (string, error) // Reaction : 投稿にリアクション Reaction(id string, reactionName string) (*Post, error) // Unreaction : リアクションを削除 Unreaction(id string) (*Post, error) // Repost : 投稿をリポスト Repost(id string) (*Post, error) // Unrepost : リポストを削除 Unrepost(id string) (*Post, error) // Bookmark : 投稿をブックマーク Bookmark(id string) (*Post, error) // Unbookmark : ブックマークを解除 Unbookmark(id string) (*Post, error) // SearchAccounts : アカウントを検索 SearchAccounts(query string, limit int) ([]*Account, error) // GetAccount : アカウント情報を取得 GetAccount(id string) (*Account, error) // GetLoginAccount : ログイン中のアカウント情報を取得 GetLoginAccount() (*Account, error) // GetRelationships : ユーザーとの関係を取得 GetRelationships(ids []string) ([]*Relationship, error) // GetPosts : アカウントの投稿を取得 GetPosts(id string, limit int) ([]*Post, error) // Follow : ユーザーをフォロー Follow(id string) (*Relationship, error) // Unfollow : ユーザーのフォローを解除 Unfollow(id string) (*Relationship, error) // Block : ユーザーをブロック Block(id string) (*Relationship, error) // Unblock : ユーザーのブロックを解除 Unblock(id string) (*Relationship, error) // Mute : ユーザーをミュート Mute(id string) (*Relationship, error) // Unmute : ユーザーをミュート Unmute(id string) (*Relationship, error) // GetGlobalTimeline : グローバルタイムラインを取得 GetGlobalTimeline(sinceID string, limit int) ([]*Post, error) // GetLocalTimeline : ローカルタイムラインを取得 GetLocalTimeline(sinceID string, limit int) ([]*Post, error) // GetHomeTimeline : ホームタイムラインを取得 GetHomeTimeline(sinceID string, limit int) ([]*Post, error) // GetListTimeline : リストタイムラインを取得 GetListTimeline(listID, sinceID string, limit int) ([]*Post, error) // StreamingGlobalTimeline : グローバルタイムラインをストリーミング StreamingGlobalTimeline(opts *StreamingTimelineOpts) error // StreamingLocalTimeline : ローカルタイムラインをストリーミング StreamingLocalTimeline(opts *StreamingTimelineOpts) error // StreamingHomeTimeline : ホームタイムラインをストリーミング StreamingHomeTimeline(opts *StreamingTimelineOpts) error // StreamingListTimeline : リストタイムラインをストリーミング StreamingListTimeline(opts *StreamingListTimelineOpts) error }
type ClientCredential ¶
type ClientCredential struct { // Service : サービス種別 Service string Name string ID string Secret string }
ClientCredential : クライアントの資格情報
func (*ClientCredential) IsUncertified ¶
func (c *ClientCredential) IsUncertified() bool
IsUncertified : 資格情報が無いかどうか
type CreatePostOpts ¶
type CreatePostOpts struct { // Text : 本文 Text string // MediaIDs : 添付するメディアに対応するID MediaIDs []string // Visibility : 公開範囲 Visibility string // Sensitive : センシティブな内容を含むか Sensitive bool }
CreatePostOpts : 投稿の作成に関する設定
type DecodeError ¶
func (*DecodeError) Error ¶
func (d *DecodeError) Error() string
type HTTPError ¶
func NewHTTPError ¶
type Post ¶
type Post struct { // ID : 投稿のID ID string // CreatedAt : 投稿日 CreatedAt time.Time // Visibility : 公開範囲 Visibility string // Sensitive : センシティブな内容を含むか Sensitive bool // RepostCount : リポスト数 RepostCount int // Reactions : リアクション Reactions []Reaction // Reposted : リポスト済か Reposted bool // Bookmarked : ブックマーク済か Bookmarked bool // Text : 本文 Text string // Mentions : メンション Mentions []Mention // Tags : ハッシュタグ Tags []Tag // Via : 投稿元 Via string // Reference : 引用元 Reference *Post // Author : 投稿者 Author *Account }
Post : 投稿
type Relationship ¶
type Relationship struct { // ID : ユーザーID ID string // Following : フォローしているか Following bool // FollowedBy : フォローされているか FollowedBy bool // Blocking : ブロックしているか Blocking bool // BlockedBy : ブロックされているか BlockedBy bool // Muting : ミュートしているか Muting bool // Requested : フォロー申請しているか Requested bool }
Relationship : ユーザーとの関係
type RequestError ¶
func (RequestError) Error ¶
func (r RequestError) Error() string
type StreamingListTimelineOpts ¶
type StreamingListTimelineOpts struct { *StreamingTimelineOpts ListID string }
StreamingListTimelineOpts : リストTLストリーミング関数のオプション
type StreamingTimelineOpts ¶
type StreamingTimelineOpts struct { Context context.Context OnUpdate func(post *Post) OnDelete func(id string) OnError func(err error) }
StreamingTimelineOpts : TLストリーミング関数の共通オプション
type UserCredential ¶
UserCredential : ユーザーの資格情報
Click to show internal directories.
Click to hide internal directories.