models

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// VisibilityPublic is for public notes.
	VisibilityPublic = "public"
	// VisibilityHome is for home notes.
	// It means, the post will be visible only on
	// your timeline.
	VisibilityHome = "home"
	// VisibilityFollowers is for only followers.
	VisibilityFollowers = "followers"
	// VisibilitySpecified is the case when other fields
	// defines who can see it.
	VisibilitySpecified = "specified"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Announcement

type Announcement struct {
	ID        core.String `json:"id"`
	CreatedAt *time.Time  `json:"createdAt"`
	UpdatedAt *time.Time  `json:"updatedAt"`
	Title     core.String `json:"title"`
	Text      core.String `json:"text"`
	ImageURL  core.String `json:"imageUrl"`
	IsRead    bool        `json:"isRead"`
	Reads     uint64      `json:"reads"`
}

Announcement represents one announcement.

type Antenna

type Antenna struct {
	ID              string        `json:"id"`
	CreatedAt       time.Time     `json:"createdAt"`
	Name            string        `json:"name"`
	Keywords        [][]string    `json:"keywords"`
	ExcludeKeywords [][]string    `json:"excludeKeywords"`
	Source          AntennaSource `json:"src"`
	UserListID      core.String   `json:"userListId"`
	UserGroupID     core.String   `json:"userGroupId"`
	Users           []string      `json:"users"`
	CaseSensitive   bool          `json:"caseSensitive"`
	Notify          bool          `json:"notify"`
	WithReplies     bool          `json:"withReplies"`
	WithOnlyFile    bool          `json:"withFile"`
	HasUnreadNote   bool          `json:"hasUnreadNote"`
}

Antenna is a pure representation of an Antenna.

type AntennaSource

type AntennaSource string

AntennaSource is just an "enum" like type alias.

const (
	// HomeSrc is "home" as source for an Antenna.
	HomeSrc AntennaSource = "home"
	// AllSrc is "all" as source for an Antenna.
	AllSrc AntennaSource = "all"
	// UsersSrc is "users" as source for an Antenna.
	UsersSrc AntennaSource = "users"
	// ListSrc is "list" as source for an Antenna.
	ListSrc AntennaSource = "list"
	// GroupSrc is "group" as source for an Antenna.
	GroupSrc AntennaSource = "group"
)

type App added in v1.1.1

type App struct {
	ID           string      `json:"id"`
	Name         string      `json:"name"`
	CallbackURL  core.String `json:"callbackUrl"`
	Permission   []string    `json:"permission"`
	Secret       string      `json:"secret"`
	IsAuthorized bool        `json:"isAuthorized"`
}

App represents an App from /app endpoints.

type Choice

type Choice struct {
	Text    string `json:"text"`
	Votes   uint64 `json:"votes"`
	IsVoted bool   `json:"isVoted"`
}

Choice is a sinple Choice in a Poll.

type Clip

type Clip struct {
	ID        string     `json:"id"`
	CreatedAt *time.Time `json:"createdAt"`
	Name      string     `json:"name"`
}

Clip is a simple representation of a Clip.

type Delayed added in v1.0.1

type Delayed struct {
	Host  string
	Count int64
}

Delayed job count per host.

type Emoji

type Emoji struct {
	ID       core.String   `json:"id"`
	Aliases  []core.String `json:"aliases"`
	Name     core.String   `json:"name"`
	Category core.String   `json:"category"`
	Host     core.String   `json:"host"`
	URL      core.String   `json:"url"`
}

Emoji is a simple representation of an Emoji.

type File

type File struct {
	ID           string         `json:"id"`
	CreatedAt    time.Time      `json:"createdAt"`
	Name         core.String    `json:"name"`
	Type         string         `json:"type"`
	Md5          string         `json:"md5"`
	Size         uint64         `json:"size"`
	IsSensitive  bool           `json:"isSensitive"`
	Blurhash     string         `json:"blurhash"`
	Properties   FileProperties `json:"properties"`
	URL          string         `json:"url"`
	Comment      string         `json:"comment"`
	ThumbnailURL string         `json:"thumbnailUrl"`
	FolderID     core.String    `json:"folderId"`
	Folder       *Folder        `json:"folder"`
	User         *User          `json:"user"`
}

File is a file. Folder and User is defined as an interface{} because I have no idea how it looks like.

type FileProperties

type FileProperties struct {
	Width       int    `json:"width"`
	Height      int    `json:"height"`
	Orientation int    `json:"orientation"`
	AvgColor    string `json:"avgColor"`
}

FileProperties holds the properties of the file like width and height. I don't know if there are other too, so I'll go that way now.

type Folder

type Folder struct {
	ID           string      `json:"id"`
	ParentID     core.String `json:"parentId"`
	CreatedAt    time.Time   `json:"createdAt"`
	Name         string      `json:"name"`
	FoldersCount uint64      `json:"foldersCount"`
	FilesCount   uint64      `json:"filesCount"`
	Parent       *Folder     `json:"parent"`
}

Folder is the representation of a Folder entity.

Actually it seems, even if the API documentation says it returns with the number of sub-folders and files, it doesn't return always with them. Some of the endpoints return with the values like Show, but mostly not.

type FollowStatus

type FollowStatus struct {
	ID         string `json:"id"`
	CreatedAt  string `json:"createdAt"`
	FolloweeID string `json:"followeeId"`
	Followee   User   `json:"followee"`
	FollowerID string `json:"followerId"`
	Follower   User   `json:"follower,omitempty"`
}

FollowStatus defines the status of followers and followees.

type Group added in v1.0.4

type Group struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	Name      string    `json:"name"`
	OwnerID   string    `json:"ownerId"`
	UserIDs   []string  `json:"userIds"`
}

Group represents a user group.

type GroupInvitation added in v1.0.4

type GroupInvitation struct {
	ID    string `json:"id"`
	Group Group  `json:"group"`
}

GroupInvitation represents a group invitation.

type Hashtag

type Hashtag struct {
	Tag                       string `json:"tag"`
	MentionedUsersCount       uint64 `json:"mentionedUsersCount"`
	MentionedLocalUsersCount  uint64 `json:"mentionedLocalUsersCount"`
	MentionedRemoteUsersCount uint64 `json:"mentionedRemoteUsersCount"`
	AttachedUsersCount        uint64 `json:"attachedUsersCount"`
	AttachedLocalUsersCount   uint64 `json:"attachedLocalUsersCount"`
	AttachedRemoteUsersCount  uint64 `json:"attachedRemoteUsersCount"`
}

Hashtag represents a hashtag.

type Instance

type Instance struct {
	ID                      string `json:"id"`
	CaughtAt                string `json:"caughtAt"`
	Host                    string `json:"host"`
	UserCount               int    `json:"userCount"`
	NotesCount              int    `json:"notesCount"`
	FollowingCount          int    `json:"followingCount"`
	FollowersCount          int    `json:"followersCount"`
	LatestStatus            int    `json:"latestStatus"`
	DriveUsage              int64  `json:"driveUsage"`
	DriveFiles              int64  `json:"driveFiles"`
	LatestRequestSentAt     string `json:"latestRequestSentAt"`
	LatestRequestReceivedAt string `json:"latestRequestReceivedAt"`
	LastCommunicatedAt      string `json:"lastCommunicatedAt"`
	SoftwareName            string `json:"softwareName"`
	SoftwareVersion         string `json:"softwareVersion"`
	Name                    string `json:"name"`
	Description             string `json:"description"`
	MaintainerName          string `json:"maintainerName"`
	MaintainerEmail         string `json:"maintainerEmail"`
	IconURL                 string `json:"iconUrl"`
	FaviconURL              string `json:"faviconUrl"`
	InfoUpdatedAt           string `json:"infoUpdatedAt"`
	ThemeColor              string `json:"86b300"`
	IsNotResponding         bool   `json:"isNotResponding"`
	IsSuspended             bool   `json:"isSuspended"`
	OpenRegistrations       bool   `json:"openRegistrations"`
}

Instance has information about a single instance given a host.

type Job added in v1.0.1

type Job struct {
	ID          string      `json:"id"`
	Attempts    int         `json:"attempts"`
	MaxAttempts int         `json:"maxAttempts"`
	Timestamp   int64       `json:"timestamp"`
	Data        interface{} `json:"data"`
}

Job is one job in the queue. Data is an interface for now, as it's not a unified resposne. The response is different based on the called Queue. For example deliver has a simple response, but inbox contains the Federated Activity object itself.

type Log added in v1.0.1

type Log struct {
	ID        string      `json:"id"`
	CreatedAt time.Time   `json:"createdAt"`
	Domain    []string    `json:"domain"`
	Level     string      `json:"level"`
	Worker    string      `json:"worker"`
	Machine   string      `json:"machine"`
	Message   string      `json:"message"`
	Data      interface{} `json:"data"`
}

Log from admin/logs.

type ModerationLog added in v1.0.1

type ModerationLog struct {
	ID        string      `json:"id"`
	CreatedAt time.Time   `json:"createdAt"`
	Type      string      `json:"type"`
	UserID    string      `json:"userId"`
	User      User        `json:"user"`
	Info      interface{} `json:"info"`
}

ModerationLog from admin/show-moderation-logs.

type Note

type Note struct {
	ID           string            `json:"id"`
	CreatedAt    time.Time         `json:"createdAt"`
	UserID       string            `json:"userId"`
	User         User              `json:"user"`
	Text         string            `json:"text"`
	CW           core.String       `json:"cw"`
	Visibility   string            `json:"visibility"`
	Mentions     []string          `json:"mentions"`
	RenoteCount  uint64            `json:"renoteCount"`
	RepliesCount uint64            `json:"repliesCount"`
	Reactions    map[string]uint64 `json:"reactions"`
	Tags         []string          `json:"tags"`
	FileIds      []string          `json:"fileIds"`
	Files        []File            `json:"files"`
	Reply        *Note             `json:"reply"`
	ReplyID      core.String       `json:"replyId"`
	RenoteID     core.String       `json:"renoteId"`
	URI          string            `json:"uri"`
	URL          string            `json:"url"`
	Instance     *Instance         `json:"instance"`
	Poll         *Poll             `json:"poll"`
}

Note is a note.

type Page

type Page struct {
	ID                  string     `json:"id"`
	CreatedAt           *time.Time `json:"createdAt"`
	UpdatedAt           *time.Time `json:"updatedAt"`
	UserID              string     `json:"userId"`
	User                *User      `json:"user"`
	Title               string     `json:"title"`
	Name                string     `json:"name"`
	HideTitleWhenPinned bool       `json:"hideTitleWhenPinned"`
	AlignCenter         bool       `json:"alignCenter"`
	IsLiked             bool       `json:"isLiked"`
	LikedCount          int        `json:"likedCount"`
	Font                string     `json:"font"`
	Script              string     `json:"script"`
	EyeCatchingImageID  string     `json:"eyeCatchingImageId"`
	EyeCatchingImage    *File      `json:"eyeCatchingImage"`
	AttachedFiles       []File     `json:"attachedFiles"`

	Content   interface{}   `json:"content"`
	Summary   interface{}   `json:"summary"`
	Variables []interface{} `json:"variables"`
}

Page is the representation of a Page.

Right now, as I'm working on Hashtags/Users, I don't know how Content, Variables and Summary are structured, so I just leave them as interface{} for now, and when we start to implement page endpoint, we can fill in the gap.

type Poll

type Poll struct {
	Multiple  bool      `json:"multiple"`
	ExpiresAt time.Time `json:"expiresAt"`
	Choices   []Choice  `json:"choices"`
}

Poll represents a Poll data structure for Misskey.

type QueueStat added in v1.0.1

type QueueStat struct {
	Waiting   int64 `json:"waiting"`
	Active    int64 `json:"active"`
	Completed int64 `json:"completed"`
	Failed    int64 `json:"failed"`
	Delayed   int64 `json:"delayed"`
	Paused    int64 `json:"paused"`
}

QueueStat gives an overview of a queue with numbers.

type QueueStats added in v1.0.1

type QueueStats struct {
	Deliver       QueueStat `json:"deliver"`
	Inbox         QueueStat `json:"inbox"`
	DB            QueueStat `json:"db"`
	ObjectStorage QueueStat `json:"objectStorage"`
}

QueueStats contains all available queue stats.

type Reaction

type Reaction struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	User      User      `json:"user"`
	Type      string    `json:"type"`
}

Reaction is the representation of a Reaction.

type Relay added in v1.0.4

type Relay struct {
	ID     string      `json:"id"`
	Inbox  string      `json:"inbox"`
	Status RelayStatus `json:"status"`
}

Relay is a simple representation of a Relay.

type RelayStatus added in v1.0.4

type RelayStatus string

RelayStatus is a type to represent relay statuses.

const (
	// RelayStatusRequesting is the status of a pending relay.
	RelayStatusRequesting RelayStatus = "requesting"
	// RelayStatusAccepted is the status of an accepted relay.
	RelayStatusAccepted RelayStatus = "accepted"
	// RelayStatusRejected is the status of a rejected relay.
	RelayStatusRejected RelayStatus = "rejected"
)

type Report added in v1.0.1

type Report struct {
	ID           string    `json:"id"`
	CreatedAt    time.Time `json:"createdAt"`
	Comment      string    `json:"comment"`
	Resolved     bool      `json:"resolved"`
	ReporterID   string    `json:"reporterId"`
	TargetUserID string    `json:"targetUserId"`
	AssigneeID   string    `json:"assigneeId"`
	Reporter     *User     `json:"reporter"`
	TargetUser   *User     `json:"targetUser"`
	Assignee     *User     `json:"assignee"`
}

Report represents a reported user. Only users can be reported, for reports on specific resource like Note, the Comment field container the URL for that resource.

type User

type User struct {
	ID                             string      `json:"id"`
	Name                           string      `json:"name"`
	Username                       string      `json:"username"`
	Host                           core.String `json:"host"`
	AvatarURL                      string      `json:"avatarUrl"`
	AvatarBlurhash                 core.String `json:"avatarBlurhash"`
	AvatarColor                    core.String `json:"avatarColor"`
	CreatedAt                      *time.Time  `json:"createdAt"`
	UpdatedAt                      *time.Time  `json:"updatedAt"`
	URL                            core.String `json:"url"`
	BannerURL                      string      `json:"BannerUrl"`
	BannerBlurhash                 core.String `json:"BannerBlurhash"`
	BannerColor                    core.String `json:"BannerColor"`
	IsAdmin                        bool        `json:"isAdmin"`
	IsModerator                    bool        `json:"isModerator"`
	IsBot                          bool        `json:"isBot"`
	IsCat                          bool        `json:"isCat"`
	IsLocked                       bool        `json:"isLocked"`
	IsSilenced                     bool        `json:"isSilenced"`
	IsSuspended                    bool        `json:"isSuspended"`
	TwoFactorEnabled               bool        `json:"twoFactorEnabled"`
	UsePasswordLessLogin           bool        `json:"usePasswordLessLogin"`
	SecurityKeys                   bool        `json:"securityKeys"`
	IsFollowing                    bool        `json:"isFollowing"`
	IsFollowed                     bool        `json:"isFollowed"`
	HasPendingFollowRequestFromYou bool        `json:"hasPendingFollowRequestFromYou"`
	HasPendingFollowRequestToYou   bool        `json:"hasPendingFollowRequestToYou"`
	IsBlocking                     bool        `json:"isBlocking"`
	IsBlocked                      bool        `json:"isBlocked"`
	IsMuted                        bool        `json:"isMuted"`
	Description                    string      `json:"description"`
	Location                       core.String `json:"location"`
	Birthday                       core.String `json:"birthday"`
	Fields                         []UserField `json:"fields"`
	FollowersCount                 uint64      `json:"followersCount"`
	FollowingCount                 uint64      `json:"followingCount"`
	NotesCount                     uint64      `json:"notesCount"`
	PinnedNoteIDs                  []string    `json:"pinnedNoteIds"`
	PinnedNotes                    []Note      `json:"pinnedNotes"`
	PinnedPageID                   core.String `json:"pinnedPageId"`
	PinnedPage                     core.String `json:"pinnedPage"`
}

User is a... user.

type UserField

type UserField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

UserField is a custom field on user profiles.

type UserFromAdmin added in v1.0.1

type UserFromAdmin struct {
	User

	InjectFeaturedNote bool     `json:"injectFeaturedNote"`
	AlwaysMarkNSFW     bool     `json:"alwaysMarkNsfw"`
	CarefulBot         bool     `json:"carefulBot"`
	AutoAcceptFollowed bool     `json:"autoAcceptFollowed"`
	EmailVerified      bool     `json:"emailVerified"`
	Email              string   `json:"email"`
	Token              string   `json:"token"`
	SecurityKeysList   []string `json:"securityKeysList"`

	Emojis []string `json:"emojis"`
}

UserFromAdmin represents a user from admin/users/show. Usually user has an Emoji list of 'Emoji', but from /api/admin/show-user, it's a list of strings.

type UserOrigin added in v1.0.1

type UserOrigin string

UserOrigin of a user.

const (
	// OriginCombined for local and remote users.
	OriginCombined UserOrigin = "combined"
	// OriginLocal for only local users.
	OriginLocal UserOrigin = "local"
	// OriginRemote for only remote users.
	OriginRemote UserOrigin = "remote"
)

type Visibility

type Visibility string

Visibility is a simple string, but type alias for readability.

Jump to

Keyboard shortcuts

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