Categorygithub.com/GetStream/stream-chat-go/v4
modulepackage
4.0.1
Repository: https://github.com/getstream/stream-chat-go.git
Documentation: pkg.go.dev

# README

stream-chat-go

build godoc

the official Golang API client for Stream chat a service for building chat applications.

You can sign up for a Stream account at https://getstream.io/chat/get_started/.

You can use this library to access chat API endpoints server-side, for the client-side integrations (web and mobile) have a look at the Javascript, iOS and Android SDK libraries (https://getstream.io/chat/).

Installation

go get github.com/GetStream/stream-chat-go/v4

Documentation

Official API docs

Supported features

  • Chat channels
  • Messages
  • Chat channel types
  • User management
  • Moderation API
  • Push configuration
  • User devices
  • User search
  • Channel search
  • Message search

Quickstart

package main

import (
	"os"

	stream "github.com/GetStream/stream-chat-go/v4"
)

var APIKey = os.Getenv("STREAM_CHAT_API_KEY")
var APISecret = os.Getenv("STREAM_CHAT_API_SECRET")
var userID = "" // your server user id

func main() {
	client, err := stream.NewClient(APIKey, APISecret)
	// handle error

	// use client methods

	// create channel with users
	users := []string{"id1", "id2", "id3"}
	channel, err := client.CreateChannel("messaging", "channel-id", userID, map[string]interface{}{
		"members": users,
	})

	// use channel methods
	msg, err := channel.SendMessage(&stream.Message{Text: "hello"}, userID)
}

Contributing

Contributions to this project are very much welcome, please make sure that your code changes are tested and that they follow Go best-practices. You can find some tips in CONTRIBUTING.md.

# Functions

MessageSkipPush is a flag that be given to SendMessage if you don't want to generate any push notifications.
No description provided by the author
NewChannelType returns initialized ChannelType with default values.
NewClient creates new stream chat api client.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Version returns the version of the library.
WithAndroid restricts the returned limits to Android clients only.
WithEndpoints restricts the returned limits info to the specified endpoints.
WithIOS restricts the returned limits to iOS clients only.
WithServerSide restricts the returned limits to server-side clients only.
WithWeb restricts the returned limits to web clients only.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
EventChannelCreated is fired when a channel is created.
EventChannelDeleted is fired when a channel is deleted.
EventChannelTruncated is fired when a channel is truncated.
EventChannelUpdated is fired when a channel is updated.
EventHealthCheck is fired when a user is updated.
EventMemberAdded is fired when a member is added to a channel.
EventMemberRemoved is fired when a member is removed from a channel.
EventMemberUpdated is fired when a member is updated.
EventMessageDeleted is fired when a message is deleted.
EventMessageNew is fired when a new message is added.
EventMessageRead is fired when a user calls mark as read.
EventMessageUpdated is fired when a message is updated.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
EventNotificationNewMessage and family are fired when a notification is created, marked read, invited to a channel, and so on.
No description provided by the author
EventReactionDeleted is fired when a message reaction deleted.
EventReactionNew is fired when a message reaction is added.
EventTypingStart and EventTypingStop are fired when a user starts or stops typing.
No description provided by the author
EventUserMuted is fired when a user is muted.
No description provided by the author
EventUserUnmuted is fired when a user is unmuted.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

DefaultChannelConfig is the default channel configuration.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ChannelConfig is the configuration for a channel.
No description provided by the author
ChannelMute represents a channel mute.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Command represents a custom command.
CommandResponse represents an API response containing one Command.
CommandsResponse represents an API response containing a list of Command.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Event is received from a webhook, or sent with the SendEvent function.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetRateLimitsResponse is the response of the Client.GetRateLimits call.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Mute represents a user mute.
No description provided by the author
PartialUserUpdate request; Set and Unset fields can be set at same time, but should not be same field, for example you cannot set 'field.path.name' and unset 'field.path' at the same time.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RateLimitInfo represents the quota and usage for a single endpoint.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Response is the base response returned to client.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UserCustomEvent is a custom event sent to a particular user.
No description provided by the author

# Type aliases

No description provided by the author
EventType marks which of the various sub-types of a webhook event you are receiving or sending.
GetRateLimitsOption configures the Client.GetRateLimits call.
No description provided by the author
RateLimitsMap holds the rate limit information, where the keys are the names of the endpoints and the values are the related RateLimitInfo containing the quota, usage, and reset data.
SendMessageOption is an option that modifies behavior of send message request.
No description provided by the author
No description provided by the author