Giter Club home page Giter Club logo

jwplatform-go's Introduction

Go JW Platform

GoDoc Build Status

The official Go client library for accessing the JW Platform API.

Requirements

Go 1.15+

Usage

import (
  "github.com/jwplayer/jwplatform-go"
  "github.com/jwplayer/jwplatform-go/media"
)

jwplatform := jwplatform.New("API_SECRET")
siteID := "9kzNUpe4"
mediaID := "LaJFzc9d"

// Get a Resource
media, err := jwplatform.Media.Get(siteID, mediaID)

// Create a Resource
mediaToCreate := &jwplatform.MediaMetadata(Title: "My new video")
media, err := jwplatform.Media.Create(siteID, mediaToCreate)

// List a Resource
mediaResources, err := jwplatform.Media.List(siteID, nil)
// Optionally include query parameters, including page, page length, sort, and filters.
params := jwplatform.QueryParams{Page: 2, PageLength: 5}
mediaResources, err := jwplatform.Media.List(siteID, params)

// Update a Resource
updateMetadata := &jwplatform.MediaMetadata{Title: "Updated video title"}
updatedMedia, err := jwplatform.Media.Update(siteID, mediaID, updateMetadata)

// Delete a Resource
_ := jwplatform.Media.Delete(siteID, mediaID)

Supported operations

All API methods documentated on the API are available in this client. Please refer to our api documentation.

Test

Before running the tests, make sure to grab all of the package's dependencies:

go get -t -v

Run all tests:

make test

For any requests, bug or comments, please [open an issue][issues] or [submit a pull request][pulls].

V1 Client

The V1 Client remains available for use, but is deprecated. We strongly recommend using the V2 Client. For documentation on the V1 Client, please refer to the v1 submodule.

jwplatform-go's People

Contributors

ksindi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jwplatform-go's Issues

Failed to install, error parsing go.mod

im trying to use install this into my project, but i got error

go get -u github.com/jwplayer/jwplatform-go       
go: github.com/jwplayer/[email protected]: parsing go.mod:
        module declares its path as: github.com/jwplayer/jwplayer-go/v0.1.0
                but was required as: github.com/jwplayer/jwplatform-go

For now, to resolve the issue i need to clone this repo and add replace in my go.mod project

go 1.13

require (
    ...
    github.com/jwplayer/jwplatform-go v0.2.0
    ...
)

replace github.com/jwplayer/jwplatform-go => /path/to/local/jwplatform-go

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.