Documentation ¶
Overview ¶
Package hivy - REST framework ============================
Copyright 2013 Hivetech SAS ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Gate between user requests and Hive jobs. The client sends authentified http requests to reach endpoints defined in the endpoints directory. Through the process a centralized configuration server, backed by etcd, stores user-defined and hive settings, and a central authority is asked for methods permissions. Login and password are provided through standard http mechanism and currently verified in etcd database after some base64 decoding.
Usage example:
$ go run hivy.hivy.go --verbose --listen 0.0.0.0:8080
Client usage example
$ GET -C name:pass http://localhost:8080/login/ $ curl --user name:pass http://127.0.0.1:8080/juju/deploy?project=trading $ python -m "import requests; requests.delete('http://127.0.0.1:8080/user', data={'user': 'Chuck'}, auth=('user', 'pass')'"
Index ¶
- Constants
- func CreateUser(request *restful.Request, response *restful.Response)
- func DeleteUser(request *restful.Request, response *restful.Response)
- func Deploy(request *restful.Request, response *restful.Response)
- func Destroy(request *restful.Request, response *restful.Response)
- func Dummy(request *restful.Request, response *restful.Response)
- func EmptyJSON() *simplejson.Json
- func Help(request *restful.Request, response *restful.Response)
- func JSON(data string) *simplejson.Json
- func Login(request *restful.Request, response *restful.Response)
- func Plug(request *restful.Request, response *restful.Response)
- func Status(request *restful.Request, response *restful.Response)
- type Juju
- func (jj *Juju) AddRelation(user, serviceOne, serviceTwo string) (*simplejson.Json, error)
- func (jj *Juju) Charmstore(service string) (string, string, error)
- func (jj *Juju) Deploy(user, service string) (*simplejson.Json, error)
- func (jj *Juju) Destroy(user, service string) (*simplejson.Json, error)
- func (jj *Juju) Status(user, service string) (*simplejson.Json, error)
Constants ¶
const ( // GlobalHelp shows a sum up of the app GlobalHelp string = ` RESTful framework for busy people. Effectively expose secured, fully configurable background jobs. ` // NodeHelp explains juju exposed endpoints NodeHelp string = `` /* 539-byte string literal not displayed */ // LoginHelp explains what happens when logging in LoginHelp string = ` Format: GET /login If well authentified, hivy returns a private ssh key for further secured interactions. ` // UserHelp details endpoints relative to user management UserHelp string = `` /* 238-byte string literal not displayed */ // HelpHelp explains the help endpoint HelpHelp string = `` /* 156-byte string literal not displayed */ // ConfigHelp explains etcd interaction ConfigHelp string = `` /* 144-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func CreateUser ¶
func CreateUser(request *restful.Request, response *restful.Response)
CreateUser Stores given credentials and creates methods permission for the given user, regarding the given group (only admin and standard group are supported at the moment)
func DeleteUser ¶
func DeleteUser(request *restful.Request, response *restful.Response)
DeleteUser removes from etcd storage evrything related to the given user-id
func Deploy ¶
func Deploy(request *restful.Request, response *restful.Response)
Deploy creates new nodes
func Destroy ¶
func Destroy(request *restful.Request, response *restful.Response)
Destroy removes nodes
func Dummy ¶
func Dummy(request *restful.Request, response *restful.Response)
Dummy is the hello-world endpoint, for demo and test purpose
func Help ¶
func Help(request *restful.Request, response *restful.Response)
Help provides a json object describing available commands
func Login ¶
func Login(request *restful.Request, response *restful.Response)
Login is an endpoint that delivers a certificate, used later for etcd communication permission. It is used as a callback wen registered with a path at the authority server
Types ¶
type Juju ¶
type Juju struct { Path string Controller *beacon.Controller }
Juju is a provider used for Nodes management
func (*Juju) AddRelation ¶
AddRelation links two juju services
func (*Juju) Charmstore ¶
Charmstore search for the appropriate configuration