Documentation ¶
Index ¶
- func RegisterFlags(f []cli.Flag) []cli.Flag
- type Api
- func (s *Api) AttachExternalFile(ei ra.ExportItem, u string) string
- func (s *Api) AttachExternalSubtitle(ei ra.ExportItem, u string) string
- func (s *Api) Download(ctx context.Context, u string) (io.ReadCloser, error)
- func (s *Api) DownloadWithRange(ctx context.Context, u string, start int, end int) (io.ReadCloser, error)
- func (s *Api) ExportResourceContent(ctx context.Context, c *Claims, infohash string, itemID string) (e *ra.ExportResponse, err error)
- func (s *Api) GetMediaProbe(ctx context.Context, u string) (*MediaProbe, error)
- func (s *Api) GetOpenSubtitles(ctx context.Context, u string) ([]OpenSubtitleTrack, error)
- func (s *Api) GetResource(ctx context.Context, c *Claims, infohash string) (e *ra.ResourceResponse, err error)
- func (s *Api) ListResourceContent(ctx context.Context, c *Claims, infohash string, args *ListResourceContentArgs) (e *ra.ListResponse, err error)
- func (s *Api) MakeClaimsFromContext(c *gin.Context) (*Claims, error)
- func (s *Api) RegisterHandler(c *cli.Context, r *gin.Engine) error
- func (s *Api) Stats(ctx context.Context, u string) (chan EventData, error)
- func (s *Api) StoreResource(ctx context.Context, c *Claims, resource []byte) (e *ra.ResourceResponse, err error)
- type ApiClaimsContext
- type Claims
- type EventData
- type ExtSubtitle
- type ListResourceContentArgs
- type ListResourceContentOutputType
- type MediaProbe
- type OpenSubtitleTrack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) AttachExternalFile ¶
func (s *Api) AttachExternalFile(ei ra.ExportItem, u string) string
func (*Api) AttachExternalSubtitle ¶
func (s *Api) AttachExternalSubtitle(ei ra.ExportItem, u string) string
func (*Api) DownloadWithRange ¶
func (*Api) ExportResourceContent ¶
func (*Api) GetMediaProbe ¶
func (*Api) GetOpenSubtitles ¶
func (*Api) GetResource ¶
func (*Api) ListResourceContent ¶
func (s *Api) ListResourceContent(ctx context.Context, c *Claims, infohash string, args *ListResourceContentArgs) (e *ra.ListResponse, err error)
func (*Api) MakeClaimsFromContext ¶
func (*Api) StoreResource ¶
type ApiClaimsContext ¶
type ApiClaimsContext struct{}
type Claims ¶
type Claims struct { jwt.StandardClaims Rate string `json:"rate,omitempty"` Role string `json:"role,omitempty"` SessionID string `json:"sessionID"` Domain string `json:"domain"` Agent string `json:"agent"` RemoteAddress string `json:"remoteAddress"` }
func GetClaimsFromContext ¶
type EventData ¶
type EventData struct { Total int64 `json:"total"` Completed int `json:"completed"` Peers int `json:"peers"` Status int `json:"status"` Pieces []struct { Position int `json:"position"` Complete bool `json:"complete"` Priority int `json:"priority"` } `json:"pieces"` Seeders int `json:"seeders"` Leechers int `json:"leechers"` }
type ExtSubtitle ¶
type ListResourceContentArgs ¶
type ListResourceContentArgs struct { Limit uint Offset uint Path string Output ListResourceContentOutputType }
func (*ListResourceContentArgs) ToQuery ¶
func (s *ListResourceContentArgs) ToQuery() url.Values
type ListResourceContentOutputType ¶
type ListResourceContentOutputType string
const ( OutputList ListResourceContentOutputType = "list" OutputTree ListResourceContentOutputType = "tree" )
type MediaProbe ¶
type MediaProbe struct { Format struct { FormatName string `json:"format_name"` BitRate string `json:"bit_rate"` Duration string `json:"duration"` Tags struct { CompatibleBrands string `json:"compatible_brands"` Copyright string `json:"copyright"` CreationTime time.Time `json:"creation_time"` Description string `json:"description"` Encoder string `json:"encoder"` MajorBrand string `json:"major_brand"` MinorVersion string `json:"minor_version"` Title string `json:"title"` } `json:"tags"` } `json:"format"` Streams []struct { CodecName string `json:"codec_name"` CodecType string `json:"codec_type"` Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` BitRate string `json:"bit_rate"` Duration string `json:"duration"` Tags struct { CreationTime time.Time `json:"creation_time"` HandlerName string `json:"handler_name"` Language string `json:"language"` VendorId string `json:"vendor_id"` Title string `json:"title"` } `json:"tags"` Index int `json:"index,omitempty"` Channels int `json:"channels,omitempty"` ChannelLayout string `json:"channel_layout,omitempty"` SampleRate string `json:"sample_rate,omitempty"` } `json:"streams"` }
type OpenSubtitleTrack ¶
type OpenSubtitleTrack struct { ID string *ra.ExportTrack }
Click to show internal directories.
Click to hide internal directories.