Skip to content

Commit bbfb66f

Browse files
authored
feat: change source to protocol and change rsshub network (#61)
1 parent 501b6b1 commit bbfb66f

File tree

2 files changed

+42
-41
lines changed

2 files changed

+42
-41
lines changed

schema/network/network.go

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727
Near // near
2828
Optimism // optimism
2929
Polygon // polygon
30-
RSS // rss
30+
RSSHub // rsshub
3131
SatoshiVM // savm
3232
VSL // vsl
3333
XLayer // x-layer
@@ -46,43 +46,44 @@ func (n *Network) UnmarshalParam(param string) error {
4646
return nil
4747
}
4848

49-
type Source string
49+
type Protocol string
5050

51+
// Open Data Protocols
5152
const (
52-
ActivityPubSource Source = "activity-pub"
53-
ArweaveSource Source = "arweave"
54-
EthereumSource Source = "ethereum"
55-
FarcasterSource Source = "farcaster"
56-
NearSource Source = "near"
57-
RSSSource Source = "rss"
53+
ActivityPubProtocol Protocol = "activity-pub"
54+
ArweaveProtocol Protocol = "arweave"
55+
EthereumProtocol Protocol = "ethereum"
56+
FarcasterProtocol Protocol = "farcaster"
57+
NearProtocol Protocol = "near"
58+
RSSProtocol Protocol = "rss"
5859
)
5960

60-
func (n Network) Source() Source {
61+
func (n Network) Protocol() Protocol {
6162
switch n {
6263
case Arweave:
63-
return ArweaveSource
64+
return ActivityPubProtocol
6465
case Ethereum, Polygon, Optimism, Arbitrum, Base, Crossbell, Avalanche, VSL, SatoshiVM, BinanceSmartChain, Gnosis, Linea, XLayer:
65-
return EthereumSource
66+
return EthereumProtocol
6667
case Farcaster:
67-
return FarcasterSource
68+
return FarcasterProtocol
6869
case Mastodon:
69-
return ActivityPubSource
70+
return ActivityPubProtocol
7071
case Near:
71-
return NearSource
72-
case RSS:
73-
return RSSSource
72+
return NearProtocol
73+
case RSSHub:
74+
return RSSProtocol
7475
default:
7576
return ""
7677
}
7778
}
7879

79-
func (s Source) Networks() []Network {
80+
func (s Protocol) Networks() []Network {
8081
switch s {
81-
case ActivityPubSource:
82+
case ActivityPubProtocol:
8283
return []Network{Mastodon}
83-
case ArweaveSource:
84+
case ArweaveProtocol:
8485
return []Network{Arweave}
85-
case EthereumSource:
86+
case EthereumProtocol:
8687
return []Network{
8788
Ethereum,
8889
Polygon,
@@ -98,12 +99,12 @@ func (s Source) Networks() []Network {
9899
Linea,
99100
XLayer,
100101
}
101-
case FarcasterSource:
102+
case FarcasterProtocol:
102103
return []Network{Farcaster}
103-
case NearSource:
104+
case NearProtocol:
104105
return []Network{Near}
105-
case RSSSource:
106-
return []Network{RSS}
106+
case RSSProtocol:
107+
return []Network{RSSHub}
107108
default:
108109
return []Network{}
109110
}

schema/network/network_string.go

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)