charmstore

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2014 License: LGPL-3.0 Imports: 8 Imported by: 0

README

juju/charmstore

Store and publish Juju charms.

Installation

To start using the charm store, run the following:

go get -u -v -t github.com/juju/charmstore/...

Go dependencies

The project uses godeps (https://launchpad.net/godeps) to manage Go dependencies. After installing the application, you can update the dependencies to the revision specified in the dependencies.tsv file with the following:

make deps

Use make create-deps to update the dependencies file.

Development environment

A couple of system packages are required in order to set up a charm store development environment. To install them, run the following:

make sysdeps

To run the elasticsearch tests you must run an elasticsearch server. If the elasticsearch server is running at an address other than localhost:9200 then set JUJU_TEST_ELASTICSEARCH=<host>:<port> where host and port provide the address of the elasticsearch server.

At this point, from the root of this branch, run the command::

make install

The command above builds and installs the charm store binaries, and places them in $GOPATH/bin. This is the list of the installed commands:

  • charmd: start the charm store server;

A description of each command can be found below.

Testing

Run make check to test the application. Run make help to display help about all the available make targets.

Charmstore server

Once the charms database is fully populated, it is possible to interact with charm data using the charm store server. It can be started with the following command:

charmd -logging-config INFO cmd/charmd/config.yaml

The same result can be achieved more easily by running make server.

At this point the server starts listening on port 8080 (as specified in the config YAML file).

Documentation

Index

Constants

View Source
const (
	V4     = "v4"
	Legacy = ""
)

Versions of the API that can be served.

Variables

This section is empty.

Functions

func NewServer

func NewServer(db *mgo.Database, es *elasticsearch.Index, config ServerParams, serveVersions ...string) (http.Handler, error)

NewServer returns a new handler that handles charm store requests and stores its data in the given database. The handler will serve the specified versions of the API using the given configuration.

func Versions

func Versions() []string

Versions returns all known API version strings in alphabetical order.

Types

type ServerParams

type ServerParams struct {
	AuthUsername string
	AuthPassword string
}

ServerParams holds configuration for a new API server.

Directories

Path Synopsis
cmd
The config package defines configuration parameters for the charm store.
The config package defines configuration parameters for the charm store.
The csclient package provides access to the charm store API.
The csclient package provides access to the charm store API.
internal
charmstore
This is the internal version of the charmstore package.
This is the internal version of the charmstore package.
debug
The debug package holds various functions that may be used for debugging but should not be included in production code.
The debug package holds various functions that may be used for debugging but should not be included in production code.
legacy
The legacy package implements the legacy API, as follows: /charm-info A GET call to `/charm-info` returns info about one or more charms, including its canonical URL, revision, SHA256 checksum and VCS revision digest.
The legacy package implements the legacy API, as follows: /charm-info A GET call to `/charm-info` returns info about one or more charms, including its canonical URL, revision, SHA256 checksum and VCS revision digest.
router
The router package implements an HTTP request router for charm store HTTP requests.
The router package implements an HTTP request router for charm store HTTP requests.
v4
The params package holds types that are a part of the charm store's external contract - they will be marshalled (or unmarshalled) as JSON and delivered through the HTTP API.
The params package holds types that are a part of the charm store's external contract - they will be marshalled (or unmarshalled) as JSON and delivered through the HTTP API.

Jump to

Keyboard shortcuts

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