-
Notifications
You must be signed in to change notification settings - Fork 1
/
anilistarr.puml
137 lines (115 loc) · 2.45 KB
/
anilistarr.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
@startuml components
package entities {
struct Media {
SourceID string
TargetID string
}
struct CustomEntry {
TvdbID uint64
}
struct CustomList <<alias>> {
[]CustomEntry
}
}
package usecases {
interface "Mapper" as IMapper {
+MapIDs([]string) []string
+MapID(string) string
+Refresh()
}
interface Tracker {
+GetUserID(name string) string
+GetMediaList(userId string) []Media
}
class MediaLister {
+Generate(name string) CustomList
+GetUserID(name string) string
}
}
package adapters {
package mapper <<Frame>> {
interface Provider {
Fetch()
}
interface Metadata {
GetSourceID() string
GetTargetID() string
}
interface Store {
GetMedia(Context, string) (Media, error)
GetMediaBulk(Context, []string) ([]Media, error)
PutMedia(Context, media Media) error
PutMediaBulk(Context, medias []Media) error
}
class JSONLocalProvider
class JSONProvider
class Mapper
}
package cache <<Frame>> {
interface Cache {
GetString(ctx, key) string
SetString(ctx, key, value)
}
class CachedTracker
}
}
package drivers {
package providers <<Frame>> {
struct AnilistFribbsMetadata
entity AnilistFribbsProvider
}
package stores <<Frame>> {
class Sql
}
package caches <<Frame>> {
class Redis
class Bolt
}
package trackers <<Frame>> {
class Anilist
}
}
package cmd {
package api {
class RestAPI <<net.http>>
entity "main" as apiMain
RestAPI o-- apiMain
}
package cli {
entity "main" as cliMain
}
}
'' visual hack to force both outer-level packages on the same rank
drivers -[hidden] cmd
'' entities
CustomEntry --* CustomList
'' use-cases
Media <-- MediaLister
CustomList <-- MediaLister
MediaLister o--> IMapper
MediaLister o--> Tracker
'' adapters/mapper
IMapper <|-[dashed]- Mapper
Provider -> Metadata
Mapper o--> Provider
Mapper o--> Store
Provider <|-[dashed]- JSONLocalProvider
Provider <|-[dashed]- JSONProvider
'' adapters/cache
Tracker <|-[dashed]- CachedTracker
CachedTracker o--> Cache
CachedTracker o--> Tracker
'' drivers/providers
AnilistFribbsMetadata -* AnilistFribbsProvider
JSONProvider <|-- AnilistFribbsProvider
Metadata <|-[dashed]- AnilistFribbsMetadata
'' drivers/stores
Store <|-[dashed]- Sql
'' drivers/caches
Cache <|-[dashed]- Bolt
Cache <|-[dashed]- Redis
'' drivers/trackers
Tracker <|-[dashed]- Anilist
'' cmd
MediaLister <--o RestAPI
@enduml