doc

package
v1.7.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StoreURL string // used such as a MongoDB connection string (example: mongodb+srv://.../dbName)
	Database string // which database to connect to
}

Config holds configuration details for connecting to a document database.

func NewConfig

func NewConfig(storeURL, db string) *Config

func (*Config) WithDatabse added in v1.6.6

func (c *Config) WithDatabse(db string) *Config

WithDatabse sets a new document databse and returns the updated Config.

func (*Config) WithStoreURL

func (c *Config) WithStoreURL(url string) *Config

WithStoreURL sets a new document store URL and returns the updated Config.

type FileStoreClient added in v1.6.17

type FileStoreClient struct {
	// contains filtered or unexported fields
}

func NewFileStoreClient added in v1.6.17

func NewFileStoreClient(cfg *Config) *FileStoreClient

func (*FileStoreClient) Count added in v1.6.17

func (f *FileStoreClient) Count(
	ctx context.Context,
	coll string,
	filter any,
) (int64, error)

func (*FileStoreClient) Delete added in v1.6.17

func (f *FileStoreClient) Delete(
	ctx context.Context,
	coll string,
	filter any,
) (int64, error)

func (*FileStoreClient) Find added in v1.6.17

func (f *FileStoreClient) Find(
	ctx context.Context,
	coll string,
	filter any,
	results any,
) error

func (*FileStoreClient) FindWithOpts added in v1.6.17

func (f *FileStoreClient) FindWithOpts(
	ctx context.Context,
	coll string,
	filter any,
	results any,
	opts *FindOptions,
) error

func (*FileStoreClient) Insert added in v1.6.17

func (f *FileStoreClient) Insert(
	ctx context.Context,
	coll string,
	docs ...any,
) (any, error)

func (*FileStoreClient) Update added in v1.6.17

func (f *FileStoreClient) Update(
	ctx context.Context,
	coll string,
	filter any,
	update any,
) (int64, error)

type FindOptions added in v1.6.17

type FindOptions struct {
	Skip  int64
	Limit int64
}

type MongoStoreClient added in v1.6.6

type MongoStoreClient struct {
	// contains filtered or unexported fields
}

func NewMongoStoreClient added in v1.6.6

func NewMongoStoreClient(cfg *Config) (*MongoStoreClient, error)

func (*MongoStoreClient) Count added in v1.6.6

func (m *MongoStoreClient) Count(ctx context.Context, coll string, filter interface{}) (int64, error)

func (*MongoStoreClient) Delete added in v1.6.6

func (m *MongoStoreClient) Delete(ctx context.Context, coll string, filter interface{}) (int64, error)

func (*MongoStoreClient) Find added in v1.6.6

func (m *MongoStoreClient) Find(ctx context.Context, coll string, filter interface{}, results interface{}) error

func (*MongoStoreClient) FindWithOpts added in v1.6.17

func (m *MongoStoreClient) FindWithOpts(
	ctx context.Context,
	coll string,
	filter interface{},
	results interface{},
	o *FindOptions,
) error

func (*MongoStoreClient) Insert added in v1.6.6

func (m *MongoStoreClient) Insert(ctx context.Context, coll string, docs ...interface{}) (interface{}, error)

func (*MongoStoreClient) Update added in v1.6.6

func (m *MongoStoreClient) Update(ctx context.Context, coll string, filter interface{}, update interface{}) (int64, error)

type Storer added in v1.6.6

type Storer interface {
	Insert(ctx context.Context, coll string, docs ...interface{}) (interface{}, error)
	Update(ctx context.Context, coll string, filter interface{}, update interface{}) (int64, error)
	Delete(ctx context.Context, coll string, filter interface{}) (int64, error)

	Find(ctx context.Context, coll string, filter interface{}, results interface{}) error
	FindWithOpts(ctx context.Context, coll string, filter interface{}, results interface{}, opts *FindOptions) error
	Count(ctx context.Context, coll string, filter interface{}) (int64, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL