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

# README

Official Go SDK for Stream Chat

build godoc

Official Go API client for Stream Chat, a service for building chat applications.
Explore the docs »

Report Bug · Request Feature

📝 About Stream

You can sign up for a Stream account at our Get Started page.

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 (docs).

⚙️ Installation

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

✨ Getting started

package main

import (
	"os"

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

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

func main() {
	// Initialize client
	client, err := stream.NewClient(APIKey, APISecret)
	
	// Or with a specific timeout
	client, err := stream.NewClient(APIKey, APISecret, WithTimeout(3 * time.Second))

	// Or using only environmental variables: (required) STREAM_KEY, (required) STREAM_SECRET,
	// (optional) STREAM_CHAT_TIMEOUT
	client, err := stream.NewClientFromEnvVars()

	// handle error

	// Define a context
	ctx := context.Background()

	// use client methods

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

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

✍️ Contributing

We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our Contributor License Agreement (CLA) first. See our license file for more details.

Head over to CONTRIBUTING.md for some development tips.

🧑‍💻 We are hiring!

We've recently closed a $38 million Series B funding round and we keep actively growing. Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.

Check out our current openings and apply via Stream's website.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
BanWithExpiration set when the ban will expire.
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
MessagePending is a flag that makes this a pending message.
MessagePendingMessageMetadata saves metadata to the pending message.
MessageSkipEnrichURL is a flag that disables enrichment of the URLs in the message.
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
No description provided by the author
NewChannelType returns initialized ChannelType with default values.
NewClient creates new stream chat api client.
NewClientFromEnvVars creates a new Client where the API key is retrieved from STREAM_KEY and the secret from STREAM_SECRET environmental variables.
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
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.
No description provided by the author
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
DefaultBaseURL is the default base URL for the stream chat api.
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
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
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
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
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
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
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
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
Mute represents a user mute.
No description provided by the author
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
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
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
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
No description provided by the author
No description provided by the author

# Type aliases

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
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
No description provided by the author
No description provided by the author
No description provided by the author
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.
No description provided by the author
SendMessageOption is an option that modifies behavior of send message request.
No description provided by the author
No description provided by the author