@stoqey/sofa
Version:
Couchbase utilities
37 lines (36 loc) • 877 B
TypeScript
import { Collection, Cluster, Bucket } from 'couchbase';
export interface SofaArgs {
connectionString: string;
bucketName: string;
username: string;
password: string;
}
/**
* SofaConnection class
* Only one SofaConnection can exist that's why it's a singleton
*/
export declare class SofaConnection implements SofaArgs {
private static _instance;
bucket: Bucket;
cluster: Cluster;
connectionString: string;
bucketName: string;
username: string;
password: string;
static get Instance(): SofaConnection;
private constructor();
/**
* start
*/
init: (args: SofaArgs) => Promise<SofaConnection>;
/**
* getCollection
*/
getCollection: () => Collection;
getCluster: () => Cluster;
/**
* shutdown cluster
*/
shutdown: () => Promise<void>;
}
export default SofaConnection;