GNUnet 0.21.1
httpdomain.httpdomain Namespace Reference

Data Structures

class  CORSRef
 
class  DocRef
 
class  EventSourceRef
 
class  HTTPAny
 
class  HTTPConnect
 
class  HTTPCopy
 
class  HTTPDelete
 
class  HTTPDomain
 
class  HTTPGet
 
class  HTTPHead
 
class  HTTPIndex
 
class  HTTPLexer
 
class  HTTPOptions
 
class  HTTPPatch
 
class  HTTPPost
 
class  HTTPPut
 
class  HTTPResource
 
class  HTTPTrace
 
class  HTTPXRefHeaderRole
 
class  HTTPXRefMethodRole
 
class  HTTPXRefRole
 
class  HTTPXRefStatusRole
 
class  IETFRef
 
class  RFC2616Ref
 

Functions

def sort_by_method (entries)
 
def http_resource_anchor (method, path)
 
def setup (app)
 

Variables

dictionary _doctree_cache = {}
 
dictionary METHOD_REFS
 
dictionary HEADER_REFS
 
dictionary HTTP_STATUS_CODES
 
list WEBDAV_STATUS_CODES = [207, 422, 423, 424, 507]
 
 http_sig_param_re
 

Detailed Description

    sphinxcontrib.httpdomain
    ~~~~~~~~~~~~~~~~~~~~~~~~

    The HTTP domain for documenting RESTful HTTP APIs.

    :copyright: Copyright 2011 by Hong Minhee
    :license: BSD, see LICENSE for details.

Function Documentation

◆ sort_by_method()

def httpdomain.httpdomain.sort_by_method (   entries)

Definition at line 243 of file httpdomain.py.

243def sort_by_method(entries):
244 def cmp(item):
245 order = ['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH',
246 'OPTIONS', 'TRACE', 'CONNECT', 'COPY', 'ANY']
247 method = item[0].split(' ', 1)[0]
248 if method in order:
249 return order.index(method)
250 return 100
251 return sorted(entries, key=cmp)
252
253
def sort_by_method(entries)
Definition: httpdomain.py:243

Referenced by httpdomain.httpdomain.HTTPIndex.generate().

Here is the caller graph for this function:

◆ http_resource_anchor()

def httpdomain.httpdomain.http_resource_anchor (   method,
  path 
)

Definition at line 254 of file httpdomain.py.

254def http_resource_anchor(method, path):
255 path = re.sub(r'[{}]', '', re.sub(r'[<>:/]', '-', path))
256 return method.lower() + '-' + path
257
258
def http_resource_anchor(method, path)
Definition: httpdomain.py:254

Referenced by httpdomain.httpdomain.HTTPResource.add_target_and_index(), httpdomain.httpdomain.HTTPIndex.generate(), httpdomain.httpdomain.HTTPDomain.get_objects(), and httpdomain.httpdomain.HTTPDomain.resolve_xref().

Here is the caller graph for this function:

◆ setup()

def httpdomain.httpdomain.setup (   app)

Definition at line 762 of file httpdomain.py.

762def setup(app):
763 app.add_domain(HTTPDomain)
764
765 try:
766 get_lexer_by_name('http')
767 except ClassNotFound:
768 app.add_lexer('http', HTTPLexer())
769 app.add_config_value('http_index_ignore_prefixes', [], None)
770 app.add_config_value('http_index_shortname', 'routing table', True)
771 app.add_config_value('http_index_localname', 'HTTP Routing Table', True)
772 app.add_config_value('http_strict_mode', True, None)
773 app.add_config_value('http_headers_ignore_prefixes', ['X-'], None)

Variable Documentation

◆ _doctree_cache

dictionary httpdomain.httpdomain._doctree_cache = {}
private

Definition at line 36 of file httpdomain.py.

◆ METHOD_REFS

dictionary httpdomain.httpdomain.METHOD_REFS
Initial value:
1= {
2 'patch': IETFRef(5789, 2),
3 'options': IETFRef(7231, '4.3.7'),
4 'get': IETFRef(7231, '4.3.1'),
5 'head': IETFRef(7231, '4.3.2'),
6 'post': IETFRef(7231, '4.3.3'),
7 'put': IETFRef(7231, '4.3.4'),
8 'delete': IETFRef(7231, '4.3.5'),
9 'trace': IETFRef(7231, '4.3.8'),
10 'connect': IETFRef(7231, '4.3.6'),
11 'copy': IETFRef(2518, 8.8),
12 'any': ''
13}

Definition at line 89 of file httpdomain.py.

◆ HEADER_REFS

dictionary httpdomain.httpdomain.HEADER_REFS

Definition at line 106 of file httpdomain.py.

◆ HTTP_STATUS_CODES

dictionary httpdomain.httpdomain.HTTP_STATUS_CODES

Definition at line 179 of file httpdomain.py.

◆ WEBDAV_STATUS_CODES

list httpdomain.httpdomain.WEBDAV_STATUS_CODES = [207, 422, 423, 424, 507]

Definition at line 237 of file httpdomain.py.

◆ http_sig_param_re

httpdomain.httpdomain.http_sig_param_re
Initial value:
1= re.compile(r'\‍((?:(?P<type>[^:)]+):)?(?P<name>[\w_]+)\‍)',
2 re.VERBOSE)

Definition at line 239 of file httpdomain.py.