Documentation ¶
Index ¶
Constants ¶
View Source
const ( Legacy = "" V4 = "v4" V5 = "v5" )
Versions of the API that can be served.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HTTPCloseHandler ¶
HTTPCloseHandler represents a HTTP handler that must be closed after use.
func NewServer ¶
func NewServer(db *mgo.Database, es *elasticsearch.Database, idx string, config ServerParams, serveVersions ...string) (HTTPCloseHandler, 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.
type ServerParams ¶
type ServerParams struct { // AuthUsername and AuthPassword hold the credentials // used for HTTP basic authentication. AuthUsername string AuthPassword string // IdentityLocation holds the location of the third party authorization // service to use when creating third party caveats, // for example: http://api.jujucharms.com/identity/v1/discharger // If it is empty, IdentityURL+"/v1/discharger" will be used. IdentityLocation string // TermsLocations holds the location of the // terms service, which knows about user agreements to // Terms and Conditions required by the charm. TermsLocation string // PublicKeyLocator holds a public key store. // It may be nil. PublicKeyLocator bakery.PublicKeyLocator // IdentityAPIURL holds the URL of the identity manager, // for example http://api.jujucharms.com/identity IdentityAPIURL string // AgentUsername and AgentKey hold the credentials used for agent // authentication. AgentUsername string AgentKey *bakery.KeyPair // StatsCacheMaxAge is the maximum length of time between // refreshes of entities in the stats cache. StatsCacheMaxAge time.Duration // SearchCacheMaxAge is the maximum length of time between // refreshes of entities in the search cache. SearchCacheMaxAge time.Duration // MaxMgoSessions specifies a soft limit on the maximum // number of mongo sessions used. Each concurrent // HTTP request will use one session. MaxMgoSessions int // HTTPRequestWaitDuration holds the amount of time // that an HTTP request will wait for a free connection // when the MaxConcurrentHTTPRequests limit is reached. HTTPRequestWaitDuration time.Duration // AuditLogger optionally holds the logger which will be used to // write audit log entries. AuditLogger *lumberjack.Logger }
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. |
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. |
entitycache
Package entitycache provides a cache of charmstore entities and base-entities, designed to be used for individual charmstore API requests.
|
Package entitycache provides a cache of charmstore entities and base-entities, designed to be used for individual charmstore API requests. |
legacy
The legacy package implements the legacy API, as follows:
|
The legacy package implements the legacy API, as follows: |
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. |
series
Package series holds information about series supported in the charmstore.
|
Package series holds information about series supported in the charmstore. |
Click to show internal directories.
Click to hide internal directories.