function _M.fromSW8Value()

in lib/skywalking/correlation_context.lua [33:61]


function _M.fromSW8Value(value)
    local context = _M.new()

    if value == nil or #value == 0 then
        return context
    end

    local data = Util.split(value, ',')
    if #data == 0 then
        return context
    end

    for i, per_data in ipairs(data)
    do
        if #data > ELEMENT_MAX_NUMBER then
            return context
        end

        local parts = Util.split(per_data, ':')
        if #parts == 2 then
            local key = decode_base64(parts[1])
            local value = decode_base64(parts[2])

            context[key] = value
        end
    end

    return context
end