domain

package
v0.5.39 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const RetweetPrefix = "RT:"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthNodeInfo

type AuthNodeInfo struct {
	Identity Identity         `json:"identity"`
	NodeInfo warpnet.NodeInfo `json:"node_info"`
}

AuthNodeInfo defines model for AuthNodeInfo.

type Chat

type Chat struct {
	CreatedAt   time.Time `json:"created_at"`
	Id          string    `json:"id"`
	OtherUserId string    `json:"other_user_id"`
	OwnerId     string    `json:"owner_id"`
	LastMessage string    `json:"last_message"`
	UpdatedAt   time.Time `json:"updated_at"`
}

Chat defines model for Chat.

type ChatMessage

type ChatMessage struct {
	ChatId     string    `json:"chat_id"`
	CreatedAt  time.Time `json:"created_at,omitempty"`
	Id         string    `json:"id"`
	ReceiverId string    `json:"receiver_id"`
	SenderId   string    `json:"sender_id"`
	Text       string    `json:"text"`
	Status     string    `json:"status,omitempty"`
}

ChatMessage defines model for ChatMessage.

type Error

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

Error defines model for Error.

func (*Error) Error

func (e *Error) Error() string

type Following

type Following struct {
	// Followee to user
	Followee string `json:"followee"`

	// Follower from user
	Follower string `json:"follower"`
}

Following defines model for Following.

type Identity

type Identity struct {
	Owner Owner  `json:"owner"`
	Token string `json:"token"`
}

Identity defines model for Identity.

type Like

type Like struct {
	TweetId string `json:"tweet_id"`
	UserId  string `json:"user_id"`
}

Like defines model for Like.

type ModelType added in v0.3.163

type ModelType string
const LLAMA2 ModelType = "llama2"

type ModerationObjectType added in v0.5.30

type ModerationObjectType int
const (
	ModerationUserType ModerationObjectType = iota
	ModerationTweetType
	ModerationReplyType
	ModerationImageType
)

type ModerationResult added in v0.5.30

type ModerationResult bool

func (ModerationResult) String added in v0.5.30

func (mr ModerationResult) String() string

type Notification added in v0.5.30

type Notification struct {
	Type      NotificationType `json:"type"`
	Id        string           `json:"id"`
	Text      string           `json:"text"`
	UserId    string           `json:"user_id"`
	IsRead    bool             `json:"is_read"`
	CreatedAt time.Time        `json:"created_at"`
}

type NotificationType added in v0.5.30

type NotificationType string
const (
	NotificationModerationType NotificationType = "moderation"
	NotificationRetweetType    NotificationType = "retweet"
	NotificationFollowType     NotificationType = "follow"
	NotificationLikeType       NotificationType = "like"
	NotificationMentionType    NotificationType = "mention"
	NotificationReplyType      NotificationType = "reply"
)

func (NotificationType) String added in v0.5.30

func (n NotificationType) String() string

type Owner

type Owner struct {
	CreatedAt       time.Time `json:"created_at"`
	NodeId          string    `json:"node_id"`
	UserId          string    `json:"user_id"`
	RedundantUserID string    `json:"id"`
	Username        string    `json:"username"`
}

Owner defines model for Owner.

type ReplyNode

type ReplyNode struct {
	Children []ReplyNode `json:"children"`
	Reply    Tweet       `json:"reply"`
}

ReplyNode defines model for ReplyNode.

type Tweet

type Tweet struct {
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	Id        string     `json:"id"`
	ParentId  *string    `json:"parent_id,omitempty"`

	// RetweetedBy retweeted by user id
	RetweetedBy *string          `json:"retweeted_by,omitempty"`
	RootId      string           `json:"root_id"`
	Text        string           `json:"text"`
	UserId      string           `json:"user_id"`
	Username    string           `json:"username"`
	ImageKey    string           `json:"image_key"`
	Network     string           `json:"network"`
	Moderation  *TweetModeration `json:"moderation,omitempty"`
}

Tweet defines model for Tweet.

type TweetModeration added in v0.3.147

type TweetModeration struct {
	IsModerated bool      `json:"is_moderated"`
	ModeratorID string    `json:"moderator_id"`
	Model       ModelType `json:"model"`
	IsOk        bool      `json:"is_ok"`
	Reason      *string   `json:"reason"`
	TimeAt      time.Time `json:"time_at"`
}

type User

type User struct {
	// Avatar mime type + "," + base64
	AvatarKey string `json:"avatar_key,omitempty"`

	// BackgroundImage mime type + "," + base64
	BackgroundImageKey string            `json:"background_image_key"`
	Bio                string            `json:"bio"`
	Birthdate          string            `json:"birthdate"`
	CreatedAt          time.Time         `json:"created_at"`
	UpdatedAt          *time.Time        `json:"updated_at,omitempty"`
	FolloweesCount     uint64            `json:"followees_count"`
	FollowersCount     uint64            `json:"followers_count"`
	Id                 string            `json:"id"`
	IsOffline          bool              `json:"isOffline"`
	NodeId             string            `json:"node_id"`
	Network            string            `json:"network"`
	Latency            int64             `json:"latency"`
	TweetsCount        uint64            `json:"tweets_count"`
	Username           string            `json:"username"`
	Website            *string           `json:"website,omitempty"`
	Moderation         *UserModeration   `json:"moderation"`
	Metadata           map[string]string `json:"metadata"`
}

User defines model for User.

type UserModeration added in v0.3.110

type UserModeration struct {
	IsModerated bool      `json:"is_moderated"`
	Model       ModelType `json:"model"`
	IsOk        bool      `json:"is_ok"`
	Reason      *string   `json:"reason"`
	Strikes     uint8     `json:"strikes"`
	TimeAt      time.Time `json:"time_at"`
}

Jump to

Keyboard shortcuts

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