Documentation
¶
Overview ¶
Package mylar provides a client for the Mylar3 API.
Mylar3 is an automated comic book downloader and manager. Authentication uses an API key passed as a query parameter.
Usage:
c := mylar.New("http://localhost:8090", "your-api-key")
comics, err := c.GetIndex(context.Background())
Example ¶
package main
import (
"context"
"fmt"
"log"
"github.com/lusoris/goenvoy/arr/mylar"
)
func main() {
client := mylar.New("http://localhost:8090", "your-api-key")
ctx := context.Background()
// Get all comic series
comics, err := client.GetIndex(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Comics: %d\n", len(comics))
// Get version info
ver, err := client.GetVersion(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Version: %s\n", ver.Version)
}
Output:
Index ¶
- type APIError
- type Client
- func (c *Client) AddComic(ctx context.Context, id string) error
- func (c *Client) DeleteComic(ctx context.Context, id string) error
- func (c *Client) FindComic(ctx context.Context, name string) ([]SearchResult, error)
- func (c *Client) ForceSearch(ctx context.Context, id string) error
- func (c *Client) GetComic(ctx context.Context, id string) (*Comic, error)
- func (c *Client) GetHistory(ctx context.Context) ([]HistoryEntry, error)
- func (c *Client) GetIndex(ctx context.Context) ([]Comic, error)
- func (c *Client) GetLogs(ctx context.Context) ([]LogEntry, error)
- func (c *Client) GetReadList(ctx context.Context) ([]ReadList, error)
- func (c *Client) GetStoryArc(ctx context.Context, id string) (*StoryArc, error)
- func (c *Client) GetUpcoming(ctx context.Context) ([]Upcoming, error)
- func (c *Client) GetVersion(ctx context.Context) (*VersionInfo, error)
- func (c *Client) GetWanted(ctx context.Context) ([]WantedIssue, error)
- func (c *Client) PauseComic(ctx context.Context, id string) error
- func (c *Client) RefreshComic(ctx context.Context, id string) error
- func (c *Client) ResumeComic(ctx context.Context, id string) error
- type Comic
- type HistoryEntry
- type Issue
- type LogEntry
- type Option
- type Provider
- type ReadList
- type SearchResult
- type StoryArc
- type Upcoming
- type VersionInfo
- type WantedIssue
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Mylar3 API client.
func (*Client) DeleteComic ¶
DeleteComic removes a comic series by ID.
func (*Client) ForceSearch ¶
ForceSearch forces an issue search for a comic series.
func (*Client) GetHistory ¶
func (c *Client) GetHistory(ctx context.Context) ([]HistoryEntry, error)
GetHistory returns the download history.
func (*Client) GetReadList ¶
GetReadList returns all read lists.
func (*Client) GetStoryArc ¶
GetStoryArc returns a story arc by ID.
func (*Client) GetUpcoming ¶
GetUpcoming returns upcoming comic issues.
func (*Client) GetVersion ¶
func (c *Client) GetVersion(ctx context.Context) (*VersionInfo, error)
GetVersion returns Mylar3 version information.
func (*Client) GetWanted ¶
func (c *Client) GetWanted(ctx context.Context) ([]WantedIssue, error)
GetWanted returns all wanted issues.
func (*Client) PauseComic ¶
PauseComic pauses monitoring of a comic series.
func (*Client) RefreshComic ¶
RefreshComic refreshes metadata for a comic series.
type Comic ¶
type Comic struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Year string `json:"year"`
Publisher string `json:"publisher"`
LatestIssue string `json:"latestIssue"`
TotalIssues int `json:"totalIssues"`
ComicImage string `json:"comicImage"`
}
Comic represents a comic series in Mylar3.
type HistoryEntry ¶
type HistoryEntry struct {
Id string `json:"id"`
ComicName string `json:"comicName"`
IssueNumber string `json:"issueNumber"`
Date string `json:"date"`
Status string `json:"status"`
Provider string `json:"provider"`
}
HistoryEntry represents an entry in the download history.
type Issue ¶
type Issue struct {
Id string `json:"id"`
IssueName string `json:"issueName"`
IssueNumber string `json:"issueNumber"`
Status string `json:"status"`
ComicId string `json:"comicId"`
ReleaseDate string `json:"releaseDate"`
}
Issue represents a single comic issue.
type LogEntry ¶
type LogEntry struct {
Message string `json:"message"`
Level string `json:"level"`
Timestamp string `json:"timestamp"`
}
LogEntry represents a single log line.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithHTTPClient ¶
WithHTTPClient sets a custom http.Client.
func WithTimeout ¶
WithTimeout overrides the default HTTP request timeout.
type Provider ¶
type Provider struct {
Id string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Enabled bool `json:"enabled"`
}
Provider represents a search provider.
type ReadList ¶
type ReadList struct {
Id string `json:"id"`
Name string `json:"name"`
Issues []Issue `json:"issues"`
}
ReadList represents a reading list.
type SearchResult ¶
type SearchResult struct {
Id string `json:"id"`
Name string `json:"name"`
Year string `json:"year"`
Publisher string `json:"publisher"`
Issues int `json:"issues"`
Image string `json:"image"`
}
SearchResult represents a comic found via search.
type StoryArc ¶
type StoryArc struct {
Id string `json:"id"`
Name string `json:"name"`
Publisher string `json:"publisher"`
Issues []Issue `json:"issues"`
}
StoryArc represents a story arc containing issues.
type Upcoming ¶
type Upcoming struct {
Id string `json:"id"`
IssueName string `json:"issueName"`
IssueNumber string `json:"issueNumber"`
Status string `json:"status"`
ComicId string `json:"comicId"`
ReleaseDate string `json:"releaseDate"`
ComicName string `json:"comicName"`
}
Upcoming represents an upcoming comic issue.
type VersionInfo ¶
type VersionInfo struct {
Version string `json:"version"`
LatestVersion string `json:"latestVersion"`
Commits string `json:"commits"`
}
VersionInfo contains Mylar3 version information.