stream

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel added in v0.22.0

type Channel struct {
	// description for the channel
	Description string `json:"description"`
	// last activity time
	LastActive string `json:"lastActive"`
	// name of the channel
	Name string `json:"name"`
}

type CreateChannelRequest added in v0.22.0

type CreateChannelRequest struct {
	// description for the channel
	Description string `json:"description"`
	// name of the channel
	Name string `json:"name"`
}

type CreateChannelResponse added in v0.22.0

type CreateChannelResponse struct {
}

type ListChannelsRequest added in v0.22.0

type ListChannelsRequest struct {
}

type ListChannelsResponse added in v0.22.0

type ListChannelsResponse struct {
	Channels []Channel `json:"channels"`
}

type ListMessagesRequest added in v0.22.0

type ListMessagesRequest struct {
	// The channel to subscribe to
	Channel string `json:"channel"`
	// number of message to return
	Limit int32 `json:"limit"`
}

type ListMessagesResponse added in v0.22.0

type ListMessagesResponse struct {
	// The channel subscribed to
	Channel string `json:"channel"`
	// Messages are chronological order
	Messages []Message `json:"messages"`
}

type Message added in v0.22.0

type Message struct {
	// the channel name
	Channel string `json:"channel"`
	// id of the message
	Id string `json:"id"`
	// the associated metadata
	Metadata map[string]string `json:"metadata"`
	// text of the message
	Text string `json:"text"`
	// time of message creation
	Timestamp string `json:"timestamp"`
}

type SendMessageRequest added in v0.22.0

type SendMessageRequest struct {
	// The channel to send to
	Channel string `json:"channel"`
	// The message text to send
	Text string `json:"text"`
}

type SendMessageResponse added in v0.22.0

type SendMessageResponse struct {
}

type StreamService

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

func NewStreamService

func NewStreamService(token string) *StreamService

func (*StreamService) CreateChannel added in v0.22.0

func (t *StreamService) CreateChannel(request *CreateChannelRequest) (*CreateChannelResponse, error)

Create a channel with a given name and description. Channels are created automatically but this allows you to specify a description that's persisted for the lifetime of the channel.

func (*StreamService) ListChannels added in v0.22.0

func (t *StreamService) ListChannels(request *ListChannelsRequest) (*ListChannelsResponse, error)

List all the active channels

func (*StreamService) ListMessages added in v0.22.0

func (t *StreamService) ListMessages(request *ListMessagesRequest) (*ListMessagesResponse, error)

List messages for a given channel

func (*StreamService) SendMessage added in v0.22.0

func (t *StreamService) SendMessage(request *SendMessageRequest) (*SendMessageResponse, error)

Send a message to the stream.

Jump to

Keyboard shortcuts

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