Documentation
¶
Index ¶
- func GenerateSessionID(c *gin.Context) string
- func GenerateSessionIDFromUser(u *auth.User) string
- 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, imdbID 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) GetResourceCached(ctx context.Context, c *Claims, infohash string) (e *ra.ResourceResponse, err error)
- func (s *Api) GetTorrent(ctx context.Context, c *Claims, infohash string) (closer io.ReadCloser, err error)
- func (s *Api) GetTorrentCached(ctx context.Context, c *Claims, infohash string) ([]byte, error)
- func (s *Api) ListResourceContent(ctx context.Context, c *Claims, infohash string, args *ListResourceContentArgs) (e *ra.ListResponse, err error)
- func (s *Api) ListResourceContentCached(ctx context.Context, c *Claims, infohash string, args *ListResourceContentArgs) (*ra.ListResponse, error)
- func (s *Api) MakeClaimsFromContext(c *gin.Context, domain string, uc *claims.Data, sessionID string) (*Claims, error)
- func (s *Api) RegisterHandler(r *gin.Engine)
- func (s *Api) SetClaims(c *gin.Context, domain string, uc *claims.Data, sessionID string) (*gin.Context, 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 Claims
- type ClaimsContext
- type EventData
- type ExtSubtitle
- type ListResourceContentArgs
- type ListResourceContentOutputType
- type MediaProbe
- type OpenSubtitleTrack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSessionID ¶
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) GetResourceCached ¶
func (*Api) GetTorrent ¶
func (*Api) GetTorrentCached ¶
func (*Api) ListResourceContent ¶
func (s *Api) ListResourceContent(ctx context.Context, c *Claims, infohash string, args *ListResourceContentArgs) (e *ra.ListResponse, err error)
func (*Api) ListResourceContentCached ¶
func (s *Api) ListResourceContentCached(ctx context.Context, c *Claims, infohash string, args *ListResourceContentArgs) (*ra.ListResponse, error)
func (*Api) MakeClaimsFromContext ¶
func (*Api) RegisterHandler ¶
func (*Api) StoreResource ¶
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 ClaimsContext ¶
type ClaimsContext struct{}
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.