api

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Ctx                           context.Context
	AccessKey                     string
	Cache                         api.Cacher
	Config                        *configs.Config
	BangumiCache                  api.CacheGetter
	BangumiCacheLock              *sync.Mutex
	FilterManager                 api.FilterManager
	DownloaderManagerCacheDeleter api.DownloaderManagerCacheDeleter
)

Functions

func Bolt added in v0.5.3

func Bolt(c *gin.Context)

Bolt godoc

@Summary 获取Bolt数据库的值
@Description 获取Bolt数据库指定Bucket和key所储存的值
@Tags bolt
@Accept  json
@Produce  json
@Param type query webModels.BoltGetRequest true "获取bolt数据库值"
@Success 200 {object} webModels.Response{data=webModels.BoltGetResponse}
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/bolt/value [get]

func BoltDelete added in v0.6.1

func BoltDelete(c *gin.Context)

BoltDelete godoc

@Summary 删除Bolt数据库的值
@Description 删除Bolt数据库指定Bucket和key所储存的值
@Tags bolt
@Accept  json
@Produce  json
@Param type query webModels.BoltDeleteRequest true "删除bolt数据库值"
@Success 200 {object} webModels.Response{data=webModels.BoltGetResponse}
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/bolt/value [delete]

func BoltList added in v0.5.3

func BoltList(c *gin.Context)

BoltList godoc

@Summary 获取Bolt数据库的Bucket列表或key列表
@Description 获取Bolt数据库的Bucket列表,或指定Bucket下的key列表
@Tags bolt
@Accept  json
@Produce  json
@Param type query webModels.BoltListRequest true "获取bolt数据库列表"
@Success 200 {object} webModels.Response{data=webModels.BoltListResponse}
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/bolt [get]

func ConfigGet added in v0.6.2

func ConfigGet(c *gin.Context)

ConfigGet godoc

@Summary 获取设置
@Description 获取AnimeGo的配置文件内容
@Tags config
@Accept  json
@Produce  json
@Param type query webModels.ConfigGetRequest true "获取配置文件"
@Success 200 {object} webModels.Response
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/config [get]

func ConfigPut added in v0.6.2

func ConfigPut(c *gin.Context)

ConfigPut godoc

@Summary 更新设置
@Description 更新AnimeGo的配置文件内容
@Tags config
@Accept  json
@Produce  json
@Param type body webModels.ConfigPutRequest true "更新配置文件"
@Success 200 {object} webModels.Response
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/config [put]

func Init added in v0.6.5

func Init(opts *Options)

func Ping

func Ping(c *gin.Context)

Ping godoc

@Summary Ping
@Description Pong
@Tags web
@Accept  json
@Produce  json
@Success 200 {object} webModels.Response
@Router /ping [get]

func PluginConfigGet

func PluginConfigGet(c *gin.Context)

PluginConfigGet godoc

@Summary 获取插件配置
@Description 从AnimeGo中获取当前插件的配置
@Description 插件名为不包含 'plugin' 的路径
@Description 插件名可以忽略'.js'后缀;插件名也可以使用上层文件夹名,会自动寻找文件夹内部的 'main.js' 或 'plugin.js'
@Description 如传入 'test',会依次尝试寻找 'plugin/test/main.js', 'plugin/test/plugin.js', 'plugin/test.js'
@Tags plugin
@Accept  json
@Produce  json
@Param name query string true "插件信息"
@Success 200 {object} webModels.Response
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/plugin/config [get]

func PluginConfigPost

func PluginConfigPost(c *gin.Context)

PluginConfigPost godoc

@Summary 发送插件配置
@Description 将当前插件的配置发送给AnimeGo并保存
@Description 插件名为不包含 'plugin' 的路径
@Description 插件名可以忽略'.py'后缀;插件名也可以使用上层文件夹名,会自动加载文件夹内部的 'main.py'
@Description 如设置为 'plugin/test',会依次尝试加载 'plugin/test/main.py', 'plugin/test.py'
@Tags plugin
@Accept  json
@Produce  json
@Param plugin body webModels.PluginConfigUploadRequest true "插件信息,data为base64编码后的json文本"
@Success 200 {object} webModels.Response
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/plugin/config [post]

func Rss

func Rss(c *gin.Context)

Rss godoc

@Summary 发送下载项
@Description 将待下载项组合成rss发送给AnimeGo
@Tags plugin
@Accept  json
@Produce  json
@Param rss body webModels.SelectEpRequest true "组合的rss信息"
@Success 200 {object} webModels.Response
@Failure 300 {object} webModels.Response
@Security ApiKeyAuth
@Router /api/rss [post]

func SHA256

func SHA256(c *gin.Context)

SHA256 godoc

@Summary SHA256计算
@Description SHA256计算
@Tags web
@Accept  json
@Produce  json
@Param access_key query string true "原文本"
@Success 200 {object} webModels.Response{data=string}
@Router /sha256 [get]

Types

type Options added in v0.6.5

type Options struct {
	Ctx                           context.Context
	AccessKey                     string
	Cache                         api.Cacher
	Config                        *configs.Config
	BangumiCache                  api.CacheGetter
	BangumiCacheLock              *sync.Mutex
	FilterManager                 api.FilterManager
	DownloaderManagerCacheDeleter api.DownloaderManagerCacheDeleter
}

Jump to

Keyboard shortcuts

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