kore-doc

The kore documentation found under https://docs.kore.io/
Commits | Files | Refs | README | git clone https://git.kore.io/kore-doc.git

commit 55edd505e2f4b0ca12039521e7a28762b1a60c46
parent cd1ff94b5e677d3c9e04f13a4d510f4035f67c4b
Author: Joris Vink <joris@coders.se>
Date:   Mon,  3 Jun 2019 15:28:10 +0200

update for 3.3.1 release

Diffstat:
README.md | 2+-
api/curl.md | 17+++++++++++++++++
api/http.md | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
api/pgsql.md | 12++++++++++++
4 files changed, 106 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -5,7 +5,7 @@ Its primary goals are security, scalability and allowing rapid development and d Because of this Kore is an ideal candidate for building robust, scalable and secure web things. -This documentation is for the 3.3.0 release. +This documentation is for the 3.3.1 release. # Features diff --git a/api/curl.md b/api/curl.md @@ -17,6 +17,7 @@ Kore must be built with CURL=1 in order to use this API. * [kore\_curl\_run](#run) * [kore\_curl\_success](#success) * [kore\_curl\_logerror](#logerror) +* [kore\_curl\_strerror](#strerror) * [kore\_curl\_response\_as\_bytes](#responsebytes) * [kore\_curl\_response\_as\_string](#responsestring) * [kore\_curl\_http\_setup](#httpsetup) @@ -188,6 +189,22 @@ Log a notice with the error that the curl handle has returned. Nothing --- +# kore\_curl\_strerror {#strerror} +### Synopsis +``` +const char *kore_curl_strerror(struct kore_task *client) +``` +### Description +Returns a pointer to a human readable error string set by libcurl. + +| Parameter | Description | +| -- | -- | +| client | A kore\_curl data structure. | + +### Returns +A pointer to a human readable error string. + +--- # kore\_curl\_response\_as\_bytes {#responsebytes} ### Synopsis diff --git a/api/http.md b/api/http.md @@ -32,6 +32,9 @@ This page contains all available public functions related to understanding and r * [http\_argument\_get\_uint64](#http_argument_get_uint64) * [http\_argument\_get\_float](#http_argument_get_float) * [http\_argument\_get\_double](#http_argument_get_double) +* [http\_runlock\_init](#http_runlock_init) +* [http\_runlock\_acquire](#http_runlock_acquire) +* [http\_runlock\_release](#http_runlock_release) --- @@ -714,6 +717,79 @@ KORE\_RESULT\_OK if the argument was found or KORE\_RESULT\_ERROR if it was not --- +# http\_runlock\_init {#http_runlock_init} + +### Synopsis + +``` +void http_runlock_init(struct http_runlock *lock) +``` + +### Description + +Initializes a runlock for use later. + +| Parameter | Description | +| --- | --- | +| lock | The HTTP runlock to initialize. | + +### Returns + +Nothing + +--- + +# http\_runlock\_acquire {#http_runlock_acquire} + +### Synopsis + +``` +int http_runlock_acquire(struct http_runlock *lock, struct http_request *req) +``` + +### Description + +Attempts to acquire a runlock. If the runlock is busy the **req** request +is put to sleep. + +| Parameter | Description | +| --- | --- | +| lock | The HTTP runlock. | +| req | The HTTP request that wants the lock. | + +### Returns + +Returns KORE\_RESULT\_OK if the runlock was acquired or KORE\_RESULT\_ERROR +if the runlock was busy. If the runlock was busy the HTTP request is +automatically put to sleep and the calling handler should return +KORE\_RESULT\_RETRY accordingly. + +--- + +# http\_runlock\_release {#http_runlock_release} + +### Synopsis + +``` +void http_runlock_release(struct http_runlock *lock, struct http_request *req) +``` + +### Description + +Releases the runlock held by the given **req** request. If the holder of +the lock mismatches the request given the worker will fatal(). + +| Parameter | Description | +| --- | --- | +| lock | The HTTP runlock. | +| req | The HTTP request that held the lock. | + +### Returns + +Nothing + +--- + # Data structures ### http\_request diff --git a/api/pgsql.md b/api/pgsql.md @@ -152,6 +152,18 @@ The `format` argument may be 0 (`value` is a null-terminated string) or 1 (`valu KORE\_RESULT\_OK or KORE\_RESULT\_ERROR. +### Macros + +Passing arguments in a pair of 3 is hard to remember, so Kore provides a few +useful macros to make your life easier: + +* KORE\_PGSQL\_PARAM\_TEXT(data) +* KORE\_PGSQL\_PARAM\_BINARY(data, len) +* KORE\_PGSQL\_PARAM\_TEXT\_LEN(data, len) + +The above macros automatically expand to the correct 3-pair values required +by the kore\_pgsql\_query\_params() function. + --- # kore\_pgsql\_register