Skip to content
Snippets Groups Projects
  • mechanik20051988's avatar
    4d10e252
    box: implement ability to pass several URIs in different ways · 4d10e252
    mechanik20051988 authored
    Previously, for "listen" and "replication" options URI can be passed
    as a number, as a string value or as a table, which contains numbers
    and strings, no special properties for URIs was available. Now user
    can pass URIs in different ways, same as in tarantool "uri" library:
    as before, as a table which contains URI and it's parameters in "param"
    table, as a table which contains URI strings and URI tables. Same
    as in "uri" library, which internally used to parse new "listen" and
    "replication" there are different ways to specify properties for URI:
    in a string which contains URI, after '?' delimiter, in a table which
    contains URI in "params" table, in "default_params" table if it is
    default parameters for all URIs.
    
    Closes #5928
    
    @TarantoolBot document
    Title: implement ability to pass several URIs in different ways
    Now there are several ways to pass multiple URIs for box.cfg.listen
    and box.cfg.replication:
    ```lua
    -- As a string with one or several URIs separated by commas
    -- (provides backward compatibility):
    box.cfg { listen = "127.0.0.1:3301, /unix.sock, 3302" }
    -- As an array which contains string URIs (unambiguous short form):
    box.cfg { listen = {"127.0.0.1:3301", "/unix.sock", "3302"} }
    -- As an array of tables with 'uri' field
    -- (may be extended with more fields in future):
    box.cfg {  listen = {
            {uri = "127.0.0.1:3301"},
            {uri = "/unix.sock"},
            {uri = 3302}
        }
    }
    ```
    4d10e252
    History
    box: implement ability to pass several URIs in different ways
    mechanik20051988 authored
    Previously, for "listen" and "replication" options URI can be passed
    as a number, as a string value or as a table, which contains numbers
    and strings, no special properties for URIs was available. Now user
    can pass URIs in different ways, same as in tarantool "uri" library:
    as before, as a table which contains URI and it's parameters in "param"
    table, as a table which contains URI strings and URI tables. Same
    as in "uri" library, which internally used to parse new "listen" and
    "replication" there are different ways to specify properties for URI:
    in a string which contains URI, after '?' delimiter, in a table which
    contains URI in "params" table, in "default_params" table if it is
    default parameters for all URIs.
    
    Closes #5928
    
    @TarantoolBot document
    Title: implement ability to pass several URIs in different ways
    Now there are several ways to pass multiple URIs for box.cfg.listen
    and box.cfg.replication:
    ```lua
    -- As a string with one or several URIs separated by commas
    -- (provides backward compatibility):
    box.cfg { listen = "127.0.0.1:3301, /unix.sock, 3302" }
    -- As an array which contains string URIs (unambiguous short form):
    box.cfg { listen = {"127.0.0.1:3301", "/unix.sock", "3302"} }
    -- As an array of tables with 'uri' field
    -- (may be extended with more fields in future):
    box.cfg {  listen = {
            {uri = "127.0.0.1:3301"},
            {uri = "/unix.sock"},
            {uri = 3302}
        }
    }
    ```