orbit

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

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

Go to latest
Published: Mar 7, 2015 License: GPL-3.0 Imports: 12 Imported by: 0

README

Orbit

Orbit puts your development environment in the cloud.


Created at the LAUNCH Hackathon 2015. Demo: http://youtu.be/MY01d647S9Y.

Getting Started

Prerequisites
Client
  • Git
Server
  • Docker (with the client binary)
  • Git
Installation

Use the orbit or orbit-server command to interact with the app.

$ go get -u github.com/hackedu/orbit/...
$ orbit
$ orbit-server
Running
Server

First, set the DATABASE_URL environment variable to a valid Postgres database (ex: postgres://orpheus:hunter4@orbit.hackedu.us:5432/orbit).

Then run these commands to create the DB and serve the backend API.

# migrate the db
$ orbit-server createdb

# start the http server
$ orbit-server -url=http://0.0.0.0:5000 serve
Client

Make sure the client's base URL is set to what the server is serving on. Once the server is up and running, the client should be ready to go.

$ orbit -h

License

Copyright (C) 2015 hackEDU

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectNotFound = errors.New("project not found")
)
View Source
var (
	ErrServiceNotFound = errors.New("service not found")
)

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

Types

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string

	Projects ProjectsService
	Services ServicesService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response `json:",omitempty"`
	Message  string
}

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

func (*ErrorResponse) HTTPStatusCode

func (r *ErrorResponse) HTTPStatusCode() int

type Project

type Project struct {
	ID int

	// GitPath is a relative path to the project's files from the git root.
	GitPath string
}

type ProjectCmd

type ProjectCmd struct {
	ContainerType string
	Command       []string
}

type ProjectsService

type ProjectsService interface {
	Get(id int) (*Project, error)
	Create(project *Project) error
	Update(project *Project) error
}

type Service

type Service struct {
	ID          int
	ProjectID   int
	ContainerID string
	Type        string

	// The port exposed from the local Docker container to the host.
	PortExposed string

	// The port on the host that PortExposed corresponds to.
	HostPort string
}

type ServicesService

type ServicesService interface {
	Get(id int) (*Service, error)
	List(projectID int) ([]*Service, error)
	Create(service *Service) error
}

Directories

Path Synopsis
cmd
Adapted from https://code.csdn.net/flycutter/git-http-backend Adapted from https://code.csdn.net/flycutter/git-http-backend.
Adapted from https://code.csdn.net/flycutter/git-http-backend Adapted from https://code.csdn.net/flycutter/git-http-backend.

Jump to

Keyboard shortcuts

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