(-main & args)
(arg-vectors required optional)
Takes a collection of required arguments and a collection of optional arguments. Returns a collection containing all valid combinatons of the two. For example,
(arg-vectors [:conn :index :type] [:id :req]) will return:
([conn index type] [conn index type id] [conn index type id req])
Takes a collection of required arguments and a collection of optional arguments. Returns a collection containing all valid combinatons of the two. For example, (arg-vectors [:conn :index :type] [:id :req]) will return: ([conn index type] [conn index type id] [conn index type id req])
(blacklisted? blacklisted-fns path)
(body-required? spec fn-name)
(default-args spec orig-fn-name impl)
(defmethod-form fn-name method path required-args optional-args dispatch)
(defmethod-form-false fn-name method path required-args optional-args)
(defmethod-form-true fn-name method path required-args optional-args)
(defmulti-form fn-name)
(defn-form fn-name method path required-args optional-args)
(document-specs)
The elasticsearch.document namespace is a catch-all for APIs that aren't namespaced by Elasticsearch itself.
The elasticsearch.document namespace is a catch-all for APIs that aren't namespaced by Elasticsearch itself.
(fn-args spec & [impl])
(format-path path)
(forms-to-keep namespace)
In order to avoid overwriting blacklisted function implementations, and to allow us to keep extra-API function definitions in the same files as the generated code, we need a way to pass over these forms in a given file. This function returns a string containing all such forms. We use a comment string to separate hand-maintained code from generated code.
In order to avoid overwriting blacklisted function implementations, and to allow us to keep extra-API function definitions in the same files as the generated code, we need a way to pass over these forms in a given file. This function returns a string containing all such forms. We use a comment string to separate hand-maintained code from generated code.
(function-name spec)
The dispatch function's core logic is as follows:
If the function requires a body, there's no point in using multimethods, as regular defn forms can express this easily.
If there are fewer than three forms, there's also no point in using multimethods.
In any other case, we need to use multimethods to express the largest number of possible valid combinations of arguments.
The dispatch function's core logic is as follows: If the function requires a body, there's no point in using multimethods, as regular defn forms can express this easily. If there are fewer than three forms, there's also no point in using multimethods. In any other case, we need to use multimethods to express the largest number of possible valid combinations of arguments.
(gen-fn-base spec fn-name impl)
(gen-forms fn-name method path required-args optional-args req?)
The core of the code generation logic. Returns the forms that will ultimately make up the body of a variadic function.
The core of the code generation logic. Returns the forms that will ultimately make up the body of a variadic function.
(largest-arity impl arg-vecs)
(last-arg-req? arg-vec)
(method spec)
Certain Elasticsearch APIs consider both POST and GET to be valid HTTP methods. For example, searches can be initiated with either a POST or a GET. Certain proxies do not consider GET requests with bodies to be valid. So, to account for this, we'll default to POST as the method for an API that accepts both.
Certain Elasticsearch APIs consider both POST and GET to be valid HTTP methods. For example, searches can be initiated with either a POST or a GET. Certain proxies do not consider GET requests with bodies to be valid. So, to account for this, we'll default to POST as the method for an API that accepts both.
(move-id-arg args)
There are a few APIs that require an index, type, and id to be passed. The REST API specs for these functions typically order them as [:id :index :type], but URL paths are universally ordered as /{index}/{type}/{id}. If we encounter an argument vector that contains these three, this function will order them in the latter fashion by 'moving' :id to the end of the collection..
There are a few APIs that require an index, type, and id to be passed. The REST API specs for these functions typically order them as [:id :index :type], but URL paths are universally ordered as /{index}/{type}/{id}. If we encounter an argument vector that contains these three, this function will order them in the latter fashion by 'moving' :id to the end of the collection..
(namespaces)
(new-forms namespace writer)
(newln writer)
(original-function-name spec)
(recursive-call fn-name arg-vec)
Returns an implementation of a variadic function that calls the next highest arity of itself with an additional value as its last argument. This last value will either be nil or req, depending on whether req is the last argument in the given arg-vec.
Returns an implementation of a variadic function that calls the next highest arity of itself with an additional value as its last argument. This last value will either be nil or req, depending on whether req is the last argument in the given arg-vec.
(replace-sym s)
(req-last args)
No matter what, we always want the req argument to be the last argument in an argument vector.
No matter what, we always want the req argument to be the last argument in an argument vector.
(request-call method path req?)
Takes a method, a path, and req? (a boolean.) Returns an appropriate call to elasticsearch.conn/request with the method, path, and either the symbol req or an empty map, as elasticsearch.conn/request expects a map as its last argument. For a variadic function, this will serve as the base implementation that all other arities ultimately call.
Takes a method, a path, and req? (a boolean.) Returns an appropriate call to elasticsearch.conn/request with the method, path, and either the symbol req or an empty map, as elasticsearch.conn/request expects a map as its last argument. For a variadic function, this will serve as the base implementation that all other arities ultimately call.
(specs-for-namespace namespace)
(transform-args args)
Transforms a vec of keywords (possibly containing underscores) into vec of propertly-formatted symbols with the id symbol in the correct position.
Transforms a vec of keywords (possibly containing underscores) into vec of propertly-formatted symbols with the id symbol in the correct position.
(underscores-are-bad-and-should-feel-bad x)
(url-path spec)
(write-ns namespace writer)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close