Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

static source pure

Functions 2

func NewFeed

1func NewFeed(
2	id string,
3	valueDataType string,
4	ingester gnorkle.Ingester,
5	storage gnorkle.Storage,
6	tasks ...feed.Task,
7) *Feed
source

NewFeed creates a new static feed.

func NewSingleValueFeed

1func NewSingleValueFeed(
2	id string,
3	valueDataType string,
4	tasks ...feed.Task,
5) *Feed
source

NewSingleValueFeed is a convenience function for creating a static feed that autocommits a value after a single ingestion.

Types 1

type Feed

struct
1type Feed struct {
2	id            string
3	isLocked      bool
4	valueDataType string
5	ingester      gnorkle.Ingester
6	storage       gnorkle.Storage
7	tasks         []feed.Task
8}
source

Feed is a static feed.

Methods on Feed

func ID

method on Feed
1func (f Feed) ID() string
source

ID returns the feed's ID.

func Ingest

method on Feed
1func (f *Feed) Ingest(funcType message.FuncType, msg, providerAddress string) error
source

Ingest ingests a message into the feed. It either adds the value to the ingester's pending values or commits the value to the storage.

func IsActive

method on Feed
1func (f Feed) IsActive() bool
source

IsActive returns true if the feed is accepting ingestion requests from agents.

func MarshalJSON

method on Feed
1func (f Feed) MarshalJSON() ([]byte, error)
source

MarshalJSON marshals the components of the feed that are needed for an agent to execute tasks and send values for ingestion.

func Tasks

method on Feed
1func (f Feed) Tasks() []feed.Task
source

Tasks returns the feed's tasks. This allows task consumers to extract task contents without having to marshal the entire feed.

func Type

method on Feed
1func (f Feed) Type() feed.Type
source

Type returns the feed's type.

func Value

method on Feed
1func (f Feed) Value() (feed.Value, string, bool)
source

Value returns the feed's latest value, it's data type, and whether or not it can be safely consumed. In this case it uses `f.isLocked` because, this being a static feed, it will only ever have one value; once that value is committed the feed is locked and there is a valid, non-empty value to consume.

Imports 9

Source Files 2