misskey

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrAcctIsInvalid = errors.New("acct format is invalid")
	ErrRateLimit     = errors.New("rate limit")
)
View Source
var (
	ErrUnauthorized = errors.New("invalid token")
)
View Source
var SupportedMimeTypes = []string{
	"image/png",
	"image/gif",
	"image/jpeg",
	"image/webp",
	"image/avif",
	"image/apng",
	"image/bmp",
	"image/tiff",
	"image/x-icon",
	"audio/opus",
	"video/ogg",
	"audio/ogg",
	"application/ogg",
	"video/quicktime",
	"video/mp4",
	"audio/mp4",
	"video/x-m4v",
	"audio/x-m4a",
	"video/3gpp",
	"video/3gpp2",
	"video/mpeg",
	"audio/mpeg",
	"video/webm",
	"audio/webm",
	"audio/aac",
	"audio/x-flac",
	"audio/vnd.wave",
}

SupportedMimeTypes is a list of supported mime types

https://github.com/misskey-dev/misskey/blob/79212bbd375705f0fd658dd5b50b47f77d622fb8/packages/backend/src/const.ts#L25

Functions

func AccountFavourites

func AccountFavourites(ctx Context,
	limit int, sinceID, minID, maxID string,
) ([]models.Status, error)

func AccountFollow

func AccountFollow(ctx Context, userID string) error

func AccountFollowRequests

func AccountFollowRequests(ctx Context,
	limit int, sinceID, maxID string) ([]models.Account, error)

func AccountFollowRequestsAccept

func AccountFollowRequestsAccept(ctx Context, userID string) error

func AccountFollowRequestsCancel

func AccountFollowRequestsCancel(ctx Context, userID string) error

func AccountFollowRequestsReject

func AccountFollowRequestsReject(ctx Context, userID string) error

func AccountFollowers

func AccountFollowers(ctx Context, userID string,
	limit int, sinceID, minID, maxID string) ([]models.Account, error)

func AccountFollowing

func AccountFollowing(ctx Context,
	userID string,
	limit int, sinceID, minID, maxID string) ([]models.Account, error)

func AccountMute

func AccountMute(ctx Context, userID string, duration int64) error

func AccountRelationships

func AccountRelationships(ctx Context,
	userIDs []string) ([]models.Relationship, error)

func AccountUnfollow

func AccountUnfollow(ctx Context, userID string) error

func AccountUnmute

func AccountUnmute(ctx Context, userID string) error

func AccountsGet

func AccountsGet(ctx Context, userID string) (models.Account, error)

func AccountsLookup

func AccountsLookup(ctx Context, acct string) (models.Account, error)

func AccountsStatuses

func AccountsStatuses(
	ctx Context, uid string, limit int,
	pinnedOnly, onlyMedia, onlyPublic, excludeReplies, excludeReblogs bool,
	maxID, minID string) ([]models.Status, error)

func ApplicationCreate

func ApplicationCreate(server, clientName, redirectUris, scopes, website string) (models.Application, error)

func Instance

func Instance(server, version string) (models.Instance, error)

func InstanceCustomEmojis

func InstanceCustomEmojis(server string) ([]models.CustomEmoji, error)

func InstancePeers

func InstancePeers(server string) ([]string, error)

func MediaUpload

func MediaUpload(ctx Context, file *multipart.FileHeader, description string) (models.MediaAttachment, error)

func NodeInfo

func NodeInfo(server string, ni models.NodeInfo) (models.NodeInfo, error)

func OAuthAuthorize

func OAuthAuthorize(server, secret string) (string, error)

func OAuthToken

func OAuthToken(server, token, secret string) (string, string, error)

func PostNewStatus

func PostNewStatus(ctx Context,
	status *string, Poll any, MediaIDs []string, InReplyToID string,
	Sensitive bool, SpoilerText string,
	Visibility models.StatusVisibility, Language string,
	ScheduledAt time.Time,
) (any, error)

PostNewStatus 发送新的 Status FIXME: Poll 未实现

func SearchStatusByHashtag

func SearchStatusByHashtag(ctx Context,
	hashtag string,
	limit int, maxId, sinceId, minId string) ([]models.Status, error)

func SetHeader

func SetHeader(header, value string)

func StatusBookmark

func StatusBookmark(ctx Context, id string) (models.Status, error)

func StatusBookmarks

func StatusBookmarks(ctx Context,
	limit int, sinceID, minID, maxID string) ([]models.Status, error)

StatusBookmarks NOTE: 为了减少请求数量, 不支持 Bookmarked

func StatusFavourite

func StatusFavourite(ctx Context, id string) (models.Status, error)

func StatusSingle

func StatusSingle(ctx Context, statusID string) (models.Status, error)

func StatusUnBookmark

func StatusUnBookmark(ctx Context, id string) (models.Status, error)

func StatusUnFavourite

func StatusUnFavourite(ctx Context, id string) (models.Status, error)

func TimelineHome

func TimelineHome(ctx Context,
	limit int, maxId, minId string) ([]models.Status, error)

func TimelinePublic

func TimelinePublic(ctx Context,
	timelineType models.TimelinePublicType, onlyMedia bool,
	limit int, maxId, minId string) ([]models.Status, error)

func TrendsStatus

func TrendsStatus(ctx Context, limit, offset int) ([]models.Status, error)

func TrendsTags

func TrendsTags(ctx Context, limit, offset int) ([]models.Tag, error)

func UpdateCredentials

func UpdateCredentials(ctx Context,
	displayName, note *string,
	locked, bot, discoverable *bool,
	sourcePrivacy *string, sourceSensitive *bool, sourceLanguage *string,
	fields []models.AccountField,
	avatar, header *multipart.FileHeader,
) (models.CredentialAccount, error)

UpdateCredentials updates the credentials of the user.

func VerifyCredentials

func VerifyCredentials(ctx Context) (models.CredentialAccount, error)

func WebFinger

func WebFinger(server, resource string, writer http.ResponseWriter) error

Types

type Context

type Context interface {
	ProxyServer() string
	Token() *string
	UserID() *string
	HOST() *string
}

type ServerError

type ServerError struct {
	Code    int
	Message string
}

func (ServerError) Error

func (e ServerError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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