Giter VIP home page Giter VIP logo

client-go's Introduction

NewReleases API v1 Go client

Go GoDoc NewReleases

Package newreleases is a Go client library for accessing the NewReleases v1 API.

You can view the client API docs here: https://godoc.org/newreleases.io/newreleases

You can view NewReleases API docs here: https://newreleases.io/api/v1

Installation

Run go get newreleases.io/newreleases from command line.

Usage

import "newreleases.io/newreleases"

Create a new Client, then use the exposed services to access different parts of the API.

Authentication

Currently, API keys is the only method of authenticating with the API. You can manage your keys at the NewReleases API keys settings page.

You can then use your token to create a new Client.

Features

This client implements all NewReleases API features.

  • List projects
  • Search projects
  • Get project
  • Add project
  • Update project
  • Delete project
  • List projects releases
  • Get project release
  • Get latest non-excluded project release
  • Get project release note
  • Get tracked providers
  • Get added Slack Channels
  • Get added Telegram Chats
  • Get added Dissord Channels
  • Get added Hangouts Chat webhooks
  • Get added Microsoft Teams webhooks
  • Get added Mattermost webhooks
  • Get added Rocket.Chat webhooks
  • Get added Matrix Rooms
  • Get added custom Webhooks
  • List tags
  • Get tag
  • Add tag
  • Update tag
  • Delete tag
  • Get auth keys

Examples

To add a new project:

package main

import (
    "context"
    "log"

    "newreleases.io/newreleases"
)

var key = "myapikey"

func main() {
    client := newreleases.NewClient(key, nil)
    p, err := client.Projects.Add(
        context.Background(),
        "github",
        "golang/go",
        newreleases.ProjectOptions{
            EmailNotification: &newreleases.EmailNotificationHourly,
        }
    )
    if err != nil {
        log.Fatal(err)
    }
    log.Print(p.ID)
}

List projects with pagination:

func AllProjects(ctx context.Context, client *newreleases.Client) (pp []newreleases.Project, err error) {
    o := &newreleases.ProjectListOptions{
        Page: 1,
    }
    for {
        projects, lastPage, err := client.Projects.List(ctx, o)
        if err != nil {
            return nil, err
        }

        pp = append(pp, projects...)

        if o.Page >= lastPage {
            break
        }
        o.Page++
    }

    return pp, nil
}

Versioning

Each version of the client is tagged and the version is updated accordingly.

This package uses Go modules.

To see the list of past versions, run git tag.

Contributing

We love pull requests! Please see the contribution guidelines.

License

This library is distributed under the BSD-style license found in the LICENSE file.

client-go's People

Contributors

janos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

client-go's Issues

Does not report of new releases in case of the assets only update

I have noted at least of one project that the website does not track properly:

https://newreleases.io/github/itlezy/eMule

It reports that the last update was 3 months ago:

3 months ago:
[eMule_v0.60d-broadband](https://newreleases.io/github/itlezy/eMule?version=eMule_v0.60d-broadband) pre
10 months ago:
eMule_v0.60d-community
a year ago:
eMule_v0.60c-community
2 years ago:
eMule_v0.60b-community
eMule_v0.60a-community
3 years ago:
eMule_v0.51d-community
4 years ago:
eMule_v0.51c-community
eMule_v0.51b-community
eMule_v0.51a-unofficial
5 years ago:
eMule_v0.50b-unofficial

While the actual state of the repo:

https://github.com/itlezy/eMule/releases

https://github.com/itlezy/eMule/releases/tag/eMule_v0.60d-broadband

The reason is in the content. You track only tags/releases creation, when it is not enough. Needs to track the assets update too.

The limit of the API has been changed?

I found that the limit of the API has been changed from 1000 to 25000 today.

image

Is that a bug or a new feature?

I could not find your email so I wrote it here. I am a developer from China, use golang at work, if there is anything I can help to do with newreleasesio, just call me via echo aUB3b2xmb2dyZS5jb20K | base64 --decode

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.