Documentation
¶
Index ¶
- Constants
- type ChatCreatedResponse
- type ChatMessageResponse
- type ChatMessagesResponse
- type ChatsResponse
- type DeleteChatEvent
- type DeleteMessageEvent
- type DeleteReplyEvent
- type DeleteTweetEvent
- type ErrorEvent
- type ErrorResponse
- type FolloweesResponse
- type FollowersResponse
- type GetAllChatsEvent
- type GetAllMessagesEvent
- type GetAllRepliesEvent
- type GetAllTweetsEvent
- type GetAllUsersEvent
- type GetChallengeEvent
- type GetChallengeResponse
- type GetChatEvent
- type GetChatResponse
- type GetFolloweesEvent
- type GetFollowersEvent
- type GetImageEvent
- type GetImageResponse
- type GetLikersResponse
- type GetLikesCountEvent
- type GetMessageEvent
- type GetReTweetsCountEvent
- type GetReactorsEvent
- type GetReplyEvent
- type GetRetweetersResponse
- type GetTimelineEvent
- type GetTweetEvent
- type GetTweetStatsEvent
- type GetUserEvent
- type ID
- type IDsResponse
- type LikeEvent
- type LikesCountResponse
- type LoginEvent
- type LoginResponse
- type LogoutEvent
- type Message
- type MessageBody
- type ModerationEvent
- type ModerationObjectType
- type ModerationResult
- type ModerationResultEvent
- type NewChatEvent
- type NewFollowEvent
- type NewMessageEvent
- type NewMessageResponse
- type NewReplyEvent
- type NewReplyResponse
- type NewRetweetEvent
- type NewTweetEvent
- type NewUnfollowEvent
- type NewUserEvent
- type Owner
- type ReTweetsCountResponse
- type RepliesResponse
- type TweetStatsResponse
- type TweetsResponse
- type UnlikeEvent
- type UnretweetEvent
- type UploadImageEvent
- type UploadImageResponse
- type UsersResponse
- type ValidationEvent
- type ValidationResult
- type ValidationResultEvent
Constants ¶
const ( Accepted acceptedResponse = `{"code":0,"message":"Accepted"}` InternalRoutePrefix = "/internal" )
const ( // admin PUBLIC_POST_NODE_VALIDATION_RESULT = "/public/post/admin/validate/result/0.0.0" PUBLIC_POST_NODE_CHALLENGE = "/public/post/admin/challenge/0.0.0" PRIVATE_POST_PAIR = "/private/post/admin/pair/0.0.0" PRIVATE_GET_STATS = "/private/get/admin/stats/0.0.0" // moderation PUBLIC_POST_MODERATION_RESULT = "/public/post/moderate/result/0.0.0" // application PRIVATE_DELETE_CHAT = "/private/delete/chat/0.0.0" PRIVATE_DELETE_MESSAGE = "/private/delete/message/0.0.0" PRIVATE_DELETE_TWEET = "/private/delete/tweet/0.0.0" PRIVATE_GET_CHAT = "/private/get/chat/0.0.0" PRIVATE_GET_CHATS = "/private/get/chats/0.0.0" PRIVATE_GET_MESSAGE = "/private/get/message/0.0.0" PRIVATE_GET_MESSAGES = "/private/get/messages/0.0.0" PRIVATE_GET_TIMELINE = "/private/get/timeline/0.0.0" PRIVATE_POST_LOGIN = "/private/post/login/0.0.0" PRIVATE_POST_LOGOUT = "/private/post/logout/0.0.0" PRIVATE_POST_TWEET = "/private/post/tweet/0.0.0" PRIVATE_POST_USER = "/private/post/user/0.0.0" PUBLIC_DELETE_REPLY = "/public/delete/reply/0.0.0" PUBLIC_GET_FOLLOWEES = "/public/get/followees/0.0.0" PUBLIC_GET_FOLLOWERS = "/public/get/followers/0.0.0" PUBLIC_GET_INFO = "/public/get/info/0.0.0" PUBLIC_GET_REPLIES = "/public/get/replies/0.0.0" PUBLIC_GET_REPLY = "/public/get/reply/0.0.0" PUBLIC_GET_TWEET = "/public/get/tweet/0.0.0" PUBLIC_GET_TWEET_STATS = "/public/get/tweetstats/0.0.0" PUBLIC_GET_TWEETS = "/public/get/tweets/0.0.0" PUBLIC_GET_USER = "/public/get/user/0.0.0" PUBLIC_GET_USERS = "/public/get/users/0.0.0" PUBLIC_GET_WHOTOFOLLOW = "/public/get/whotofollow/0.0.0" PUBLIC_POST_CHAT = "/public/post/chat/0.0.0" PUBLIC_POST_FOLLOW = "/public/post/follow/0.0.0" PUBLIC_POST_LIKE = "/public/post/like/0.0.0" PUBLIC_POST_MESSAGE = "/public/post/message/0.0.0" PUBLIC_POST_REPLY = "/public/post/reply/0.0.0" PUBLIC_POST_RETWEET = "/public/post/retweet/0.0.0" PUBLIC_POST_UNFOLLOW = "/public/post/unfollow/0.0.0" PUBLIC_POST_UNLIKE = "/public/post/unlike/0.0.0" PUBLIC_POST_UNRETWEET = "/public/post/unretweet/0.0.0" PRIVATE_POST_UPLOAD_IMAGE = "/private/post/image/0.0.0" PUBLIC_GET_IMAGE = "/public/get/image/0.0.0" )
const ( INTERNAL_POST_NODE_VALIDATE = "/internal/post/admin/validate/0.0.0" INTERNAL_POST_MODERATE = "/internal/post/moderate/0.0.0" )
internal handlers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatCreatedResponse ¶
ChatCreatedResponse defines model for ChatCreatedResponse.
type ChatMessageResponse ¶
type ChatMessageResponse = domain.ChatMessage
ChatMessageResponse defines model for ChatMessageResponse.
type ChatMessagesResponse ¶
type ChatMessagesResponse struct {
ChatId string `json:"chat_id"`
Cursor string `json:"cursor"`
Messages []domain.ChatMessage `json:"messages"`
}
ChatMessagesResponse defines model for ChatMessagesResponse.
type ChatsResponse ¶
type ChatsResponse struct {
Chats []domain.Chat `json:"chats"`
Cursor string `json:"cursor"`
UserId string `json:"user_id"`
}
ChatsResponse defines model for ChatsResponse.
type DeleteChatEvent ¶
type DeleteChatEvent struct {
ChatId string `json:"chat_id"`
}
DeleteChatEvent defines model for DeleteChatEvent.
type DeleteMessageEvent ¶
type DeleteMessageEvent = GetMessageEvent
DeleteMessageEvent defines model for DeleteMessageEvent.
type DeleteReplyEvent ¶
type DeleteReplyEvent = GetReplyEvent
DeleteReplyEvent defines model for DeleteReplyEvent.
type DeleteTweetEvent ¶
type DeleteTweetEvent = GetTweetEvent
DeleteTweetEvent defines model for DeleteTweetEvent.
type ErrorEvent ¶
ErrorEvent defines model for ErrorEvent.
type ErrorResponse ¶
ErrorResponse defines model for ErrorResponse.
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
type FolloweesResponse ¶
type FolloweesResponse struct {
Cursor string `json:"cursor"`
Followees []domain.Following `json:"followees"`
Follower string `json:"follower"`
}
FolloweesResponse defines model for FolloweesResponse.
type FollowersResponse ¶
type FollowersResponse struct {
Cursor string `json:"cursor"`
Followee string `json:"followee"`
Followers []domain.Following `json:"followers"`
}
FollowersResponse defines model for FollowersResponse.
type GetAllChatsEvent ¶
type GetAllChatsEvent struct {
Cursor *string `json:"cursor,omitempty"`
Limit *uint64 `json:"limit,omitempty"`
UserId string `json:"user_id"`
}
GetAllChatsEvent defines model for GetAllChatsEvent.
type GetAllMessagesEvent ¶
type GetAllMessagesEvent struct {
ChatId string `json:"chat_id"`
Cursor *string `json:"cursor,omitempty"`
Limit *uint64 `json:"limit,omitempty"`
}
GetAllMessagesEvent defines model for GetAllMessagesEvent.
type GetAllRepliesEvent ¶
type GetAllRepliesEvent struct {
Cursor *string `json:"cursor,omitempty"`
Limit *uint64 `json:"limit,omitempty"`
ParentId string `json:"parent_id"`
RootId string `json:"root_id"`
}
GetAllRepliesEvent defines model for GetAllRepliesEvent.
type GetAllTweetsEvent ¶
type GetAllTweetsEvent struct {
Cursor *string `json:"cursor,omitempty"`
Limit *uint64 `json:"limit,omitempty"`
UserId string `json:"user_id"`
}
GetAllTweetsEvent defines model for GetAllTweetsEvent.
type GetAllUsersEvent ¶
type GetAllUsersEvent struct {
Cursor *string `json:"cursor,omitempty"`
Limit *uint64 `json:"limit,omitempty"`
// UserId default owner
UserId string `json:"user_id"`
}
GetAllUsersEvent defines model for GetAllUsersEvent.
type GetChallengeEvent ¶ added in v0.2.476
type GetChallengeResponse ¶ added in v0.2.476
type GetChatEvent ¶
type GetChatEvent struct {
ChatId string `json:"chat_id"`
}
GetChatEvent defines model for GetChatEvent.
type GetChatResponse ¶
type GetFolloweesEvent ¶
type GetFolloweesEvent = GetFollowersEvent
GetFolloweesEvent defines model for GetFolloweesEvent.
type GetFollowersEvent ¶
type GetFollowersEvent struct {
Cursor *string `json:"cursor,omitempty"`
Limit *uint64 `json:"limit,omitempty"`
UserId string `json:"user_id"`
}
GetFollowersEvent defines model for GetFollowersEvent.
type GetImageEvent ¶
type GetImageResponse ¶
type GetImageResponse struct {
// Image mime type + "," + base64
File string `json:"file"`
}
type GetLikersResponse ¶
type GetLikersResponse = UsersResponse
GetLikersResponse defines model for GetLikersResponse.
type GetLikesCountEvent ¶
type GetLikesCountEvent struct {
TweetId string `json:"tweet_id"`
}
GetLikesCountEvent defines model for GetLikesCountEvent.
type GetMessageEvent ¶
GetMessageEvent defines model for GetMessageEvent.
type GetReTweetsCountEvent ¶
type GetReTweetsCountEvent = GetLikesCountEvent
GetReTweetsCountEvent defines model for GetReTweetsCountEvent.
type GetReactorsEvent ¶
type GetReactorsEvent struct {
Cursor *string `json:"cursor,omitempty"`
Limit *uint64 `json:"limit,omitempty"`
TweetId string `json:"tweet_id"`
}
GetLikersEvent defines model for GetLikersEvent.
type GetReplyEvent ¶
type GetReplyEvent struct {
ReplyId string `json:"reply_id"`
RootId string `json:"root_id"`
UserId string `json:"user_id"`
}
GetReplyEvent defines model for GetReplyEvent.
type GetRetweetersResponse ¶
type GetRetweetersResponse = UsersResponse
GetRetweetersResponse defines model for GetRetweetersResponse.
type GetTimelineEvent ¶
type GetTimelineEvent = GetAllTweetsEvent
GetTimelineEvent defines model for GetTimelineEvent.
type GetTweetEvent ¶
GetTweetEvent defines model for GetTweetEvent.
type GetTweetStatsEvent ¶
type GetUserEvent ¶
type GetUserEvent struct {
UserId string `json:"user_id"`
}
GetUserEvent defines model for GetUserEvent.
type IDsResponse ¶
type LikeEvent ¶
type LikeEvent struct {
TweetId string `json:"tweet_id"`
UserId string `json:"user_id"`
OwnerId string `json:"owner_id"`
}
LikeEvent defines model for LikeEvent.
type LikesCountResponse ¶
type LikesCountResponse struct {
Count uint64 `json:"count"`
}
LikesCountResponse defines model for LikesCountResponse.
type LoginEvent ¶
LoginEvent defines model for LoginEvent.
type LoginResponse ¶
type LoginResponse = domain.AuthNodeInfo
LoginResponse defines model for LoginResponse.
type LogoutEvent ¶
type LogoutEvent struct {
Token string `json:"token"`
}
LogoutEvent defines model for LogoutEvent.
type Message ¶
type Message struct {
Body json.RawMessage `json:"body"`
MessageId string `json:"message_id"`
NodeId string `json:"node_id"`
Destination string `json:"path"` // TODO change to 'destination'
Timestamp time.Time `json:"timestamp,omitempty"`
Version string `json:"version"`
Signature string `json:"signature"`
}
Message defines model for Message.
type ModerationEvent ¶ added in v0.3.129
type ModerationEvent struct {
NodeID string `json:"node_id"`
UserID string `json:"user_id"`
Type ModerationObjectType `json:"type"`
ObjectID *string `json:"object_id,omitempty"`
}
type ModerationObjectType ¶ added in v0.3.129
type ModerationObjectType int
const ( User ModerationObjectType = iota Tweet Reply Image )
type ModerationResult ¶ added in v0.3.129
type ModerationResult bool
const ( OK ModerationResult = true FAIL ModerationResult = false )
func (ModerationResult) String ¶ added in v0.3.147
func (mr ModerationResult) String() string
type ModerationResultEvent ¶ added in v0.3.129
type ModerationResultEvent struct {
Type ModerationObjectType `json:"type"`
Result ModerationResult `json:"result"`
Reason *string `json:"reason,omitempty"`
NodeID string `json:"node_id"`
UserID string `json:"user_id"`
ObjectID *string `json:"object_id,omitempty"`
}
type NewChatEvent ¶
type NewChatEvent struct {
ChatId *string `json:"chat_id,omitempty"`
OtherUserId string `json:"other_user_id"`
OwnerId string `json:"owner_id"`
}
NewChatEvent defines model for NewChatEvent.
type NewFollowEvent ¶
NewFollowEvent defines model for NewFollowEvent.
type NewMessageEvent ¶
type NewMessageEvent = domain.ChatMessage
NewMessageEvent defines model for NewMessageEvent.
type NewMessageResponse ¶
type NewMessageResponse = domain.ChatMessage
NewMessageResponse defines model for NewMessageResponse.
type NewReplyEvent ¶
type NewReplyEvent struct {
CreatedAt time.Time `json:"created_at"`
Id string `json:"id"`
ParentId *string `json:"parent_id,omitempty"`
ParentUserId string `json:"parent_user_id"`
RootId string `json:"root_id"`
Text string `json:"text"`
UserId string `json:"user_id"`
Username string `json:"username"`
}
NewReplyEvent defines model for NewReplyEvent.
type NewReplyResponse ¶
NewReplyResponse defines model for NewReplyResponse.
type NewRetweetEvent ¶
NewRetweetEvent defines model for NewRetweetEvent.
type NewTweetEvent ¶
NewTweetEvent defines model for NewTweetEvent.
type NewUnfollowEvent ¶
NewUnfollowEvent defines model for NewUnfollowEvent.
type ReTweetsCountResponse ¶
type ReTweetsCountResponse = LikesCountResponse
ReTweetsCountResponse defines model for ReTweetsCountResponse.
type RepliesResponse ¶
type RepliesResponse struct {
Cursor string `json:"cursor"`
Replies []domain.ReplyNode `json:"replies"`
UserId *string `json:"user_id,omitempty"`
}
RepliesResponse defines model for RepliesTreeResponse.
type TweetStatsResponse ¶
type TweetsResponse ¶
type TweetsResponse struct {
Cursor string `json:"cursor"`
Tweets []domain.Tweet `json:"tweets"`
UserId string `json:"user_id"`
}
TweetsResponse defines model for TweetsResponse.
type UnretweetEvent ¶
type UnretweetEvent struct {
TweetId string `json:"tweet_id"`
RetweeterId string `json:"retweeter_id"`
}
UnretweetEvent defines model for UnretweetEvent.
type UploadImageEvent ¶
type UploadImageEvent struct {
// Image mime type + "," + base64
File string `json:"file"`
}
type UploadImageResponse ¶
type UploadImageResponse struct {
Key string `json:"key"`
}
type UsersResponse ¶
UsersResponse defines model for UsersResponse.
type ValidationEvent ¶ added in v0.3.75
type ValidationResult ¶ added in v0.3.75
type ValidationResult int
const ( Invalid ValidationResult = iota Valid )
func (ValidationResult) String ¶ added in v0.3.141
func (vr ValidationResult) String() string
type ValidationResultEvent ¶ added in v0.3.116
type ValidationResultEvent struct {
Result ValidationResult `json:"result"`
Reason *string `json:"reason,omitempty"`
ValidatedID string `json:"validated_id"`
ValidatorID string `json:"validator_id"`
}