Liking cljdoc? Tell your friends :D

stencil.core


create-clientclj

(create-client client-config)

Returns a new Stencil Clojure client instance by passing client-config.

Client config structure :

KeyTypeDescription
urlStringStencil url to fetch latest schema
refresh-cacheBooleanWhether the cache should be refreshed or not
refresh-ttlIntegerCache TTL in minutes
request-timeoutIntegerRequest timeout in milliseconds
request-backoff-timeIntegerRequest back off time in minutes
retry-countIntegerNumber of retries to be made to fetch schema
headersMapMap with key as header key and value as header value, which will be passed to stencil server
refresh-strategykeywordPossible values :version-based-refresh, :long-polling-refresh. Default :long-polling-refresh

Example:

(let [sample-client-config {:url       "https://example-url"
                           :refresh-cache        true
                           :refresh-ttl          100
                           :request-timeout      10000
                           :request-backoff-time 100
                           :retry-count          3
                           :headers              {"Authorization" "Bearer <token>"}
                           :refresh-strategy     :version-based-refresh
                           }]
      (create-client sample-client-config))
Returns a new Stencil Clojure client instance by passing client-config.

### Client config structure :
| Key                    | Type      | Description                                                                                 |
| -----------------------|-----------|---------------------------------------------------------------------------------------------|
| `url`                  | _String_  | Stencil url to fetch latest schema                                                          |
| `refresh-cache`        | _Boolean_ | Whether the cache should be refreshed or not                                                |
| `refresh-ttl`          | _Integer_ | Cache TTL in minutes                                                                        |
| `request-timeout`      | _Integer_ | Request timeout in milliseconds                                                             |
| `request-backoff-time` | _Integer_ | Request back off time in minutes                                                            |
| `retry-count`          | _Integer_ | Number of retries to be made to fetch schema                                                |
| `headers`              | _Map_     | Map with key as header key and value as header value, which will be passed to stencil server|
| `refresh-strategy`     | _keyword_ | Possible values :version-based-refresh, :long-polling-refresh. Default :long-polling-refresh|

Example:
```clojure
(let [sample-client-config {:url       "https://example-url"
                           :refresh-cache        true
                           :refresh-ttl          100
                           :request-timeout      10000
                           :request-backoff-time 100
                           :retry-count          3
                           :headers              {"Authorization" "Bearer <token>"}
                           :refresh-strategy     :version-based-refresh
                           }]
      (create-client sample-client-config))
```
sourceraw docstring

deserializeclj

(deserialize client proto-class-name data)

Returns Clojure map for the given protobuf encoded byte array and protobuf class name.

Returns Clojure map for the given protobuf encoded byte array and protobuf class name.
sourceraw docstring

get-descriptorclj

(get-descriptor client proto-class-name)

Returns protobuf descriptor object for the given protobuf class name.

Returns protobuf descriptor object for the given protobuf class name.
sourceraw docstring

serializeclj

(serialize client proto-class-name map)

Returns protobuf encoded byte array for the given Clojure and protobuf class name.

Returns protobuf encoded byte array for the given Clojure and protobuf class name.
sourceraw docstring

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

× close