mylar

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 7 Imported by: 0

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)
}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int    `json:"-"`
	Status     string `json:"-"`
	Body       string `json:"-"`
}

APIError is returned when the API responds with a non-2xx status.

func (*APIError) Error

func (e *APIError) Error() string

type Client

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

Client is a Mylar3 API client.

func New

func New(baseURL, apiKey string, opts ...Option) *Client

New creates a Mylar3 Client for the instance at baseURL with the given API key.

func (*Client) AddComic

func (c *Client) AddComic(ctx context.Context, id string) error

AddComic adds a comic series by ID.

func (*Client) DeleteComic

func (c *Client) DeleteComic(ctx context.Context, id string) error

DeleteComic removes a comic series by ID.

func (*Client) FindComic

func (c *Client) FindComic(ctx context.Context, name string) ([]SearchResult, error)

FindComic searches for a comic by name.

func (*Client) ForceSearch

func (c *Client) ForceSearch(ctx context.Context, id string) error

ForceSearch forces an issue search for a comic series.

func (*Client) GetComic

func (c *Client) GetComic(ctx context.Context, id string) (*Comic, error)

GetComic returns a single comic series by ID.

func (*Client) GetHistory

func (c *Client) GetHistory(ctx context.Context) ([]HistoryEntry, error)

GetHistory returns the download history.

func (*Client) GetIndex

func (c *Client) GetIndex(ctx context.Context) ([]Comic, error)

GetIndex returns all comic series.

func (*Client) GetLogs

func (c *Client) GetLogs(ctx context.Context) ([]LogEntry, error)

GetLogs returns recent log entries.

func (*Client) GetReadList

func (c *Client) GetReadList(ctx context.Context) ([]ReadList, error)

GetReadList returns all read lists.

func (*Client) GetStoryArc

func (c *Client) GetStoryArc(ctx context.Context, id string) (*StoryArc, error)

GetStoryArc returns a story arc by ID.

func (*Client) GetUpcoming

func (c *Client) GetUpcoming(ctx context.Context) ([]Upcoming, error)

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

func (c *Client) PauseComic(ctx context.Context, id string) error

PauseComic pauses monitoring of a comic series.

func (*Client) RefreshComic

func (c *Client) RefreshComic(ctx context.Context, id string) error

RefreshComic refreshes metadata for a comic series.

func (*Client) ResumeComic

func (c *Client) ResumeComic(ctx context.Context, id string) error

ResumeComic resumes monitoring of 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

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets a custom http.Client.

func WithTimeout

func WithTimeout(d time.Duration) Option

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.

type WantedIssue

type WantedIssue 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"`
}

WantedIssue represents a wanted comic issue.

Jump to

Keyboard shortcuts

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