Skip to content

Error connecting to Redis #19

@GavinHaydy

Description

@GavinHaydy

env:

zig version = 0.14.1
okredis = master

zig.zon

.okredis = .{
            .url = "https://github.com/kristoff-it/zig-okredis/archive/refs/heads/master.tar.gz",
            .hash = "okredis-0.1.0-Cg726vcEBAAjrhwgBJ2cjL4qN3ircjBsX6iTd7wEFiEC",
        },

code

const redis_password = "test123456";

    const addr = try std.net.Address.parseIp4("127.0.0.1", 6380);
    const connection = try std.net.tcpConnectToAddress(addr);

    var rbuf: [1024]u8 = undefined;
    var wbuf: [1024]u8 = undefined;

    var client = try Client.init(connection, .{
        .auth = .{
            .user = "",
            .pass = redis_password
        },
       .reader_buffer = &rbuf,
        .writer_buffer = &wbuf,
    });
    defer client.close();

error:

/home/gavinhaydy/.cache/zig/p/okredis-0.1.0-Cg726vcEBAAjrhwgBJ2cjL4qN3ircjBsX6iTd7wEFiEC/src/client.zig:34:23: error: member function expected 0 argument(s), found 1
        .reader = conn.reader(options.reader_buffer),
                  ~~~~^~~~~~~
/home/gavinhaydy/tools/zig/lib/std/net.zig:1851:9: note: function declared here
    pub fn reader(self: Stream) Reader {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions