Documentation ¶
Index ¶
- Variables
- type MgmtAction
- type MgmtEvent
- type SeaWatcher
- func (sw *SeaWatcher) ActiveSubscriptions() map[osmodels.EventType]map[string]func()
- func (sw *SeaWatcher) EventChannel() chan map[string]interface{}
- func (sw *SeaWatcher) Start()
- func (sw *SeaWatcher) SubscribeForSlug(eventType osmodels.EventType, slug string) bool
- func (sw *SeaWatcher) UnubscribeForSlug(eventType osmodels.EventType, slug string) bool
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 NewSeaWatcher ¶ added in v0.4.2
func NewSeaWatcher(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) Start ¶ added in v0.4.2
func (sw *SeaWatcher) Start()
Start starts the seawatcher by subscribing to the mgmt channel and listening for new slugs to subscribe to
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
Click to show internal directories.
Click to hide internal directories.