twitter

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	plugins.BasePlugin
	FlushInterval uint64   `json:"flushInterval" jsonschema:"description=Flush Interval in milliseconds (Default: 1000)"`
	Rules         []string `json:"rules" jsonschema:"rules for Twitter Stream"`
}

Plugin represents our plugin

func (*Plugin) Extract

func (plugin *Plugin) Extract(req sdk.ExtractRequest, evt sdk.EventReader) error

Extract allows Falco plugin framework to get values for all available fields

func (*Plugin) Fields

func (plugin *Plugin) Fields() []sdk.FieldEntry

Fields exposes to Falco plugin framework all availables fields for this plugin

func (*Plugin) Info

func (plugin *Plugin) Info() *plugins.Info

Info displays information of the plugin to Falco plugin framework

func (*Plugin) Init

func (plugin *Plugin) Init(config string) error

Init is called by the Falco plugin framework as first entry, we use it for setting default configuration values and mapping values from `init_config` (json format for this plugin)

func (*Plugin) Open

func (plugin *Plugin) Open(params string) (source.Instance, error)

Open is called by Falco plugin framework for opening a stream of events, we call that an instance

type StreamData

type StreamData struct {
	Data struct {
		Text           string `json:"text"`
		ID             string `json:"id"`
		AuthorID       string `json:"author_id"`
		AuthorName     string
		AuthorUsername string
		Lang           string    `json:"lang"`
		CreatedAt      time.Time `json:"created_at"`
	} `json:"data"`
	Includes struct {
		Users []struct {
			ID       string `json:"id"`
			Name     string `json:"name"`
			Username string `json:"username"`
		} `json:"users"`
	} `json:"includes"`
	MatchingRules []struct {
		ID  string `json:"id"`
		Tag string `json:"tag"`
	} `json:"matching_rules"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL