Skip to main content

GitHubGateway

Assembly: ServiceStack.Common.dll
View Source
Declaration
public class GitHubGateway : IGitHubGateway, IGistGateway

Properties

UserAgent

View Source
Declaration
public string UserAgent { get; set; }

BaseUrl

View Source
Declaration
public string BaseUrl { get; set; }

AccessToken

AccessTokenSecret

View Source
Declaration
public string AccessToken { get; set; }

GetJsonFilter

Intercept and override GitHub JSON API requests

View Source
Declaration
public Func<string, string> GetJsonFilter { get; set; }

Fields

ApiBaseUrl

View Source
Declaration
public const string ApiBaseUrl = "https://api.github.com/"

Methods

GetRateLimitsAsync()

View Source
Declaration
public async Task<GithubRateLimits> GetRateLimitsAsync()
Returns

System.Threading.Tasks.Task<ServiceStack.GithubRateLimits>

GetRateLimits()

View Source
Declaration
public GithubRateLimits GetRateLimits()
Returns

ServiceStack.GithubRateLimits

AssertRepo(String[], String, Boolean)

View Source
Declaration
public virtual Tuple<string, string> AssertRepo(string[] orgs, string name, bool useFork = false)
Returns

System.Tuple<System.String,System.String>

Parameters
TypeName
System.String[]orgs
System.Stringname
System.BooleanuseFork

FindRepo(String[], String, Boolean)

View Source
Declaration
public virtual Tuple<string, string> FindRepo(string[] orgs, string name, bool useFork = false)
Returns

System.Tuple<System.String,System.String>

Parameters
TypeName
System.String[]orgs
System.Stringname
System.BooleanuseFork

GetSourceZipUrl(String, String)

View Source
Declaration
public virtual string GetSourceZipUrl(string user, string repo)
Returns

System.String

Parameters
TypeName
System.Stringuser
System.Stringrepo

GetSourceZipUrl(String, String, String)

View Source
Declaration
public virtual string GetSourceZipUrl(string user, string repo, string tag)
Returns

System.String

Parameters
TypeName
System.Stringuser
System.Stringrepo
System.Stringtag

GetSourceZipUrlAsync(String, String)

View Source
Declaration
public virtual async Task<string> GetSourceZipUrlAsync(string user, string repo)
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringuser
System.Stringrepo

GetSourceReposAsync(String)

View Source
Declaration
public virtual async Task<List<GithubRepo>> GetSourceReposAsync(string orgName)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>

Parameters
TypeName
System.StringorgName

GetUserAndOrgReposAsync(String)

View Source
Declaration
public virtual async Task<List<GithubRepo>> GetUserAndOrgReposAsync(string githubOrgOrUser)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>

Parameters
TypeName
System.StringgithubOrgOrUser

GetRepo(String, String)

View Source
Declaration
public virtual GithubRepo GetRepo(string userOrOrg, string repo)
Returns

ServiceStack.GithubRepo

Parameters
TypeName
System.StringuserOrOrg
System.Stringrepo

GetRepoAsync(String, String)

View Source
Declaration
public virtual Task<GithubRepo> GetRepoAsync(string userOrOrg, string repo)
Returns

System.Threading.Tasks.Task<ServiceStack.GithubRepo>

Parameters
TypeName
System.StringuserOrOrg
System.Stringrepo

GetUserRepos(String)

View Source
Declaration
public virtual List<GithubRepo> GetUserRepos(string githubUser)
Returns

System.Collections.Generic.List<ServiceStack.GithubRepo>

Parameters
TypeName
System.StringgithubUser

GetUserReposAsync(String)

View Source
Declaration
public virtual async Task<List<GithubRepo>> GetUserReposAsync(string githubUser)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>

Parameters
TypeName
System.StringgithubUser

GetOrgRepos(String)

View Source
Declaration
public virtual List<GithubRepo> GetOrgRepos(string githubOrg)
Returns

System.Collections.Generic.List<ServiceStack.GithubRepo>

Parameters
TypeName
System.StringgithubOrg

GetOrgReposAsync(String)

View Source
Declaration
public virtual async Task<List<GithubRepo>> GetOrgReposAsync(string githubOrg)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.GithubRepo>>

Parameters
TypeName
System.StringgithubOrg

GetJson(String)

View Source
Declaration
public virtual string GetJson(string route)
Returns

System.String

Parameters
TypeName
System.Stringroute

GetJson<T>(String)

View Source
Declaration
public virtual T GetJson<T>(string route)
Returns

<T>

Parameters
TypeName
System.Stringroute
Type Parameters
  • T

GetJsonAsync(String)

View Source
Declaration
public virtual async Task<string> GetJsonAsync(string route)
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringroute

GetJsonAsync<T>(String)

View Source
Declaration
public virtual async Task<T> GetJsonAsync<T>(string route)
Returns

System.Threading.Tasks.Task<<T>>

Parameters
TypeName
System.Stringroute
Type Parameters
  • T

StreamJsonCollection<T>(String)

View Source
Declaration
public virtual IEnumerable<T> StreamJsonCollection<T>(string route)
Returns

System.Collections.Generic.IEnumerable<<T>>

Parameters
TypeName
System.Stringroute
Type Parameters
  • T

GetJsonCollectionAsync<T>(String)

View Source
Declaration
public virtual async Task<List<T>> GetJsonCollectionAsync<T>(string route)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<<T>>>

Parameters
TypeName
System.Stringroute
Type Parameters
  • T

ParseLinkUrls(String)

View Source
Declaration
public virtual Dictionary<string, string> ParseLinkUrls(string linkHeader)
Returns

System.Collections.Generic.Dictionary<System.String,System.String>

Parameters
TypeName
System.StringlinkHeader

DownloadFile(String, String)

View Source
Declaration
public virtual void DownloadFile(string downloadUrl, string fileName)
Parameters
TypeName
System.StringdownloadUrl
System.StringfileName

GetGithubGist(String)

View Source
Declaration
public virtual GithubGist GetGithubGist(string gistId)
Returns

ServiceStack.GithubGist

Parameters
TypeName
System.StringgistId

GetGithubGist(String, String)

View Source
Declaration
public virtual GithubGist GetGithubGist(string gistId, string version)
Returns

ServiceStack.GithubGist

Parameters
TypeName
System.StringgistId
System.Stringversion

GetGist(String)

View Source
Declaration
public virtual Gist GetGist(string gistId)
Returns

ServiceStack.Gist

Parameters
TypeName
System.StringgistId

GetGist(String, String)

View Source
Declaration
public Gist GetGist(string gistId, string version)
Returns

ServiceStack.Gist

Parameters
TypeName
System.StringgistId
System.Stringversion

GetGistAsync(String)

View Source
Declaration
public async Task<Gist> GetGistAsync(string gistId)
Returns

System.Threading.Tasks.Task<ServiceStack.Gist>

Parameters
TypeName
System.StringgistId

GetGistAsync(String, String)

View Source
Declaration
public async Task<Gist> GetGistAsync(string gistId, string version)
Returns

System.Threading.Tasks.Task<ServiceStack.Gist>

Parameters
TypeName
System.StringgistId
System.Stringversion

CreateGist(String, Boolean, Dictionary<String, Object>)

View Source
Declaration
public virtual Gist CreateGist(string description, bool isPublic, Dictionary<string, object> files)
Returns

ServiceStack.Gist

Parameters
TypeName
System.Stringdescription
System.BooleanisPublic
System.Collections.Generic.Dictionary<System.String,System.Object>files

CreateGist(String, Boolean, Dictionary<String, String>)

View Source
Declaration
public virtual Gist CreateGist(string description, bool isPublic, Dictionary<string, string> textFiles)
Returns

ServiceStack.Gist

Parameters
TypeName
System.Stringdescription
System.BooleanisPublic
System.Collections.Generic.Dictionary<System.String,System.String>textFiles

CreateGithubGist(String, Boolean, Dictionary<String, Object>)

View Source
Declaration
public virtual GithubGist CreateGithubGist(string description, bool isPublic, Dictionary<string, object> files)
Returns

ServiceStack.GithubGist

Parameters
TypeName
System.Stringdescription
System.BooleanisPublic
System.Collections.Generic.Dictionary<System.String,System.Object>files

CreateGithubGist(String, Boolean, Dictionary<String, String>)

View Source
Declaration
public virtual GithubGist CreateGithubGist(string description, bool isPublic, Dictionary<string, string> textFiles)
Returns

ServiceStack.GithubGist

Parameters
TypeName
System.Stringdescription
System.BooleanisPublic
System.Collections.Generic.Dictionary<System.String,System.String>textFiles

IsDirSep(Char)

View Source
Declaration
public static bool IsDirSep(char c)
Returns

System.Boolean

Parameters
TypeName
System.Charc

ToTextFiles(Dictionary<String, Object>)

View Source
Declaration
public static Dictionary<string, string> ToTextFiles(Dictionary<string, object> files)
Returns

System.Collections.Generic.Dictionary<System.String,System.String>

Parameters
TypeName
System.Collections.Generic.Dictionary<System.String,System.Object>files

WriteGistFiles(String, Dictionary<String, Object>, String, Boolean)

View Source
Declaration
public virtual void WriteGistFiles(string gistId, Dictionary<string, object> files, string description = null, bool deleteMissing = false)
Parameters
TypeName
System.StringgistId
System.Collections.Generic.Dictionary<System.String,System.Object>files
System.Stringdescription
System.BooleandeleteMissing

WriteGistFiles(String, Dictionary<String, String>, String, Boolean)

Create or Write Gist Text Files. Requires AccessToken

View Source
Declaration
public virtual void WriteGistFiles(string gistId, Dictionary<string, string> textFiles, string description = null, bool deleteMissing = false)
Parameters
TypeName
System.StringgistId
System.Collections.Generic.Dictionary<System.String,System.String>textFiles
System.Stringdescription
System.BooleandeleteMissing

CreateGistFile(String, String, String)

Create new Gist File. Requires AccessToken

View Source
Declaration
public virtual void CreateGistFile(string gistId, string filePath, string contents)
Parameters
TypeName
System.StringgistId
System.StringfilePath
System.Stringcontents

WriteGistFile(String, String, String)

Create or Write Gist File. Requires AccessToken

View Source
Declaration
public virtual void WriteGistFile(string gistId, string filePath, string contents)
Parameters
TypeName
System.StringgistId
System.StringfilePath
System.Stringcontents

AssertAccessToken()

View Source
Declaration
protected virtual void AssertAccessToken()

DeleteGistFiles(String, String[])

View Source
Declaration
public virtual void DeleteGistFiles(string gistId, params string[] filePaths)
Parameters
TypeName
System.StringgistId
System.String[]filePaths

ApplyRequestFilters(HttpWebRequest)

View Source
Declaration
public virtual void ApplyRequestFilters(HttpWebRequest req)
Parameters
TypeName
System.Net.HttpWebRequestreq

Implements