Liking cljdoc? Tell your friends :D

s4.core


bucket-get-opsclj

(bucket-get-ops bucket
                request
                {:keys [konserve cost-tracker] :as system}
                request-id)
source

make-handlerclj

(make-handler system)

Make an asynchronous, authenticated S3 ring handler.

See s3-handler and s4.auth/authenticating-handler for what keys should be in system.

Make an asynchronous, authenticated S3 ring handler.

See [[s3-handler]] and [[s4.auth/authenticating-handler]]
for what keys should be in `system`.
sourceraw docstring

make-reloadable-handlerclj

(make-reloadable-handler system)

Create an S3 handler that will rebuild the handler functions on every request; this way you can reload the namespace in between calls via a REPL. System is an atom containing a system map.

Create an S3 handler that will rebuild the handler functions on
every request; this way you can reload the namespace in between
calls via a REPL. System is an atom containing a system map.
sourceraw docstring

make-server!clj

(make-server! {:keys [bind-address port konserve cost-tracker reloadable?
                      auth-store hostname request-id-prefix clock sqs-server
                      enable-sqs?]
               :or {hostname "localhost"
                    clock (Clock/systemUTC)
                    bind-address "127.0.0.1"
                    port 0}})

Launch a HTTP server that serves the S3 HTTP API.

Arguments include:

  • bind-address A string, or an InetAddress; the address to bind to. Defaults to "127.0.0.1".
  • port A port number to bind to. Defaults to 0, which will bind to a random available port.
  • konserve An instance satisfying konserve.protocols/PEDNAsyncKeyValueStore. Will default to a in-memory store if not supplied.
  • cost-tracker A s4.$$$$/ICostTracker instance. Defaults to one that simulates default usage in us-west-2.
  • reloadable? If truthy, creates the HTTP handler such that if you reload namespaces s4.core or s4.auth, the changes are reflected in the running server. Default false.
  • auth-store An instance satisfying s4.auth.protocols/AuthStore. Defaults to a s4.auth/AtomAuthStore instance.
  • hostname The hostname to assign the server, default "localhost".
  • request-id-prefix A string to prepend to request IDs. Default nil.
  • clock A java.time.Clock to use for generating timestamps. Default is (java.time.Clock/systemUTC)
  • sqs-server An optional atom containing the system in use for simulated SQS queues; this must, at minimum, contain the key :queues, which is an atom containing a map of queue name -> queue. E.g. this should match what is returned by s4.sqs/make-server!. If not specified, SQS events are never triggered and can't be configured.
  • enable-sqs? If set to true, then SQS is assumed to be desired, and if sqs-server is nil, this will create a new SQS server, sharing the konserve, auth-store, bind-address, and reloadable? parameters, and binding to a random port.

Return value is an atom, containing a map of keys:

  • server The aleph HTTP server.
  • bind-address The InetSocketAddress that was bound, including the port that was selected, if a random port was used.
  • konserve The konserve store instance.
  • cost-tracker The cost tracker instance.
  • auth-store The auth store instance. If you let this create the default store, you likely want to assoc your fake access keys into the atom contained by the AtomAuthStore.
Launch a HTTP server that serves the S3 HTTP API.

Arguments include:

* `bind-address` A string, or an InetAddress; the address to bind
  to. Defaults to "127.0.0.1".
* `port` A port number to bind to. Defaults to 0, which will bind
  to a random available port.
* `konserve` An instance satisfying konserve.protocols/PEDNAsyncKeyValueStore.
  Will default to a in-memory store if not supplied.
* `cost-tracker` A `s4.$$$$/ICostTracker` instance. Defaults to
  one that simulates default usage in us-west-2.
* `reloadable?` If truthy, creates the HTTP handler such that if
  you reload namespaces s4.core or s4.auth, the changes are reflected
  in the running server. Default false.
* `auth-store` An instance satisfying s4.auth.protocols/AuthStore.
  Defaults to a `s4.auth/AtomAuthStore` instance.
* `hostname` The hostname to assign the server, default "localhost".
* `request-id-prefix` A string to prepend to request IDs. Default nil.
* `clock` A `java.time.Clock` to use for generating timestamps. Default
  is `(java.time.Clock/systemUTC)`
* `sqs-server` An optional atom containing the system in use for simulated
  SQS queues; this must, at minimum, contain the key :queues, which is
  an atom containing a map of queue name -> queue. E.g. this should match
  what is returned by [[s4.sqs/make-server!]]. If not specified, SQS events
  are never triggered and can't be configured.
* `enable-sqs?` If set to true, then SQS is assumed to be desired, and
  if `sqs-server` is nil, this will create a new SQS server, sharing the
  konserve, auth-store, bind-address, and reloadable? parameters, and
  binding to a random port.

Return value is an atom, containing a map of keys:

* `server` The aleph HTTP server.
* `bind-address` The InetSocketAddress that was bound, including
  the port that was selected, if a random port was used.
* `konserve` The konserve store instance.
* `cost-tracker` The cost tracker instance.
* `auth-store` The auth store instance. If you let this create the
  default store, you likely want to assoc your fake access keys into
  the atom contained by the AtomAuthStore.
sourceraw docstring

read-handlersclj

Read handlers for fressian, for durable konserve stores.

Read handlers for fressian, for durable konserve stores.
sourceraw docstring

s3-handlerclj

(s3-handler {:keys [konserve hostname request-id-prefix request-counter
                    cost-tracker clock sqs-server]
             :as system})

Create an asynchronous Ring handler for the S3 API.

Keys in the argument map:

  • konserve The konserve instance.
  • hostname Your hostname, e.g. "localhost". This should match what your client sends.
  • request-id-prefix A string to prepend to request IDs.
  • request-counter An atom containing an int, used to generate request IDs.
  • cost-tracker A s4.$$$$/ICostTracker, for estimating costs.
  • clock A java.time.Clock to use for generating timestamps.
Create an asynchronous Ring handler for the S3 API.

Keys in the argument map:

* `konserve` The konserve instance.
* `hostname` Your hostname, e.g. "localhost". This should match what your client sends.
* `request-id-prefix` A string to prepend to request IDs.
* `request-counter` An atom containing an int, used to generate request IDs.
* `cost-tracker` A [[s4.$$$$/ICostTracker]], for estimating costs.
* `clock` A `java.time.Clock` to use for generating timestamps.
sourceraw docstring

write-handlersclj

Write handlers for fressian, for durable konserve stores.

Write handlers for fressian, for durable konserve stores.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close