Skip to content

blazingorb/sendbirdclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sendbird Client Package for Golang

Drone Build Status Go Report Card

Features

This library provides wrapper functions for Sendbird Platform API written in Golang and support following Sendbird APIs:

Requirements

  • Go 1.5 or later.
  • Sendbird API Key.

Installation

To install SendbirdClient for Golang, please execute the following go get command.

    go get github.com/blazingorb/sendbirdclient

Usage

Sample Usage of creating a new Sendbird User:

package main

import (
	"flag"
	"fmt"
	sendbirdclient "sendbirdclient"
)

const (
	IssueAccessToken  = false
	IsDistinct        = true
)

var (
	apiKey   = flag.String("key", "", "API Key for using Sendbird Platform API")
	userID   = flag.String("id", "", "UserID for creating a new user")
	nickName = flag.String("name", "", "Nickname for creating a new user")
)

func main() {
	flag.Parse()

	testClient, err := sendbirdclient.NewClient(sendbirdclient.WithAPIKey(*apiKey))
	check(err)

	user, err := testClient.CreateAUserWithURL(&sendbirdclient.CreateAUserWithURLRequest{
		UserID:   *userID,
		NickName: *nickName,
		IssueAccessToken: IssueAccessToken,
	})
	check(err)
	fmt.Printf("User: %+v \n", user)
}

func check(err error) {
	if err != nil {
		fmt.Println(err)
		panic(err)
	}
}

For more detail sample cases, please refer to files under examples folder.

Releases

No releases published

Packages

No packages published

Languages