shikimori

package module
v0.0.0-...-5b6b915 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShikiSchema = "https"
	ShikiDomain = "shikimori.one"
	UserAgent   = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0"
)
View Source
var (
	ErrNotFound            = errors.New("not found")
	ErrUnprocessableEntity = errors.New("unprocessable entity")
	ErrTooManyRequests     = errors.New("too many requests")
	ErrInternalServer      = errors.New("internal server error")
	ErrUnauthorized        = errors.New("unauthorized access")
	ErrBadRequest          = errors.New("bad request")
	ErrForbidden           = errors.New("forbidden")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Me         *types.Me
	Cookies    string
	XCsrfToken string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cookies string, xCsrfToken string) (*Client, error)

func (*Client) ClubInvite

func (c *Client) ClubInvite(userID, clubID uint) error

func (*Client) DeleteComment

func (c *Client) DeleteComment(commentID uint) error

func (*Client) DeleteMessage

func (c *Client) DeleteMessage(messageID uint64) error

func (*Client) EditComment

func (c *Client) EditComment(commentID uint, text string) error

func (*Client) EditMessage

func (c *Client) EditMessage(messageID uint64, newText string) (*types.Message, error)

func (*Client) FriendDeleteRequest

func (c *Client) FriendDeleteRequest(userID uint) error

func (*Client) FriendRequest

func (c *Client) FriendRequest(userID uint) error

func (*Client) GetAnime

func (c *Client) GetAnime(id uint) (*types.Anime, error)

func (*Client) GetCharacter

func (c *Client) GetCharacter(id uint) (*types.Character, error)

func (*Client) GetComment

func (c *Client) GetComment(commentID uint) (*types.Comment, error)

func (*Client) GetComments

func (c *Client) GetComments(commentableID uint, commentableType string, page, limit uint, desc bool) ([]types.Comment, error)

func (*Client) GetDialogs

func (c *Client) GetDialogs(page, limit uint) ([]types.Dialog, error)

func (*Client) GetFriends

func (c *Client) GetFriends(userID, page, limit uint) ([]types.User, error)

func (*Client) GetMe

func (c *Client) GetMe() (*types.Me, error)

func (*Client) GetMessages

func (c *Client) GetMessages(userID uint, page, limit uint) ([]types.Message, error)

func (*Client) GetTopic

func (c *Client) GetTopic(topicID uint) (*types.Topic, error)

func (*Client) GetUserProfile

func (c *Client) GetUserProfile(userID uint) (*types.UserProfile, error)

func (*Client) GetUserProfileByNickname

func (c *Client) GetUserProfileByNickname(nickname string) (*types.UserProfile, error)

func (*Client) GetUsers

func (c *Client) GetUsers(page, limit uint) ([]types.User, error)

func (*Client) IgnoreUserRequest

func (c *Client) IgnoreUserRequest(userID uint) error

func (*Client) MakeRequest

func (c *Client) MakeRequest(method string, path string, headers map[string]string, urlParams url.Values, data io.Reader) (*http.Response, error)

func (*Client) PreviewComment

func (c *Client) PreviewComment(text string) ([]byte, error)

func (*Client) SendComment

func (c *Client) SendComment(commentableID uint, commentableType string, text string, isOfftopic bool) (*types.Comment, error)

func (*Client) SendMessage

func (c *Client) SendMessage(userID uint, text string) (*types.Message, error)

func (*Client) SetTimeout

func (c *Client) SetTimeout(t time.Duration)

func (*Client) UnignoreUserRequest

func (c *Client) UnignoreUserRequest(userID uint) error

func (*Client) UploadImage

func (c *Client) UploadImage(imageName string, image io.Reader) (*types.UploadedImage, error)

type ShikiError

type ShikiError struct {
	Message string
	Errors  []string
}

func (ShikiError) Error

func (s ShikiError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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