Crate hubcaps [] [src]

Hubcaps provides a set of building blocks for interacting with the Github API

Examples

Typical use will require instantiation of a Github client. Which requires a user agent string, a hyper::Client, and set of hubcaps::Credentials.

The hyper client should be configured with tls.

extern crate hubcaps;
extern crate hyper;
extern crate hyper_native_tls;

use hubcaps::{Credentials, Github};
use hyper::Client;
use hyper::net::HttpsConnector;
use hyper_native_tls::NativeTlsClient;

fn main() {
  let github = Github::new(
    String::from("user-agent-name"),
    Client::with_connector(
      HttpsConnector::new(
        NativeTlsClient::new().unwrap()
      )
    ),
    Credentials::Token(
      String::from("personal-access-token")
    )
  );
}

Github enterprise users will want to create a client with the Github#host method

Access to various services are provided via methods on instances of the Github type.

The convention for executing operations typically looks like github.repo(.., ..).service().operation(OperationOptions) where operation may be create, delete, ect. Services and their types are packaged under their own module namespace. A service interface will provide access to operations and operations may access options types this define the various parameter options available for the operation. Most operation option types expose builder() methods for a builder oriented style of constructing options.

Errors

Operations typically result in a hubcaps::Result Type which is an alias for Rust's built-in Result with the Err Type fixed to the hubcaps::Error enum type.

Reexports

pub use errors::Error;
pub use errors::ErrorKind;
pub use errors::Result;

Modules

branches

Gists interface

comments

Comments interface

deployments

Deployments interface

errors

Client errors

gists

Gists interface

git

Git interface

hooks

Hooks interface See the github docs for more information

issues

Issues interface

keys

Deploy keys interface This this document for motivation and use

labels

Labels interface

organizations

Organizations interface

pull_commits

Pull Commits interface

pulls

Pull requests interface

releases

Releases inteface

repositories

Repository interface

review_comments

Review comments interface

search

Search interface

statuses

Statuses interface

teams

Teams interface

users

Users interface

Structs

Github

Entry point interface for interacting with Github API

Iter

An abstract type used for iterating over result sets

Link
Links

An abstract collection of Link header urls Exposes interfaces to access link relations github typically sends as headers

Enums

Credentials

Various forms of authentication credentials supported by Github

MediaType

alias for Result that infers hubcaps::Error as Err Github defined Media types See this doc for more for more information

SortDirection

enum representation of Github list sorting options