smms

package
v0.0.0-...-7604275 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provider = wire.NewSet(NewSmMs)

Functions

This section is empty.

Types

type Image

type Image struct {
	FileId    int    `json:"file_id"`
	Width     int    `json:"width"`
	Height    int    `json:"height"`
	Filename  string `json:"filename"`
	Storename string `json:"storename"`
	Size      int    `json:"size"`
	Path      string `json:"path"`
	Hash      string `json:"hash"`
	Url       string `json:"url"`
	Delete    string `json:"delete"`
	Page      string `json:"page"`
}

type SmMs

type SmMs struct {
	// contains filtered or unexported fields
}

func NewSmMs

func NewSmMs(smMsConf *config.Smms) *SmMs

func (*SmMs) GetToken

func (s *SmMs) GetToken() (string, error)

func (*SmMs) GetUserProfile

func (s *SmMs) GetUserProfile(token string) (UserProfile, error)

func (*SmMs) UploadImage

func (s *SmMs) UploadImage(filePath string) (Image, error)

type Token

type Token struct {
	Token string `json:"token"`
}

type TokenRsp

type TokenRsp struct {
	Success   bool   `json:"success"`
	Code      string `json:"code"`
	Message   string `json:"message"`
	Data      Token  `json:"data"`
	RequestId string `json:"RequestId"`
}

type UploadImageRsp

type UploadImageRsp struct {
	Success   bool   `json:"success"`
	Code      string `json:"code"`
	Message   string `json:"message"`
	Data      Image  `json:"data"`
	RequestId string `json:"RequestId"`
}

type UserProfile

type UserProfile struct {
	Username      string `json:"username"`
	Email         string `json:"email"`
	Role          string `json:"role"`
	GroupExpire   string `json:"group_expire"`
	EmailVerified int    `json:"email_verified"`
	DiskUsage     string `json:"disk_usage"`
	DiskLimit     string `json:"disk_limit"`
	DiskUsageRaw  int    `json:"disk_usage_raw"`
	DiskLimitRaw  int64  `json:"disk_limit_raw"`
}

type UserProfileRsp

type UserProfileRsp struct {
	Success   bool        `json:"success"`
	Code      string      `json:"code"`
	Message   string      `json:"message"`
	Data      UserProfile `json:"data"`
	RequestId string      `json:"RequestId"`
}

Jump to

Keyboard shortcuts

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