voodfyapi

package
v0.0.0-...-6f193cf Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Patch(string) error
}

Client used to send requests to api

type HTTPClient

type HTTPClient struct {
	Endpoint string                 `json:"endpoint"`
	Payload  map[string]interface{} `json:"payload"`
	BaseURL  string
}

HTTPClient interface to encapsulate the logic behind client

func NewClient

func NewClient() HTTPClient

NewClient return an instance of the client

func (*HTTPClient) Embed

func (c *HTTPClient) Embed(token, title, description, cid string) (Video, error)

Embed do request to create a video at Voodfy

func (*HTTPClient) Post

func (c *HTTPClient) Post() error

Post do request to voodfyAPI

func (*HTTPClient) Powergate

func (c *HTTPClient) Powergate(secret string, premium bool) (Powergate, error)

Powergate do request to retrieve powergate instance

func (*HTTPClient) Retrieve

func (c *HTTPClient) Retrieve(secret string) (string, error)

Retrieve do request to retrieve user by secret

func (*HTTPClient) Signup

func (c *HTTPClient) Signup() error

Signup do request to signup

func (*HTTPClient) Token

func (c *HTTPClient) Token() (string, error)

Token do request to get token

func (*HTTPClient) URL

func (c *HTTPClient) URL() string

URL return the url

type Powergate

type Powergate struct {
	InstanceID string `json:"instanceID"`
	Token      string `json:"token"`
	Address    string `json:"address"`
}

Powergate struct used to bind powergate instance

type Response

type Response struct {
	Result struct {
		User      User      `json:"user"`
		Powergate Powergate `json:"powergate"`
		Video     Video     `json:"video"`
		Videos    Videos    `json:"videos"`
	} `json:"result"`
}

Response struct used to bind response from api

type User

type User struct {
	Token  string `json:"token"`
	Device string `json:"device"`
}

User struct used to bind user from api

type Video

type Video struct {
	ID string `json:"id"`
}

Video struct used to bind video intance

type Videos

type Videos []Video

Videos struct used to bind videos

Jump to

Keyboard shortcuts

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