examples

package
v1.2.22 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

How to run

  1. Realtime
  • Go to realtime dir cd realtime

  • Set the ABLY_KEY environment variable to your Ably API key

  • Realtime channel pub-sub

    go run presence/main.go

  • Realtime channel presence

    go run pub-sub/main.go

  1. REST
  • Go to rest dir cd rest

  • Set the ABLY_KEY environment variable to your Ably API key

  • Rest channel publish

    go run publish/main.go

  • Rest channel presence

    go run presence/main.go

  • Rest channel message history

    go run history/main.go

  • Rest application stats

    go run stats/main.go

Documentation

Index

Constants

View Source
const AblyKey = "ABLY_KEY"
View Source
const ChannelName = "chat"
View Source
const EventName = "message"
View Source
const UserName = "testUser"

Variables

This section is empty.

Functions

func InitRealtimeClient

func InitRealtimeClient() *ably.Realtime

func Jsonify

func Jsonify(i interface{}) string

func RealtimeEnterPresence

func RealtimeEnterPresence(client *ably.Realtime)

func RealtimeLeavePresence

func RealtimeLeavePresence(client *ably.Realtime)

func RealtimePublish

func RealtimePublish(client *ably.Realtime, message string)

func RealtimeSubscribeToEvent

func RealtimeSubscribeToEvent(client *ably.Realtime) func()

Types

This section is empty.

Directories

Path Synopsis
realtime
rest

Jump to

Keyboard shortcuts

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