feed.gno
0.58 Kb · 24 lines
1package gnorkle
2
3import (
4 "gno.land/p/demo/gnorkle/feed"
5 "gno.land/p/demo/gnorkle/message"
6)
7
8// Feed is an abstraction used by a gnorkle `Instance` to ingest data from
9// agents and provide data feeds to consumers.
10type Feed interface {
11 ID() string
12 Type() feed.Type
13 Value() (value feed.Value, dataType string, consumable bool)
14 Ingest(funcType message.FuncType, rawMessage, providerAddress string) error
15 MarshalJSON() ([]byte, error)
16 Tasks() []feed.Task
17 IsActive() bool
18}
19
20// FeedWithWhitelist associates a `Whitelist` with a `Feed`.
21type FeedWithWhitelist struct {
22 Feed
23 Whitelist
24}