bus

package
v0.0.0-...-fe78ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicSteamEvents                                      = "steam.events"
	TopicSession                                          = "session"
	TopicSessionSteam                                     = "session.steam"
	TopicSessionDota                                      = "session.dota"
	TopicLiveMatchesReplace                               = "live_matches.replace"
	TopicLiveMatchesAdd                                   = "live_matches.add"
	TopicLiveMatchesUpdate                                = "live_matches.update"
	TopicLiveMatchesRemove                                = "live_matches.remove"
	TopicPatternLiveMatchesAll                            = "live_matches.*"
	TopicLiveMatchStatsAdd                                = "live_match_stats.add"
	TopicPatternLiveMatchStatsAll                         = "live_match_stats.*"
	TopicGCDispatcherSend                                 = "gc.dispatcher.send"
	TopicGCDispatcherReceivedMatchesMinimalResponse       = "gc.dispatcher.received.matches_minimal_response"
	TopicGCDispatcherReceivedFindTopSourceTVGamesResponse = "gc.dispatcher.received.find_top_source_tv_games_response"
	TopicWebLiveMatchesReplace                            = "web.live_matches.replace"
	TopicWebLiveMatchesAdd                                = "web.live_matches.add"
	TopicWebLiveMatchesUpdate                             = "web.live_matches.update"
	TopicWebLiveMatchesRemove                             = "web.live_matches.remove"
	TopicWebPatternLiveMatchesAll                         = "web.live_matches.*"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus struct {
	*emitter.Emitter
	// contains filtered or unexported fields
}

func New

func New(options Options) *Bus

func (*Bus) Pub

func (b *Bus) Pub(message Message) error

func (*Bus) PubSync

func (b *Bus) PubSync(message Message)

func (*Bus) Shutdown

func (b *Bus) Shutdown()

func (*Bus) Sub

func (b *Bus) Sub(topic string) *Subscription

func (*Bus) Unsub

func (b *Bus) Unsub(subs ...*Subscription)

type DotaSessionChangeMessage

type DotaSessionChangeMessage struct {
	*nsdota2.StateTransition

	IsReady bool
	Err     error
}

type ErrPublishTimeout

type ErrPublishTimeout struct {
	Message Message
	Timeout time.Duration
}

func (*ErrPublishTimeout) Error

func (*ErrPublishTimeout) Error() string

type ErrSubscriptionExpired

type ErrSubscriptionExpired struct {
	Subscription *Subscription
}

func (*ErrSubscriptionExpired) Error

func (*ErrSubscriptionExpired) Error() string

type GCDispatcherReceivedMessage

type GCDispatcherReceivedMessage struct {
	MsgType d2pb.EDOTAGCMsg
	Message proto.Message
}

type GCDispatcherSendMessage

type GCDispatcherSendMessage struct {
	MsgType d2pb.EDOTAGCMsg
	Message proto.Message
}

type LiveMatchStatsChangeMessage

type LiveMatchStatsChangeMessage struct {
	Op    nspb.CollectionOp
	Stats nscol.LiveMatchStats
}

type LiveMatchesChangeMessage

type LiveMatchesChangeMessage struct {
	Op       nspb.CollectionOp
	Matches  nscol.LiveMatches
	MatchIDs nscol.MatchIDs
}

type Message

type Message struct {
	Topic   string
	Pattern string
	Payload interface{}
}

type Options

type Options struct {
	Cap        uint
	Log        *nslog.Logger
	PubTimeout time.Duration
}

type SteamEventMessage

type SteamEventMessage struct {
	Event interface{}
}

type SteamSessionChangeMessage

type SteamSessionChangeMessage struct {
	*nssteam.StateTransition

	IsReady bool
	Err     error
}

type Subscription

type Subscription struct {
	Topic string
	C     <-chan Message
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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