Documentation
¶
Index ¶
- Variables
- func FromVis(value PostVisibility) string
- type Account
- type AccountField
- type AccountProfile
- type AccountSecurity
- type AccountVisibility
- type Actor
- type ActorFavorite
- type ActorFollowing
- type ActorNotification
- type ActorReblog
- type ActorReply
- type Entry
- type InboxObject
- type OauthClient
- type OauthToken
- func (ot *OauthToken) GetAccess() string
- func (ot *OauthToken) GetAccessCreateAt() time.Time
- func (ot *OauthToken) GetAccessExpiresIn() time.Duration
- func (ot *OauthToken) GetClientID() string
- func (ot *OauthToken) GetCode() string
- func (ot *OauthToken) GetCodeChallenge() string
- func (ot *OauthToken) GetCodeChallengeMethod() oauth2.CodeChallengeMethod
- func (ot *OauthToken) GetCodeCreateAt() time.Time
- func (ot *OauthToken) GetCodeExpiresIn() time.Duration
- func (ot *OauthToken) GetRedirectURI() string
- func (ot *OauthToken) GetRefresh() string
- func (ot *OauthToken) GetRefreshCreateAt() time.Time
- func (ot *OauthToken) GetRefreshExpiresIn() time.Duration
- func (ot *OauthToken) GetScope() string
- func (ot *OauthToken) GetUserID() string
- func (ot *OauthToken) New() oauth2.TokenInfo
- func (ot *OauthToken) SetAccess(s string)
- func (ot *OauthToken) SetAccessCreateAt(s time.Time)
- func (ot *OauthToken) SetAccessExpiresIn(s time.Duration)
- func (ot *OauthToken) SetClientID(ci string)
- func (ot *OauthToken) SetCode(s string)
- func (ot *OauthToken) SetCodeChallenge(s string)
- func (ot *OauthToken) SetCodeChallengeMethod(ccm oauth2.CodeChallengeMethod)
- func (ot *OauthToken) SetCodeCreateAt(s time.Time)
- func (ot *OauthToken) SetCodeExpiresIn(s time.Duration)
- func (ot *OauthToken) SetRedirectURI(ru string)
- func (ot *OauthToken) SetRefresh(s string)
- func (ot *OauthToken) SetRefreshCreateAt(s time.Time)
- func (ot *OauthToken) SetRefreshExpiresIn(s time.Duration)
- func (ot *OauthToken) SetScope(s string)
- func (ot *OauthToken) SetUserID(ui string)
- type Object
- type OutboxObjects
- type PostVisibility
- type QueryResult
- type RoleMask
- type Subscription
- type TimelineQuery
- type Toot
- type TootMedia
- type TootTag
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Snowflakes = util.NewSnowflake()
)
Functions ¶
func FromVis ¶
func FromVis(value PostVisibility) string
Types ¶
type Account ¶
type Account struct {
Id int64
Sid string
FullName string
Nick string
Email string
Visibility AccountVisibility
CreatedAt *time.Time
UpdatedAt *time.Time
RoleMask RoleMask
*AccountProfile
*AccountSecurity
}
type AccountField ¶
type AccountProfile ¶
type AccountProfile struct {
AccountID uint
Note string
Avatar string
Header string
Fields []AccountField
}
type AccountSecurity ¶
type AccountVisibility ¶
type AccountVisibility int32
const ( Public AccountVisibility = 0 Protected AccountVisibility = 1 Private AccountVisibility = 2 )
type ActorFavorite ¶
type ActorFollowing ¶
type ActorNotification ¶
type ActorReblog ¶
type ActorReply ¶
type Entry ¶
type Entry struct {
*Toot
// contains filtered or unexported fields
}
func (*Entry) MediaAttachments ¶
type InboxObject ¶
type OauthClient ¶
type OauthClient struct {
Id uint64
Name string `json:"name"`
ClientId string `json:"client_id"`
Secret string `json:"client_secret"`
RedirectUris string `json:"redirect_uri"`
Website string `json:"website"`
AccountId uint64
Scopes string
CreatedAt time.Time
}
func (*OauthClient) GetDomain ¶
func (x *OauthClient) GetDomain() string
func (*OauthClient) GetID ¶
func (x *OauthClient) GetID() string
func (*OauthClient) GetSecret ¶
func (x *OauthClient) GetSecret() string
func (*OauthClient) GetUserID ¶
func (x *OauthClient) GetUserID() string
type OauthToken ¶
type OauthToken struct {
ClientId string
AccountId uint64
RedirectUri string
Scope string
Code string
CodeChallenge string
CodeChallengeMethod string
CodeCreatedAt time.Time
CodeExpiresIn time.Duration
Access string
AccessCreatedAt time.Time
AccessExpiresIn time.Duration
Refresh string
RefreshCreatedAt time.Time
RefreshExpiresIn time.Duration
CreatedAt time.Time
}
func (*OauthToken) GetAccess ¶
func (ot *OauthToken) GetAccess() string
func (*OauthToken) GetAccessCreateAt ¶
func (ot *OauthToken) GetAccessCreateAt() time.Time
func (*OauthToken) GetAccessExpiresIn ¶
func (ot *OauthToken) GetAccessExpiresIn() time.Duration
func (*OauthToken) GetClientID ¶
func (ot *OauthToken) GetClientID() string
func (*OauthToken) GetCode ¶
func (ot *OauthToken) GetCode() string
func (*OauthToken) GetCodeChallenge ¶
func (ot *OauthToken) GetCodeChallenge() string
func (*OauthToken) GetCodeChallengeMethod ¶
func (ot *OauthToken) GetCodeChallengeMethod() oauth2.CodeChallengeMethod
func (*OauthToken) GetCodeCreateAt ¶
func (ot *OauthToken) GetCodeCreateAt() time.Time
func (*OauthToken) GetCodeExpiresIn ¶
func (ot *OauthToken) GetCodeExpiresIn() time.Duration
func (*OauthToken) GetRedirectURI ¶
func (ot *OauthToken) GetRedirectURI() string
func (*OauthToken) GetRefresh ¶
func (ot *OauthToken) GetRefresh() string
func (*OauthToken) GetRefreshCreateAt ¶
func (ot *OauthToken) GetRefreshCreateAt() time.Time
func (*OauthToken) GetRefreshExpiresIn ¶
func (ot *OauthToken) GetRefreshExpiresIn() time.Duration
func (*OauthToken) GetScope ¶
func (ot *OauthToken) GetScope() string
func (*OauthToken) GetUserID ¶
func (ot *OauthToken) GetUserID() string
func (*OauthToken) New ¶
func (ot *OauthToken) New() oauth2.TokenInfo
func (*OauthToken) SetAccess ¶
func (ot *OauthToken) SetAccess(s string)
func (*OauthToken) SetAccessCreateAt ¶
func (ot *OauthToken) SetAccessCreateAt(s time.Time)
func (*OauthToken) SetAccessExpiresIn ¶
func (ot *OauthToken) SetAccessExpiresIn(s time.Duration)
func (*OauthToken) SetClientID ¶
func (ot *OauthToken) SetClientID(ci string)
func (*OauthToken) SetCode ¶
func (ot *OauthToken) SetCode(s string)
func (*OauthToken) SetCodeChallenge ¶
func (ot *OauthToken) SetCodeChallenge(s string)
func (*OauthToken) SetCodeChallengeMethod ¶
func (ot *OauthToken) SetCodeChallengeMethod(ccm oauth2.CodeChallengeMethod)
func (*OauthToken) SetCodeCreateAt ¶
func (ot *OauthToken) SetCodeCreateAt(s time.Time)
func (*OauthToken) SetCodeExpiresIn ¶
func (ot *OauthToken) SetCodeExpiresIn(s time.Duration)
func (*OauthToken) SetRedirectURI ¶
func (ot *OauthToken) SetRedirectURI(ru string)
func (*OauthToken) SetRefresh ¶
func (ot *OauthToken) SetRefresh(s string)
func (*OauthToken) SetRefreshCreateAt ¶
func (ot *OauthToken) SetRefreshCreateAt(s time.Time)
func (*OauthToken) SetRefreshExpiresIn ¶
func (ot *OauthToken) SetRefreshExpiresIn(s time.Duration)
func (*OauthToken) SetScope ¶
func (ot *OauthToken) SetScope(s string)
func (*OauthToken) SetUserID ¶
func (ot *OauthToken) SetUserID(ui string)
type OutboxObjects ¶
type PostVisibility ¶
type PostVisibility int
var ( VisPublic PostVisibility = 0 VisUnlisted PostVisibility = 1 VisPrivate PostVisibility = 2 VisDirect PostVisibility = 3 VisLimited PostVisibility = 4 Visibilities = map[PostVisibility]string{ VisPublic: "public", VisUnlisted: "unlisted", VisPrivate: "private", VisDirect: "direct", VisLimited: "limited", } )
func ToVis ¶
func ToVis(word string) PostVisibility
type QueryResult ¶
type QueryResult struct {
Toots []*Entry
}
func (*QueryResult) IsEmpty ¶
func (qr *QueryResult) IsEmpty() bool
type Subscription ¶
type Subscription struct {
Id string
ActorId string
ClientId string
Endpoint string
KeyP256dh string
KeyAuth string
AlertMention int
AlertStatus int
AlertReblog int
AlertFollow int
AlertFollowRequest int
AlertFavorite int
AlertPoll int
AlertUpdate int
AlertAdminSignUp int
AlertAdminReport int
Policy string
CreatedAt time.Time
}
type TimelineQuery ¶
type TimelineQuery struct {
// these parameters match Mastodon's API parameters
MinId string
MaxId string
SinceId string
Limit uint64
ListId uint64
Local bool
Remote bool
OnlyMedia bool
Visibility PostVisibility
// contains filtered or unexported fields
}
func TQ ¶
func TQ(db *sqlx.DB) *TimelineQuery
func (*TimelineQuery) Execute ¶
func (tq *TimelineQuery) Execute() (*QueryResult, error)
type Toot ¶
type Toot struct {
Sid string `json:"id"`
Uri string `json:"uri"`
AccountId uint64
ActorId uint64
BoostOfId *string
InReplyTo *string `json:"in_reply_to_id,omitempty"`
InReplyToAccountId *uint64 `json:"in_reply_to_account_id,omitempty"`
Summary string `json:"spoiler_text"`
Content string `json:"content"`
Lang string `json:"language"`
Visibility PostVisibility
CreatedAt time.Time `json:"created_at"`
AuthorId string
CollectionId *uint64
PollId *uint64
AppId *uint64
LastEditAt *time.Time
UpdatedAt time.Time
DeletedAt *time.Time
}
type TootMedia ¶
type TootMedia struct {
Id uint64
Sid string
AccountId string
Salt string
MimeType string
Path string
ThumbMimeType string
ThumbPath string
Meta string
Description string
Blurhash string
CreatedAt time.Time
}
{
"id": "22345792",
"type": "image",
"url": "https://files.mastodon.social/media_attachments/files/022/345/792/original/57859aede991da25.jpeg",
"preview_url": "https://files.mastodon.social/media_attachments/files/022/345/792/small/57859aede991da25.jpeg",
"remote_url": null,
"text_url": "https://mastodon.social/media/2N4uvkuUtPVrkZGysms",
"meta": {
"original": {
"width": 640,
"height": 480,
"size": "640x480",
"aspect": 1.3333333333333333
},
"small": {
"width": 461,
"height": 346,
"size": "461x346",
"aspect": 1.3323699421965318
},
"focus": {
"x": -0.27,
"y": 0.51
}
},
"description": "test media description",
"blurhash": "UFBWY:8_0Jxv4mx]t8t64.%M-:IUWGWAt6M}"
}
Click to show internal directories.
Click to hide internal directories.