Skip to content

xsolla/lfg-gorso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card codecov

GORSO

GORSO is a Riot OAuth API wrapper written in pure Go.

Prerequisites

For the moment, OAuth API does not provide any official documentation. All endpoints, parameters and info provided in GORSO are based on the Henrik-3 gist.

This package does not attempt to implement Riot API in its entirety, covering only the newest public RSO feature. To access remaining methods, we recommend checking out packages, such as golio.

Usage

import (
	"github.com/lf-group/gorso"
)

var rso = gorso.NewClient(gorso.Client{
	ID:       "CLIENT_ID",
	Secret:   "CLIENT_SECRET",
	Redirect: "REDIRECT_URL",
	Shard: 		gorso.ShardEU,
})

func ExampleAuthUser() {
	code := "CLIENT_CODE" // code is obtained on a client side

	data, err := rso.GetToken(code)
	if err != nil {
		if errors.Is(err, gorso.ErrSystem) {
			panic(err)
		}

		return
	}

	fmt.Println(data.AccessToken)
}