Skip to content

Commit

Permalink
chore: implement Networks method (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu authored Oct 10, 2024
1 parent 595c4bb commit 5880dc4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions schema/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,39 @@ func (n Network) Source() Source {
}
}

func (s Source) Networks() []Network {
switch s {
case ActivityPubSource:
return []Network{Mastodon}
case ArweaveSource:
return []Network{Arweave}
case EthereumSource:
return []Network{
Ethereum,
Polygon,
Optimism,
Arbitrum,
Base,
Crossbell,
Avalanche,
VSL,
SatoshiVM,
BinanceSmartChain,
Gnosis,
Linea,
XLayer,
}
case FarcasterSource:
return []Network{Farcaster}
case NearSource:
return []Network{Near}
case RSSSource:
return []Network{RSS}
default:
return []Network{}
}
}

func HookFunc() mapstructure.DecodeHookFuncType {
return func(
f reflect.Type, // data type
Expand Down

0 comments on commit 5880dc4

Please sign in to comment.