event

package
v0.6.0-dev Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Accepted            acceptedResponse = `{"code":0,"message":"Accepted"}`
	InternalRoutePrefix string           = "/internal"
	EndCursor           string           = "end"
)
View Source
const (
	// admin
	PRIVATE_POST_PAIR          = "/private/post/admin/pair/0.0.0"
	PUBLIC_POST_NODE_CHALLENGE = "/public/post/admin/challenge/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_NOTIFICATIONS = "/private/get/notifications/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_FOLLOWINGS     = "/public/get/followings/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_IS_FOLLOWING  = "/public/post/isfollowing/0.0.0"
	PUBLIC_POST_IS_FOLLOWER   = "/public/post/isfollower/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"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChallengeEvent added in v0.5.2

type ChallengeEvent struct {
	Samples []ChallengeSample `json:"samples"`
}

type ChallengeResponse added in v0.5.2

type ChallengeResponse struct {
	Solutions []ChallengeSolution `json:"solutions"`
}

type ChallengeSample added in v0.5.129

type ChallengeSample struct {
	DirStack  []int `json:"dir_stack"` // every index is level and value is dir num
	FileStack []int `json:"file_stack"`
	Nonce     int64 `json:"nonce"`
}

type ChallengeSolution added in v0.5.129

type ChallengeSolution struct {
	Challenge string `json:"challenge"`
	Signature string `json:"signature"`
}

type ChatCreatedResponse

type ChatCreatedResponse = domain.Chat

ChatCreatedResponse defines model for ChatCreatedResponse.

type ChatMessageResponse

type ChatMessageResponse = domain.ChatMessage

ChatMessageResponse defines model for ChatMessageResponse.

type ChatMessagesResponse

type ChatMessagesResponse struct {
	ChatId   domain.ID            `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 domain.ID     `json:"user_id"`
}

ChatsResponse defines model for ChatsResponse.

type DeleteChatEvent

type DeleteChatEvent struct {
	ChatId domain.ID `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

type ErrorEvent struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ErrorEvent defines model for ErrorEvent.

type FollowersResponse

type FollowersResponse struct {
	Cursor      string      `json:"cursor"`
	FollowingId string      `json:"following_id"`
	Followers   []domain.ID `json:"followers"`
}

type FollowingsResponse added in v0.5.83

type FollowingsResponse struct {
	Cursor     string      `json:"cursor"`
	Followings []domain.ID `json:"followings"`
	FollowerId domain.ID   `json:"follower_id"`
}

FollowingsResponse defines model for FollowingsResponse.

type GetAllChatsEvent

type GetAllChatsEvent struct {
	Cursor *string   `json:"cursor,omitempty"`
	Limit  *uint64   `json:"limit,omitempty"`
	UserId domain.ID `json:"user_id"`
}

GetAllChatsEvent defines model for GetAllChatsEvent.

type GetAllMessagesEvent

type GetAllMessagesEvent struct {
	ChatId domain.ID `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 domain.ID `json:"parent_id"`
	RootId   domain.ID `json:"root_id"`
}

GetAllRepliesEvent defines model for GetAllRepliesEvent.

type GetAllTweetsEvent

type GetAllTweetsEvent struct {
	Cursor *string   `json:"cursor,omitempty"`
	Limit  *uint64   `json:"limit,omitempty"`
	UserId domain.ID `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 domain.ID `json:"user_id"`
}

GetAllUsersEvent defines model for GetAllUsersEvent.

type GetChatEvent

type GetChatEvent struct {
	ChatId domain.ID `json:"chat_id"`
}

GetChatEvent defines model for GetChatEvent.

type GetChatResponse

type GetChatResponse = domain.Chat

type GetFollowersEvent

type GetFollowersEvent struct {
	Cursor *string   `json:"cursor,omitempty"`
	Limit  *uint64   `json:"limit,omitempty"`
	UserId domain.ID `json:"user_id"`
}

GetFollowersEvent defines model for GetFollowersEvent.

type GetFollowingsEvent added in v0.5.83

type GetFollowingsEvent = GetFollowersEvent

GetFollowingsEvent defines model for GetFollowingsEvent.

type GetImageEvent

type GetImageEvent struct {
	UserId string `json:"user_id"`
	// Image mime type + "," + base64
	Key string `json:"key"`
}

type GetImageResponse

type GetImageResponse struct {
	// Image mime type + "," + base64
	File string `json:"file"`
}

type GetIsFollowerEvent added in v0.5.83

type GetIsFollowerEvent = GetIsFollowingEvent

type GetIsFollowingEvent added in v0.5.83

type GetIsFollowingEvent struct {
	UserId domain.ID `json:"user_id"`
}

type GetLikersResponse

type GetLikersResponse = UsersResponse

GetLikersResponse defines model for GetLikersResponse.

type GetLikesCountEvent

type GetLikesCountEvent struct {
	TweetId domain.ID `json:"tweet_id"`
}

GetLikesCountEvent defines model for GetLikesCountEvent.

type GetMessageEvent

type GetMessageEvent struct {
	ChatId domain.ID `json:"chat_id"`
	Id     domain.ID `json:"id"`
}

GetMessageEvent defines model for GetMessageEvent.

type GetNotificationsEvent added in v0.5.30

type GetNotificationsEvent struct {
	Cursor *string `json:"cursor,omitempty"`
	Limit  *uint64 `json:"limit,omitempty"`
}

type GetNotificationsResponse added in v0.5.30

type GetNotificationsResponse struct {
	Cursor        string                `json:"cursor"`
	UnreadCount   uint64                `json:"unread_count"`
	Notifications []domain.Notification `json:"notifications"`
}

type GetReTweetsCountEvent

type GetReTweetsCountEvent = GetLikesCountEvent

GetReTweetsCountEvent defines model for GetReTweetsCountEvent.

type GetReplyEvent

type GetReplyEvent struct {
	ReplyId domain.ID `json:"reply_id"`
	RootId  domain.ID `json:"root_id"`
	UserId  domain.ID `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

type GetTweetEvent struct {
	TweetId domain.ID `json:"tweet_id"`
	UserId  domain.ID `json:"user_id"`
}

GetTweetEvent defines model for GetTweetEvent.

type GetTweetStatsEvent

type GetTweetStatsEvent struct {
	TweetId domain.ID `json:"tweet_id"`
	UserId  domain.ID `json:"user_id"`
}

type GetUserEvent

type GetUserEvent struct {
	UserId domain.ID `json:"user_id"`
}

GetUserEvent defines model for GetUserEvent.

type IDsResponse

type IDsResponse struct {
	Cursor string      `json:"cursor"`
	Users  []domain.ID `json:"users"`
}

type IsFollowerResponse added in v0.5.83

type IsFollowerResponse struct {
	IsFollower bool `json:"is_follower"`
}

type IsFollowingResponse added in v0.5.83

type IsFollowingResponse struct {
	IsFollowing bool `json:"is_following"`
}

type LikeEvent

type LikeEvent struct {
	TweetId domain.ID `json:"tweet_id"`
	UserId  domain.ID `json:"user_id"`
	OwnerId domain.ID `json:"owner_id"`
}

LikeEvent defines model for LikeEvent.

type LikesCountResponse

type LikesCountResponse struct {
	Count uint64 `json:"count"`
}

LikesCountResponse defines model for LikesCountResponse.

type LoginEvent

type LoginEvent struct {
	Password string `json:"password"`
	Username string `json:"username"`
}

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   domain.ID       `json:"message_id"`
	NodeId      domain.ID       `json:"node_id"`
	Destination string          `json:"path"` // TODO change to 'destination'
	Timestamp   time.Time       `json:"timestamp"`
	Version     string          `json:"version"`
	Signature   string          `json:"signature"`
}

Message defines model for Message.

type MessageBody

type MessageBody any

MessageBody defines model for Message.Body.

type ModerationEvent added in v0.3.129

type ModerationEvent struct {
	NodeID   domain.ID                   `json:"node_id"`
	UserID   domain.ID                   `json:"user_id"`
	Type     domain.ModerationObjectType `json:"type"`
	ObjectID *domain.ID                  `json:"object_id,omitempty"`
}

type ModerationResultEvent added in v0.3.129

type ModerationResultEvent struct {
	Type     domain.ModerationObjectType `json:"type"`
	Result   domain.ModerationResult     `json:"result"`
	Reason   *string                     `json:"reason,omitempty"`
	Model    domain.ModelType            `json:"model"`
	UserID   domain.ID                   `json:"user_id"`
	ObjectID *domain.ID                  `json:"object_id,omitempty"`
}

type NewChatEvent

type NewChatEvent struct {
	ChatId      *domain.ID `json:"chat_id,omitempty"`
	OtherUserId domain.ID  `json:"other_user_id"`
	OwnerId     domain.ID  `json:"owner_id"`
}

NewChatEvent defines model for NewChatEvent.

type NewFollowEvent

type NewFollowEvent = struct {
	FollowerId  domain.ID
	FollowingId domain.ID
}

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           domain.ID  `json:"id"`
	ParentId     *domain.ID `json:"parent_id,omitempty"`
	ParentUserId domain.ID  `json:"parent_user_id"`
	RootId       domain.ID  `json:"root_id"`
	Text         string     `json:"text"`
	UserId       domain.ID  `json:"user_id"`
	Username     string     `json:"username"`
}

NewReplyEvent defines model for NewReplyEvent.

type NewReplyResponse

type NewReplyResponse = domain.Tweet

NewReplyResponse defines model for NewReplyResponse.

type NewRetweetEvent

type NewRetweetEvent = domain.Tweet

NewRetweetEvent defines model for NewRetweetEvent.

type NewTweetEvent

type NewTweetEvent = domain.Tweet

NewTweetEvent defines model for NewTweetEvent.

type NewUnfollowEvent

type NewUnfollowEvent = NewFollowEvent

NewUnfollowEvent defines model for NewUnfollowEvent.

type NewUserEvent

type NewUserEvent = domain.User

NewUserEvent defines model for NewUserEvent.

type Owner

type Owner = domain.Owner

Owner defines model for Owner.

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  *domain.ID         `json:"user_id,omitempty"`
}

RepliesResponse defines model for RepliesTreeResponse.

type ResponseError added in v0.5.140

type ResponseError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ErrorResponse defines model for ErrorResponse.

func (ResponseError) Error added in v0.5.140

func (e ResponseError) Error() string

type TweetStatsResponse

type TweetStatsResponse struct {
	TweetId       domain.ID `json:"tweet_id"`
	TweetsCount   uint64    `json:"tweets_count"`
	RetweetsCount uint64    `json:"retweets_count"`
	LikeCount     uint64    `json:"likes_count"`
	RepliesCount  uint64    `json:"replies_count"`
	ViewsCount    uint64    `json:"views_count"`
}

type TweetsResponse

type TweetsResponse struct {
	Cursor string         `json:"cursor"`
	Tweets []domain.Tweet `json:"tweets"`
	UserId domain.ID      `json:"user_id"`
}

TweetsResponse defines model for TweetsResponse.

type UnlikeEvent

type UnlikeEvent = LikeEvent

UnlikeEvent defines model for UnlikeEvent.

type UnretweetEvent

type UnretweetEvent struct {
	TweetId     domain.ID `json:"tweet_id"`
	RetweeterId domain.ID `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

type UsersResponse struct {
	Cursor string        `json:"cursor"`
	Users  []domain.User `json:"users"`
}

UsersResponse defines model for UsersResponse.

type ValidationEvent added in v0.3.75

type ValidationEvent struct {
	ValidatedNodeID domain.ID      `json:"validated_node_id"`
	SelfHashHex     string         `json:"self_hash_hex"`
	Challenge       ChallengeEvent `json:"challenge"`
	User            *domain.User   `json:"user"`
}

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 domain.ID        `json:"validated_id"`
	ValidatorID domain.ID        `json:"validator_id"`
}

Jump to

Keyboard shortcuts

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