Documentation ¶
Index ¶
- Constants
- Variables
- type DB
- func (db *DB) Count(ctx context.Context, statement string, args map[string]interface{}, val *int) error
- func (db *DB) Create(ctx context.Context, key string, val interface{}) error
- func (db *DB) Delete(ctx context.Context, key string) error
- func (db *DB) Exists(ctx context.Context, key string, docExists *bool) error
- func (db *DB) Get(ctx context.Context, key string, model interface{}) error
- func (db *DB) Lookup(ctx context.Context, key string, paths []string, val interface{}) error
- func (db *DB) Patch(ctx context.Context, key string, path string, val interface{}) error
- func (db *DB) PrepareQueries(filePath, bucketName string) error
- func (db *DB) Query(ctx context.Context, statement string, args map[string]interface{}, ...) error
- func (db *DB) Update(ctx context.Context, key string, val interface{}) error
Constants ¶
View Source
const ( ActionFollow n1qlQuery = iota ActionLike ActionSubmit ActionUnfollow ActionUnlike AnoUserActivities AnoUserComments AnoUserFollowers AnoUserFollowing AnoUserLikes AnoUserSubmissions BehaviorReport CountAnoUserActivities CountStrings CountStringsWithSubstring CountUserActivities DeleteActivity FileComments FileStrings FileStringsWithSubstring FileSummary GetAllDocType MetaUI UserActivities UserComments UserFollowers UserFollowing UserLikes UserSubmissions )
Variables ¶
View Source
var ( // ErrDocumentNotFound is returned when the doc does not exist in the DB. ErrDocumentNotFound = errors.New("document not found") ErrSubDocNotFound = gocb.ErrPathNotFound )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { Bucket *gocb.Bucket Cluster *gocb.Cluster Collection *gocb.Collection N1QLQuery map[n1qlQuery]string }
DB represents the database connection.
func (*DB) Count ¶
func (db *DB) Count(ctx context.Context, statement string, args map[string]interface{}, val *int) error
Count retrieves the total number of documents.
func (*DB) Patch ¶
Patch performs a sub document in the collection. Sub documents operations may be quicker and more network-efficient than full-document operations.
func (*DB) PrepareQueries ¶
PrepareQueries iterate over the list of n1ql files and load them to memory.
Click to show internal directories.
Click to hide internal directories.