miutil

package module
v0.0.0-...-34595ad Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 8 Imported by: 3

README

miutil

Go Reference

Misskey のユーティリティです。

Library

go get -u github.com/yulog/miutil@latest

CLI

Example
Usage

License

MIT

Author

yulog

Documentation

Overview

Emojis は /emoji から https://mholt.github.io/json-to-go/ で生成後、修正

Reactions は /users/reactions から https://mholt.github.io/json-to-go/ で生成後、修正

Index

Constants

View Source
const TIME2000 = 946684800000

Variables

This section is empty.

Functions

func FormatTime

func FormatTime(t time.Time, err error) string

func GetTime

func GetTime(t time.Time, err error) time.Time

func ParseAidx

func ParseAidx(id string) (time.Time, error)

ParseAidx はaid/aidxを日時に変換する

func Post

func Post(url string, b []byte) ([]byte, error)

Post は指定のurlにJSONをPOSTする

func Post2

func Post2[T any](url string, b io.Reader) (*T, error)

Post は指定のurlにJSONをPOSTし、ResponseのJSONを受け取る

func Post3

func Post3(url string, b io.Reader, out any) error

Post は指定のurlにJSONをPOSTし、ResponseのJSONを受け取る

Types

type AvatarDecorations

type AvatarDecorations struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

type Client

type Client struct {
	Host       string
	Credential string
}

func NewClient

func NewClient(host, credential string) *Client

func (*Client) NewPostRequest

func (c *Client) NewPostRequest(u string, body map[string]any) (*Request, error)

type Emoji

type Emoji struct {
	ID                                         string   `json:"id"`
	Aliases                                    []string `json:"aliases"`
	Name                                       string   `json:"name"`
	Category                                   string   `json:"category"`
	Host                                       any      `json:"host"`
	URL                                        string   `json:"url"`
	License                                    string   `json:"license"`
	IsSensitive                                bool     `json:"isSensitive"`
	LocalOnly                                  bool     `json:"localOnly"`
	RoleIdsThatCanBeUsedThisEmojiAsReaction    []any    `json:"roleIdsThatCanBeUsedThisEmojiAsReaction"`
	RoleIdsThatCanNotBeUsedThisEmojiAsReaction []any    `json:"roleIdsThatCanNotBeUsedThisEmojiAsReaction"`
}

type Emojis

type Emojis struct {
	Emojis []Emoji `json:"emojis"`
}

type File

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

type Folder

type Folder struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	Name      string    `json:"name"`
	ParentID  any       `json:"parentId"`
}

type Instance

type Instance struct {
	Name            string `json:"name"`
	SoftwareName    string `json:"softwareName"`
	SoftwareVersion string `json:"softwareVersion"`
	IconURL         string `json:"iconUrl"`
	FaviconURL      string `json:"faviconUrl"`
	ThemeColor      string `json:"themeColor"`
}

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                 any       `json:"cw"`
	Visibility         string    `json:"visibility"`
	LocalOnly          bool      `json:"localOnly"`
	ReactionAcceptance string    `json:"reactionAcceptance"`
	RenoteCount        int       `json:"renoteCount"`
	RepliesCount       int       `json:"repliesCount"`
	Reactions          any       `json:"reactions"`
	ReactionEmojis     any       `json:"reactionEmojis"`
	Emojis             any       `json:"emojis"`
	FileIds            []any     `json:"fileIds"`
	Files              []File    `json:"files"`
	Tags               []string  `json:"tags"`
	ReplyID            any       `json:"replyId"`
	Mentions           []string  `json:"mentions,omitempty"`
	URI                string    `json:"uri"`
	URL                string    `json:"url"`
	RenoteID           any       `json:"renoteId"`
	ClippedCount       int       `json:"clippedCount"`
	Reply              Reply     `json:"reply,omitempty"`
	MyReaction         string    `json:"myReaction"`
}

type Properties

type Properties struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

type Reaction

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

type Reactions

type Reactions []Reaction

type Reply

type Reply struct {
	ID                 string    `json:"id"`
	CreatedAt          time.Time `json:"createdAt"`
	UserID             string    `json:"userId"`
	User               User      `json:"user"`
	Text               string    `json:"text"`
	Cw                 any       `json:"cw"`
	Visibility         string    `json:"visibility"`
	LocalOnly          bool      `json:"localOnly"`
	ReactionAcceptance any       `json:"reactionAcceptance"`
	RenoteCount        int       `json:"renoteCount"`
	RepliesCount       int       `json:"repliesCount"`
	Reactions          any       `json:"reactions"`
	ReactionEmojis     any       `json:"reactionEmojis"`
	FileIds            []any     `json:"fileIds"`
	Files              []any     `json:"files"`
	ReplyID            string    `json:"replyId"`
	RenoteID           any       `json:"renoteId"`
	Mentions           []string  `json:"mentions"`
}

type Request

type Request struct {
	URL  string
	Body io.Reader
}

func (*Request) Do

func (r *Request) Do(out any) error

type User

type User struct {
	ID                string              `json:"id"`
	Name              any                 `json:"name"`
	Username          string              `json:"username"`
	Host              any                 `json:"host"`
	AvatarURL         string              `json:"avatarUrl"`
	AvatarBlurhash    any                 `json:"avatarBlurhash"`
	AvatarDecorations []AvatarDecorations `json:"avatarDecorations"`
	IsBot             bool                `json:"isBot"`
	IsCat             bool                `json:"isCat"`
	Instance          Instance            `json:"instance,omitempty"`
	Emojis            any                 `json:"emojis"`
	OnlineStatus      string              `json:"onlineStatus"`
	BadgeRoles        []any               `json:"badgeRoles"`
}

Directories

Path Synopsis
example
fuse command
serveFS command
MiAuth のドキュメントは[Misskey Hub]と[Misskey Forum]を参照。
MiAuth のドキュメントは[Misskey Hub]と[Misskey Forum]を参照。

Jump to

Keyboard shortcuts

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