(create-client client-config)
Returns a new Stencil Clojure client instance by passing client-config.
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:
(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)) ```
(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.
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close