seawa

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AvailableEventTypes = []osmodels.EventType{osmodels.ItemListed, osmodels.ItemSold, osmodels.ItemReceivedOffer} // ItemMetadataUpdated, ItemCancelled

)

Functions

This section is empty.

Types

type MgmtAction

type MgmtAction int64
const (
	// client actions.
	Subscribe MgmtAction = iota
	Unsubscribe

	// SendSlugs is used to request the slugs/events to subscribe to from the clients.
	SendSlugs
)

func (MgmtAction) String

func (a MgmtAction) String() string

type MgmtEvent

type MgmtEvent struct {
	Action MgmtAction           `json:"action"`
	Events []osmodels.EventType `json:"events"`
	Slugs  []string             `json:"slugs"`
}

type SeaWatcher

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

func NewStreamWatcher

func NewStreamWatcher(apiToken string, rdb *redis.Client) *SeaWatcher

func (*SeaWatcher) ActiveSubscriptions

func (sw *SeaWatcher) ActiveSubscriptions() map[osmodels.EventType]map[string]func()

func (*SeaWatcher) EventChannel

func (sw *SeaWatcher) EventChannel() chan map[string]interface{}

func (*SeaWatcher) SubscribeForSlug

func (sw *SeaWatcher) SubscribeForSlug(eventType osmodels.EventType, slug string) bool

func (*SeaWatcher) UnubscribeForSlug

func (sw *SeaWatcher) UnubscribeForSlug(eventType osmodels.EventType, slug string) bool

Jump to

Keyboard shortcuts

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