comicshelf

package module
v0.0.0-...-c693a81 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 2 Imported by: 0

README

Comicshelf

...

Todo

  • view this weeks releases (complete)
  • follow certain series (complete)
  • view when issues in series will be released (complete)
    • view all comics within a series (complete)
    • show marvel unlimited release date on comic card (complete)
  • series page doesn't show all items in series
    • add page size (complete)
    • support pagination on the pages
  • be able to see which series you follow
  • be notified when issues in a series are released
  • ignore results.json, better caching of results (complete)
  • cache limit and eviction
  • change weekly (complete)
  • better error handling
  • better logging
    • use slog everywhere (complete)
    • no more os.exit from non root paths (complete)
  • htmx to enable better html structure (in progress)
    • comic-card : follow / unfollow (complete)
    • navbar
    • don't use cdn
    • accessibility
  • middleware for enforcing date query parameter on marvel endpoints (complete)
  • in-mem db persists beyond restarts (complete)
  • real db? object storage sufficient? something on filesystem enough?
  • efficient network usage, lots of network requests happening with html setup as it is
  • makefile supports build for different platforms
  • deploy to aws
  • support more than just marvel unlimited
  • error page
  • reload static & template files

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comic

type Comic struct {
	Id              int       `json:"id"`
	Title           string    `json:"title"`
	Urls            []Url     `json:"urls"`
	Thumbnail       string    `json:"thumbnail"`
	Format          string    `json:"format"`
	IssuerNumber    int       `json:"issuer_number"`
	OnSaleDate      time.Time `json:"on_sale_date"`
	Attribution     string    `json:"attribution"`
	AttributionLink string    `json:"attribution_link"`
	SeriesId        int       `json:"series_id"`
}

type ComicService

type ComicService interface {
	GetWeeklyComics(ctx context.Context, t time.Time) (Page[Comic], error)
	GetComic(ctx context.Context, id int) (Comic, error)
}

type Page

type Page[T any] struct {
	Limit   int `json:"limit"`
	Total   int `json:"total"`
	Count   int `json:"count"`
	Offset  int `json:"offset"`
	Results []T `json:"results"`
}

type Series

type Series struct {
	Comics    []Comic `json:"comics"`
	Id        int     `json:"id"`
	Title     string  `json:"title"`
	Urls      []Url   `json:"urls"`
	Thumbnail string  `json:"thumbnail"`
}

type SeriesService

type SeriesService interface {
	GetComicsWithinSeries(ctx context.Context, id int) ([]Comic, error)
	GetSeries(ctx context.Context, id int) (Series, error)
}

type Set

type Set[T comparable] map[T]struct{}

func (Set[T]) Delete

func (s Set[T]) Delete(t T)

func (Set[T]) Has

func (s Set[T]) Has(t T) bool

func (Set[T]) Put

func (s Set[T]) Put(t T)

type Url

type Url struct {
	Type string `json:"type"`
	Url  string `json:"url"`
}

type User

type User struct {
	Id        int      `json:"id"`
	Following Set[int] `json:"following"`
}

type UserService

type UserService interface {
	Following(ctx context.Context, userId, seriesId int) (bool, error)
	Followed(ctx context.Context, userId int) (Set[int], error)
	Follow(ctx context.Context, userId, seriesId int) error
	Unfollow(ctx context.Context, userId, seriesId int) error
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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