Skip to content

Commit ada93a4

Browse files
committed
update developer api documentation for strategies
1 parent 4d54c1a commit ada93a4

File tree

5 files changed

+168
-8
lines changed

5 files changed

+168
-8
lines changed

doc/developer-guide/api/functions/TSHttpTxnNextHopNamedStrategyGet.en.rst renamed to doc/developer-guide/api/functions/TSHttpTxnNextHopStrategyFind.en.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
.. default-domain:: cpp
2020

21-
TSHttpTxnNextHopNamedStrategyGet
22-
********************************
21+
TSHttpTxnNextHopStrategyFind
22+
****************************
2323

2424
Synopsis
2525
========
@@ -28,7 +28,7 @@ Synopsis
2828
2929
#include <ts/ts.h>
3030
31-
.. function:: void const* TSHttpTxnNextHopNamedStrategyGet(TSHttpTxn txnp, const char *name)
31+
.. function:: void const* TSHttpTxnNextHopStrategyFind(TSHttpTxn txnp, const char *name)
3232

3333
Description
3434
===========

doc/developer-guide/api/functions/TSHttpNextHopStrategyNameGet.en.rst renamed to doc/developer-guide/api/functions/TSNextHopStrategyNameGet.en.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
.. default-domain:: cpp
2020

21-
TSHttpNextHopStrategyNameGet
22-
****************************
21+
TSNextHopStrategyNameGet
22+
************************
2323

2424
Synopsis
2525
========
@@ -28,13 +28,13 @@ Synopsis
2828
2929
#include <ts/ts.h>
3030
31-
.. function:: char const* TSHttpNextHopStrategyNameGet(void const* strategy)
31+
.. function:: char const* TSNextHopStrategyNameGet(void const* strategy)
3232

3333
Description
3434
===========
3535

36-
Gets the name associated with the provided strategy.
37-
This may be nullptr indicating that parent.config is in use.
36+
Gets the name associated with the provided strategy pointer.
37+
This may be nullptr which indicates that parent.config is in use.
3838

3939
.. note::
4040

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.. Licensed to the Apache Software Foundation (ASF) under one or more
2+
contributor license agreements. See the NOTICE file distributed
3+
with this work for additional information regarding copyright
4+
ownership. The ASF licenses this file to you under the Apache
5+
License, Version 2.0 (the "License"); you may not use this file
6+
except in compliance with the License. You may obtain a copy of
7+
the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14+
implied. See the License for the specific language governing
15+
permissions and limitations under the License.
16+
17+
.. include:: ../../../common.defs
18+
19+
.. default-domain:: cpp
20+
21+
TSRemapNextHopStrategyFind
22+
**************************
23+
24+
Synopsis
25+
========
26+
27+
.. code-block:: cpp
28+
29+
#include <ts/ts.h>
30+
31+
.. function:: void const* TSRemapNextHopStrategyFind(const char *name)
32+
33+
Description
34+
===========
35+
36+
Gets a pointer to the specified :arg:`name` NextHopSelectionStrategy.
37+
This may be nullptr indicating that no strategy exists with the given name.
38+
39+
This function may ONLY be called during TSRemapNewInstance.
40+
The resulting strategy pointer is valid for all subsequent transactions.
41+
42+
.. note::
43+
44+
This returned pointer must not be freed and the contents must not
45+
be changed.
46+
Strategy pointers held by plugins will become invalid when ATS
47+
configs are reloaded and should be reset with :func:`TSRemapNewInstance`
48+
49+
See Also
50+
========
51+
52+
:func:`TSRemapNextHopStrategySet`
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.. Licensed to the Apache Software Foundation (ASF) under one or more
2+
contributor license agreements. See the NOTICE file distributed
3+
with this work for additional information regarding copyright
4+
ownership. The ASF licenses this file to you under the Apache
5+
License, Version 2.0 (the "License"); you may not use this file
6+
except in compliance with the License. You may obtain a copy of
7+
the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14+
implied. See the License for the specific language governing
15+
permissions and limitations under the License.
16+
17+
.. include:: ../../../common.defs
18+
19+
.. default-domain:: cpp
20+
21+
TSRemapNextHopStrategyGet
22+
*************************
23+
24+
Synopsis
25+
========
26+
27+
.. code-block:: cpp
28+
29+
#include <ts/ts.h>
30+
31+
.. function:: void const* TSRemapNextHopStrategyGet()
32+
33+
Description
34+
===========
35+
36+
Gets a pointer to the current remap rule being loaded.
37+
This may be nullptr indicating that parent.config is in use.
38+
39+
This function may ONLY be called during TSRemapNewInstance.
40+
The resulting strategy pointer is valid for all subsequent transactions.
41+
42+
.. note::
43+
44+
This strategy pointer must not be freed and the contents must not
45+
be changed.
46+
Strategy pointers held by plugins will become invalid when ATS
47+
configs are reloaded and should be reset with :func:`TSRemapNewInstance`
48+
49+
See Also
50+
========
51+
52+
:func:`TSRemapNextHopStrategySet`
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.. Licensed to the Apache Software Foundation (ASF) under one or more
2+
contributor license agreements. See the NOTICE file distributed
3+
with this work for additional information regarding copyright
4+
ownership. The ASF licenses this file to you under the Apache
5+
License, Version 2.0 (the "License"); you may not use this file
6+
except in compliance with the License. You may obtain a copy of
7+
the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14+
implied. See the License for the specific language governing
15+
permissions and limitations under the License.
16+
17+
.. include:: ../../../common.defs
18+
19+
.. default-domain:: cpp
20+
21+
TSRemapNextHopNameGet
22+
***********************
23+
24+
Synopsis
25+
========
26+
27+
.. code-block:: cpp
28+
29+
#include <ts/ts.h>
30+
31+
.. function:: void TSRemapNextHopStrategySet(void const* strategy)
32+
33+
Description
34+
===========
35+
36+
Sets the next hop strategy for the currently loading remap rule.
37+
This :arg:`strategy` pointer must be a valid strategy and can be
38+
nullptr to indicate that parent.config will be used instead.
39+
40+
Plugins can get a strategy by name by calling
41+
:func:`TSRemapNextHopStrategyGet` to get the current transaction's active
42+
strategy or :func:`TSRemapNextHopStrategyFind` to look up a strategy by
43+
name using the loading remap rule's pointer to the NextHopStrategyFactory
44+
strategy database.
45+
46+
.. note::
47+
48+
This strategy pointer must not be freed and the contents must not
49+
be changed.
50+
Strategy pointers held by plugins will become invalid when ATS
51+
configs are reloaded and should be reset with :func:`TSRemapNewInstance`
52+
53+
See Also
54+
========
55+
56+
:func:`TSRemapNextHopStrategyGet`, :func:`TSRemapNextHopStrategyFind`.

0 commit comments

Comments
 (0)