ghstatus

package module
v0.0.0-...-f1c2921 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2015 License: MIT Imports: 4 Imported by: 1

README

ghstatus

Build Status GoDoc

This Go library allows you to check the system status of GitHub from your own applications and monitoring services. The status information is retrieved from GitHub's system status API.

The project also comes with a simple command-line tool named ghstatus that utilizes the Go library.

Installation

First, make sure you have Go installed.

Library

To download and install the ghstatus library from source, simply run:

$ go get github.com/mlafeldt/ghstatus
Client

To install the ghstatus command-line tool, run this:

$ go get github.com/mlafeldt/ghstatus/cmd/ghstatus

Usage

Library

For usage and examples, see the Godoc for this package.

Client

To learn how to use the ghstatus tool, run ghstatus --help. The output will look like this:

NAME:
   ghstatus - Check the system status of GitHub from the command line

USAGE:
   ghstatus [global options] command [command options] [arguments...]

COMMANDS:
   status, s	Show current system status (default command)
   messages, m	Show recent human communications
   last, l	Show last human communication
   help, h	Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --version, -v	print the version
   --help, -h		show help

To find out more about a specific command, execute ghstatus help <command>.

Testing

You can run the tests this way:

$ cd ghstatus/
$ make test

License

ghstatus is licensed under the terms of the MIT License. See LICENSE file.

Contributing

Please see CONTRIBUTING.md for details.

Documentation

Overview

The ghstatus package allows you to check the system status of GitHub from your own applications. The status information is retrieved from GitHub's system status API (https://status.github.com/api).

Index

Constants

View Source
const (
	Good  = "good"
	Minor = "minor"
	Major = "major"
)

Possible status values set in Status and Message.

View Source
const ServiceURL = "https://status.github.com"

The URL of GitHub's system status API.

Variables

View Source
var DefaultClient = &Client{
	HTTPClient: http.DefaultClient,
	ServiceURL: ServiceURL,
}

The default client to talk to GitHub's system status API.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	ServiceURL string
}

A client to talk to GitHub's system status API.

func (*Client) GetLastMessage

func (c *Client) GetLastMessage() (*Message, error)

Get last human communication, status, and timestamp.

func (*Client) GetMessages

func (c *Client) GetMessages() ([]Message, error)

Get most recent human communications with status and timestamp.

func (*Client) GetStatus

func (c *Client) GetStatus() (*Status, error)

Get current system status and timestamp.

type Message

type Message struct {
	Status    string    `json:"status"`
	Body      string    `json:"body"`
	CreatedOn time.Time `json:"created_on"`
}

A status message as returned by GetMessages and GetLastMessage.

type Status

type Status struct {
	Status      string    `json:"status"`
	LastUpdated time.Time `json:"last_updated"`
}

Current system status as returned by GetStatus.

Directories

Path Synopsis
cmd
ghstatus command
With the ghstatus tool, you can check the system status of GitHub from the command line.
With the ghstatus tool, you can check the system status of GitHub from the command line.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL