goreydenx

package module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 8 Imported by: 6

README

REYDEN-X

Reyden-X is an automated service for promoting live broadcasts on external sites with integrated system of viewers and views management.
Quickstart
package main

import (
	"fmt"
	rx "github.com/pixel365/goreydenx"
	m "github.com/pixel365/goreydenx/model"
	"github.com/pixel365/goreydenx/orders"
	"github.com/pixel365/goreydenx/prices"
	"github.com/pixel365/goreydenx/user"
)

func main() {
	// new client
	client := rx.NewClient("EMAIL", "PASSWORD").Auth()
	
	// user account details
	res, err := user.Account(client)
	if err != nil {
		fmt.Println(res)
	}

	// order details
	res, err = orders.Details(client, 12345)
	if err != nil {
		fmt.Println(res)
	}

	// prices for Twitch
	res, err = prices.Twitch(client)
	if err != nil {
		fmt.Println(res)
	}

	// make new order
	res, err = orders.CreateStream[*m.TwitchParams](client, &m.TwitchParams{
		BaseOrderParams: m.BaseOrderParams{
			LaunchMode: rx.LaunchModeAuto,
			SmoothGain: m.SmoothGain{
				Enabled: false,
				Minutes: 0,
			},
			PriceId:         1,
			NumberOfViews:   10_000,
			NumberOfViewers: 100,
			DelayTime:       0,
		},
		TwitchId: 12345,
	})
	if err != nil {
		fmt.Println(res)
	}
}

Documentation

Index

Constants

View Source
const (
	BaseUrl = "https://api.reyden-x.com/v1"

	Twitch   = "twitch"
	YouTube  = "youtube"
	GoodGame = "goodgame"
	Trovo    = "trovo"
	VkPlay   = "vkplay"

	LaunchModeAuto   = "auto"
	LaunchModeDelay  = "delay"
	LaunchModeManual = "manual"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
	JSONEncoder JSONMarshal
	JSONDecoder JSONUnmarshal
	Token       *Token
	BaseUrl     string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(userName string, password string) *Client

NewClient Make Client instance

func NewClientWithToken added in v1.0.7

func NewClientWithToken(token *Token) *Client

NewClientWithToken Make Client instance

func (*Client) Auth

func (c *Client) Auth() *Client

func (*Client) Get

func (c *Client) Get(path string) ([]byte, error)

func (*Client) Patch

func (c *Client) Patch(path string, payload io.Reader) ([]byte, error)

func (*Client) Post

func (c *Client) Post(path string, payload io.Reader) ([]byte, error)

type JSONMarshal

type JSONMarshal func(v interface{}) ([]byte, error)

type JSONUnmarshal

type JSONUnmarshal func(data []byte, v interface{}) error

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   string `json:"expires_in"`
	TokenType   string `json:"token_type,omitempty"`
}

func (*Token) IsValid

func (t *Token) IsValid() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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