stream

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

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

func New

func New(state *state.State, oauthServer oauth.Server) Processor

func (*Processor) Authorize

func (p *Processor) Authorize(ctx context.Context, accessToken string) (*gtsmodel.Account, gtserror.WithCode)

Authorize returns an oauth2 token info in response to an access token query from the streaming API

func (*Processor) Delete

func (p *Processor) Delete(ctx context.Context, statusID string)

Delete streams the delete of the given statusID to *ALL* open streams.

func (*Processor) Notify

func (p *Processor) Notify(ctx context.Context, account *gtsmodel.Account, notif *apimodel.Notification)

Notify streams the given notification to any open, appropriate streams belonging to the given account.

func (*Processor) Open

func (p *Processor) Open(ctx context.Context, account *gtsmodel.Account, streamType string) (*stream.Stream, gtserror.WithCode)

Open returns a new Stream for the given account, which will contain a channel for passing messages back to the caller.

func (*Processor) StatusUpdate added in v0.14.0

func (p *Processor) StatusUpdate(ctx context.Context, account *gtsmodel.Account, status *apimodel.Status, streamType string)

StatusUpdate streams the given edited status to any open, appropriate streams belonging to the given account.

func (*Processor) Update

func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, status *apimodel.Status, streamType string)

Update streams the given update to any open, appropriate streams belonging to the given account.

Jump to

Keyboard shortcuts

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