A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jamesmarlowe/lua-resty-github below:

jamesmarlowe/lua-resty-github: Lua library for using the github api in the ngx_lua nginx module

lua-resty-github - Lua library for using the github api

This library is still under early development and considered experimental.

This Lua library is a github utility for the ngx_lua nginx module.

One potential use case for this is automatically filing issues for you when errors occur in your code base.

    lua_package_path "/path/to/lua-resty-github/lib/?.lua;;";
    
    server {
        location /test {
            content_by_lua '
                local github = require "resty.github"
                
                local gh, err = github:new("github_token")
                
                local issue_url, err = gh:safe_create_issue("github_owner", "github_repo", "issue_title", "issue_body")
                
                ngx.say("Issue created at: "..issue_url)
            ';
        }
        
        include .../lua-resty-github/conf/*.urls;
    }

Back to TOC

All of the commands return either something that evaluates to true on success, or nil and an error message on failure.

syntax: gh, err = github:new("github_token")

Creates an github auth object. In case of failures, returns nil and a string describing the error. You can create a token at https://github.com/settings/tokens/new

Back to TOC

syntax: issues, err = gh:get_issues(owner, repo, state, issue)

syntax: issues, err = gh:get_issues("jamesmarlowe", "lua-resty-github", "open")

Gets issues for the specified repository. In case of failures, returns nil and a string describing the error.

Back to TOC

syntax: issue, err = gh:new_issue(owner, repo, title, body)

syntax: issue, err = gh:new_issue("jamesmarlowe", "lua-resty-github", "test-issue", "issue body")

Creates and returns an issue in the specified repository. In case of failures, returns nil and a string describing the error.

Back to TOC

syntax: issue, err = gh:safe_create_issue(owner, repo, title, body)

syntax: issue, err = gh:safe_create_issue("jamesmarlowe", "lua-resty-github", "test-issue", "issue body")

Finds or creates and returns an issue in the specified repository. In case of failures, returns nil and a string describing the error.

Back to TOC

Back to TOC

If you are using your own nginx + ngx_lua build, then you need to configure the lua_package_path directive to add the path of your lua-resty-github source tree to ngx_lua's LUA_PATH search path, and include the urls, as in

    # nginx.conf
    http {
    
        lua_package_path "/path/to/lua-resty-github/lib/?.lua;;";
        
        ...
        
        server {
        
            include .../lua-resty-github/conf/*.urls;
            
        }
    }

Ensure that the system account running your Nginx ''worker'' proceses have enough permission to read the .lua file.

I've also made a docker image to make setup of the nginx environment easier. View details here: https://registry.hub.docker.com/u/jamesmarlowe/lua-resty-github/

# install docker according to http://docs.docker.com/installation/

# pull image
sudo docker pull jamesmarlowe/lua-resty-github

# make sure it is there
sudo docker images

# run the image
sudo docker run -t -i jamesmarlowe/lua-resty-github

Back to TOC

Back to TOC

James Marlowe "jamesmarlowe" jameskmarlowe@gmail.com, Lumate LLC.

Back to TOC

This module is licensed under the BSD license.

Copyright (C) 2012-2014, by James Marlowe (jamesmarlowe) jameskmarlowe@gmail.com, Lumate LLC.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Back to TOC

Back to TOC


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4