Skip to content

Low-level Rust client for the Couchbase DCP protocol

License

Notifications You must be signed in to change notification settings

erayarslan/dcp-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dcp-rs

This repository contains Rust implementation of a Couchbase Database Change Protocol (DCP)

Contents

Example

use dcp_rs::{Config, Dcp, DcpConfig, GroupConfig};

fn main() -> Result<(), std::io::Error> {
    let config = Config {
        hosts: vec!["localhost:11210".to_string()],
        username: "user".to_string(),
        password: "123456".to_string(),
        bucket: "dcp-test".to_string(),
        scope_name: "_default".to_string(),
        collection_names: vec!["_default".to_string()],
        dcp: DcpConfig {
            group: GroupConfig {
                name: "group_name".to_string(),
            },
        },
    };

    let dcp = Dcp::new(config)?;
    dcp.add_listener(Box::new(|event| {
        println!("event: {}", event);

        Ok(())
    }));
    dcp.start()?;

    return Ok(());
}

About

Low-level Rust client for the Couchbase DCP protocol

Resources

License

Stars

Watchers

Forks