twitter

package
v0.0.0-...-65b5557 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStreamRules

func AddStreamRules(ctx context.Context, addRules []*gotwtr.AddRule) (*gotwtr.AddOrDeleteRulesResponse, error)

func DeleteStreamRules

func DeleteStreamRules(ctx context.Context, deleteRuleIDs []string) (*gotwtr.AddOrDeleteRulesResponse, error)

Types

type ConnectToStreamOption

type ConnectToStreamOption struct {
	Expansions  []gotwtr.Expansion
	MediaFields []gotwtr.MediaField
	PlaceFields []gotwtr.PlaceField
	PollFields  []gotwtr.PollField
	TweetFields []gotwtr.TweetField
	UserFields  []gotwtr.UserField
}

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func NewStream

func NewStream(tweets chan<- *gotwtr.ConnectToStreamResponse, opt ...*ConnectToStreamOption) (*Stream, error)

func (*Stream) Start

func (s *Stream) Start(ctx context.Context) error

Start connects to stream, and blocks on success.

func (*Stream) StartWithAutoReconnect

func (s *Stream) StartWithAutoReconnect(ctx context.Context) error

StartWithAutoReconnect connects to stream, and reconnects to the stream as long as no errors are caught. Blocks on success.

func (*Stream) Stop

func (s *Stream) Stop()

Jump to

Keyboard shortcuts

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