Documentation ¶
Index ¶
- type Channel
- func (c *Channel) Close() SendFuture[*messages.CloseChannel]
- func (c *Channel) Count() SendFuture[*messages.ChannelCount]
- func (c *Channel) Fetch() SendFuture[*messages.GetChannelMeta]
- func (c *Channel) Id() string
- func (c *Channel) Info() *ChannelInfo
- func (c *Channel) Leave() SendFuture[*messages.LeaveChannel]
- func (c *Channel) Metadata() map[string]any
- func (c *Channel) Name() string
- func (c *Channel) OnClose(f func()) *Channel
- func (c *Channel) OnLeave(f func()) *Channel
- func (c *Channel) ReplayChannelMessage(targetTimestamp int64, inverse bool, volume omega.Volume) Player
- func (c *Channel) Role() omega.Role
- func (c *Channel) RoleName() string
- func (c *Channel) SendMessage(msg string, metadata map[string]any) SendFuture[*messages.ChannelMessage]
- func (c *Channel) SendOwnerMessage(msg string, metadata map[string]any) SendFuture[*messages.ChannelOwnerMessage]
- func (c *Channel) SetMetadata(metadata map[string]any) SendFuture[*messages.SetChannelMeta]
- func (c *Channel) SetName(name string) SendFuture[*messages.SetChannelMeta]
- func (c *Channel) SetSkill(skill *omega.Skill) SendFuture[*messages.SetChannelMeta]
- func (c *Channel) Watch(f func(msg messages.TransitFrame)) *Channel
- type ChannelInfo
- func (c *ChannelInfo) ChannelId() string
- func (c *ChannelInfo) Close(key string) SendFuture[*messages.CloseChannel]
- func (c *ChannelInfo) CreatedAt() int64
- func (c *ChannelInfo) Join(key string) *Channel
- func (c *ChannelInfo) Metadata() map[string]any
- func (c *ChannelInfo) Name() string
- func (c *ChannelInfo) Skill() *omega.Skill
- type CreateChannelFuture
- type CreateVoteFuture
- type Omega
- func (o *Omega) Agent() base.Agent
- func (o *Omega) Broadcast(msg string) bool
- func (o *Omega) Channel(channelId string) *ChannelInfo
- func (o *Omega) Close() concurrent.Future
- func (o *Omega) CreateChannel(createChannel apirequest.CreateChannel) *CreateChannelFuture
- func (o *Omega) CreateVote(createVote apirequest.CreateVote) *CreateVoteFuture
- func (o *Omega) GetRemoteSession(sessionId string) RemoteSession[base.RemoteSession]
- func (o *Omega) Hello() SendFuture[*messages.Hello]
- func (o *Omega) IsClosed() bool
- func (o *Omega) Ping() bool
- func (o *Omega) PlaybackChannelMessage(channelId string, targetTimestamp int64, inverse bool, volume omega.Volume) Player
- func (o *Omega) ServerTime() SendFuture[*messages.ServerTime]
- func (o *Omega) Session() Session
- func (o *Omega) Vote(voteId string) *VoteInfo
- type OmegaBuilder
- type Player
- type RemoteSession
- type SendFuture
- type Session
- type Vote
- func (v *Vote) Close() SendFuture[*messages.CloseVote]
- func (v *Vote) Count() SendFuture[*messages.VoteCount]
- func (v *Vote) Fetch() SendFuture[*messages.GetVoteMeta]
- func (v *Vote) Id() string
- func (v *Vote) Info() *VoteInfo
- func (v *Vote) Leave() SendFuture[*messages.LeaveVote]
- func (v *Vote) Metadata() map[string]any
- func (v *Vote) Name() string
- func (v *Vote) OnClose(f func()) *Vote
- func (v *Vote) OnLeave(f func()) *Vote
- func (v *Vote) Select(voteOptionId string) bool
- func (v *Vote) SendMessage(msg string) SendFuture[*messages.VoteMessage]
- func (v *Vote) SendOwnerMessage(msg string) SendFuture[*messages.VoteOwnerMessage]
- func (v *Vote) SetMetadata(metadata map[string]any) SendFuture[*messages.SetVoteMeta]
- func (v *Vote) SetName(name string) SendFuture[*messages.SetVoteMeta]
- func (v *Vote) Status(statusType omega.Vote_Status) SendFuture[*messages.VoteStatus]
- func (v *Vote) Watch(f func(msg messages.TransitFrame)) *Vote
- type VoteInfo
- func (v *VoteInfo) Close(key string) SendFuture[*messages.CloseVote]
- func (v *VoteInfo) CreatedAt() int64
- func (v *VoteInfo) Join(key string) *Vote
- func (v *VoteInfo) Metadata() map[string]any
- func (v *VoteInfo) Name() string
- func (v *VoteInfo) VoteId() string
- func (v *VoteInfo) VoteOptions() []VoteOption
- type VoteOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func (*Channel) Close ¶
func (c *Channel) Close() SendFuture[*messages.CloseChannel]
func (*Channel) Count ¶
func (c *Channel) Count() SendFuture[*messages.ChannelCount]
func (*Channel) Fetch ¶
func (c *Channel) Fetch() SendFuture[*messages.GetChannelMeta]
func (*Channel) Info ¶
func (c *Channel) Info() *ChannelInfo
func (*Channel) Leave ¶
func (c *Channel) Leave() SendFuture[*messages.LeaveChannel]
func (*Channel) ReplayChannelMessage ¶
func (*Channel) SendMessage ¶
func (c *Channel) SendMessage(msg string, metadata map[string]any) SendFuture[*messages.ChannelMessage]
func (*Channel) SendOwnerMessage ¶
func (c *Channel) SendOwnerMessage(msg string, metadata map[string]any) SendFuture[*messages.ChannelOwnerMessage]
func (*Channel) SetMetadata ¶
func (c *Channel) SetMetadata(metadata map[string]any) SendFuture[*messages.SetChannelMeta]
func (*Channel) SetName ¶
func (c *Channel) SetName(name string) SendFuture[*messages.SetChannelMeta]
func (*Channel) SetSkill ¶
func (c *Channel) SetSkill(skill *omega.Skill) SendFuture[*messages.SetChannelMeta]
type ChannelInfo ¶
type ChannelInfo struct {
// contains filtered or unexported fields
}
func (*ChannelInfo) ChannelId ¶
func (c *ChannelInfo) ChannelId() string
func (*ChannelInfo) Close ¶
func (c *ChannelInfo) Close(key string) SendFuture[*messages.CloseChannel]
func (*ChannelInfo) CreatedAt ¶
func (c *ChannelInfo) CreatedAt() int64
func (*ChannelInfo) Join ¶
func (c *ChannelInfo) Join(key string) *Channel
func (*ChannelInfo) Metadata ¶
func (c *ChannelInfo) Metadata() map[string]any
func (*ChannelInfo) Name ¶
func (c *ChannelInfo) Name() string
func (*ChannelInfo) Skill ¶
func (c *ChannelInfo) Skill() *omega.Skill
type CreateChannelFuture ¶
type CreateChannelFuture struct {
// contains filtered or unexported fields
}
func (*CreateChannelFuture) Info ¶
func (f *CreateChannelFuture) Info() *ChannelInfo
func (*CreateChannelFuture) Join ¶
func (f *CreateChannelFuture) Join() *Channel
type CreateVoteFuture ¶
type CreateVoteFuture struct {
// contains filtered or unexported fields
}
func (*CreateVoteFuture) Info ¶
func (f *CreateVoteFuture) Info() *VoteInfo
func (*CreateVoteFuture) Join ¶
func (f *CreateVoteFuture) Join() *Vote
type Omega ¶
type Omega struct { OnMessageHandler func(msg messages.TransitFrame) OnSessionMessageHandler func(msg *messages.SessionMessage) OnBroadcastHandler func(msg *messages.Broadcast) OnClosedHandler func() OnErrorHandler func(err error) // contains filtered or unexported fields }
func (*Omega) Channel ¶
func (o *Omega) Channel(channelId string) *ChannelInfo
func (*Omega) Close ¶
func (o *Omega) Close() concurrent.Future
func (*Omega) CreateChannel ¶
func (o *Omega) CreateChannel(createChannel apirequest.CreateChannel) *CreateChannelFuture
func (*Omega) CreateVote ¶
func (o *Omega) CreateVote(createVote apirequest.CreateVote) *CreateVoteFuture
func (*Omega) GetRemoteSession ¶
func (o *Omega) GetRemoteSession(sessionId string) RemoteSession[base.RemoteSession]
func (*Omega) PlaybackChannelMessage ¶
func (*Omega) ServerTime ¶
func (o *Omega) ServerTime() SendFuture[*messages.ServerTime]
type OmegaBuilder ¶
type OmegaBuilder struct {
// contains filtered or unexported fields
}
func NewOmegaBuilder ¶
func NewOmegaBuilder(conf *base.Config) *OmegaBuilder
func (*OmegaBuilder) Connect ¶
func (b *OmegaBuilder) Connect() concurrent.CastFuture[*Omega]
func (*OmegaBuilder) WithEngine ¶ added in v1.0.2
func (b *OmegaBuilder) WithEngine(engine *base.Engine) *OmegaBuilder
type Player ¶
type Player interface {
Next() messages.TransitFrame
}
type RemoteSession ¶
type RemoteSession[T base.RemoteSession] interface { Base() T GetId() string GetSubject() string GetName() string GetMetadata() map[string]any OnMessage(f func(msg *messages.SessionMessage)) SendMessage(message string) SendFuture[*messages.SessionMessage] Fetch() SendFuture[*messages.GetSessionMeta] }
type SendFuture ¶
type SendFuture[T messages.TransitFrame] interface { Base() base.SendFuture Await() SendFuture[T] AwaitTimeout(timeout time.Duration) SendFuture[T] IsDone() bool IsSuccess() bool IsCancelled() bool IsFail() bool Error() error TransitFrame() (t T) AddListener(listener concurrent.FutureListener) SendFuture[T] }
type Session ¶
type Session interface { RemoteSession[base.Session] SetName(name string) SendFuture[*messages.SetSessionMeta] SetMetadata(metadata map[string]any) SendFuture[*messages.SetSessionMeta] OnRead(f func(th *omega.TransitFrame)) OnClosed(f func()) OnError(f func(err error)) Close() concurrent.Future }
type Vote ¶
type Vote struct {
// contains filtered or unexported fields
}
func (*Vote) Fetch ¶
func (v *Vote) Fetch() SendFuture[*messages.GetVoteMeta]
func (*Vote) SendMessage ¶
func (v *Vote) SendMessage(msg string) SendFuture[*messages.VoteMessage]
func (*Vote) SendOwnerMessage ¶
func (v *Vote) SendOwnerMessage(msg string) SendFuture[*messages.VoteOwnerMessage]
func (*Vote) SetMetadata ¶
func (v *Vote) SetMetadata(metadata map[string]any) SendFuture[*messages.SetVoteMeta]
func (*Vote) SetName ¶
func (v *Vote) SetName(name string) SendFuture[*messages.SetVoteMeta]
func (*Vote) Status ¶
func (v *Vote) Status(statusType omega.Vote_Status) SendFuture[*messages.VoteStatus]
type VoteInfo ¶
type VoteInfo struct {
// contains filtered or unexported fields
}
func (*VoteInfo) VoteOptions ¶
func (v *VoteInfo) VoteOptions() []VoteOption
type VoteOption ¶
func (*VoteOption) Select ¶
func (vo *VoteOption) Select() bool
Click to show internal directories.
Click to hide internal directories.