noSql

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASRow added in v0.0.6

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

func (*ASRow) Scan added in v0.0.6

func (t *ASRow) Scan(dest any) error

type ASRows added in v0.0.6

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

func (*ASRows) Close added in v0.0.6

func (t *ASRows) Close() error

func (*ASRows) Next added in v0.0.6

func (t *ASRows) Next() bool

func (*ASRows) Scan added in v0.0.6

func (t *ASRows) Scan(dest any) error

type Aerospike

type Aerospike struct {
	Name   string
	Config AerospikeConfig
	// contains filtered or unexported fields
}

func NewAerospike added in v0.0.9

func NewAerospike(name string, cfg AerospikeConfig) *Aerospike

func (*Aerospike) Count

func (t *Aerospike) Count(ctx context.Context, key *aerospike.Key, policy *aerospike.BasePolicy) int64

func (*Aerospike) Delete

func (t *Aerospike) Delete(ctx context.Context, key *aerospike.Key, policy *aerospike.WritePolicy) int64

func (*Aerospike) DeleteMany added in v0.4.0

func (t *Aerospike) DeleteMany(ctx context.Context, keys []*aerospike.Key, policy *aerospike.BatchPolicy, policyDelete *aerospike.BatchDeletePolicy) int64

func (*Aerospike) Exec

func (t *Aerospike) Exec(ctx context.Context, key *aerospike.Key, policy *aerospike.WritePolicy, packageName string, functionName string) (interfaces.NoSQLRows, error)

func (*Aerospike) Exists

func (t *Aerospike) Exists(ctx context.Context, key *aerospike.Key, policy *aerospike.BasePolicy) bool

func (*Aerospike) Find

func (*Aerospike) FindOne

func (t *Aerospike) FindOne(ctx context.Context, key *aerospike.Key, policy *aerospike.BasePolicy, bins []string) (interfaces.NoSQLRow, error)

func (*Aerospike) GetDb

func (t *Aerospike) GetDb() *aerospike.Client

func (*Aerospike) Init

func (t *Aerospike) Init(app interfaces.IEngine) error

func (*Aerospike) Insert

func (t *Aerospike) Insert(ctx context.Context, key *aerospike.Key, query interface{}, policy *aerospike.WritePolicy) (interface{}, error)

Insert query is *aerospike.Bin or []*aerospike.Bin or *aerospike.BinMap

func (*Aerospike) Operate added in v0.4.0

func (t *Aerospike) Operate(ctx context.Context, query []aerospike.BatchRecordIfc) (int64, error)

func (*Aerospike) Stop

func (t *Aerospike) Stop() error

func (*Aerospike) String

func (t *Aerospike) String() string

type AerospikeConfig added in v0.0.9

type AerospikeConfig struct {
	User     string `yaml:"user,omitempty"`
	Password string `yaml:"password,omitempty"`
	Hosts    string `yaml:"hosts"`
}

type MockAerospike added in v0.4.0

type MockAerospike struct {
	Name string
}

func (*MockAerospike) Count added in v0.4.0

func (t *MockAerospike) Count(ctx context.Context, key *aerospike.Key, policy *aerospike.BasePolicy) int64

func (*MockAerospike) Delete added in v0.4.0

func (t *MockAerospike) Delete(ctx context.Context, key *aerospike.Key, policy *aerospike.WritePolicy) int64

func (*MockAerospike) DeleteMany added in v0.4.0

func (t *MockAerospike) DeleteMany(ctx context.Context, keys []*aerospike.Key, policy *aerospike.BatchPolicy, policyDelete *aerospike.BatchDeletePolicy) int64

func (*MockAerospike) Exec added in v0.4.0

func (t *MockAerospike) Exec(ctx context.Context, key *aerospike.Key, policy *aerospike.WritePolicy, packageName string, functionName string) (interfaces.NoSQLRows, error)

func (*MockAerospike) Exists added in v0.4.0

func (t *MockAerospike) Exists(ctx context.Context, key *aerospike.Key, policy *aerospike.BasePolicy) bool

func (*MockAerospike) Find added in v0.4.0

func (*MockAerospike) FindOne added in v0.4.0

func (t *MockAerospike) FindOne(ctx context.Context, key *aerospike.Key, policy *aerospike.BasePolicy, bins []string) (interfaces.NoSQLRow, error)

func (*MockAerospike) GetDb added in v0.4.0

func (t *MockAerospike) GetDb() *aerospike.Client

func (*MockAerospike) Insert added in v0.4.0

func (t *MockAerospike) Insert(ctx context.Context, key *aerospike.Key, query interface{}, policy *aerospike.WritePolicy) (interface{}, error)

Insert query is *aerospike.Bin or []*aerospike.Bin or *aerospike.BinMap

func (*MockAerospike) Operate added in v0.4.0

func (t *MockAerospike) Operate(ctx context.Context, query []aerospike.BatchRecordIfc) (int64, error)

type MockMongoDB added in v0.4.0

type MockMongoDB struct {
	Name string
}

func (*MockMongoDB) Batch added in v0.4.0

func (t *MockMongoDB) Batch(ctx context.Context, collection string, query []mongo.WriteModel, opt *options.BulkWriteOptions) (int64, error)

func (*MockMongoDB) Count added in v0.4.0

func (t *MockMongoDB) Count(ctx context.Context, collection string, query interface{}, opt *options.CountOptions) int64

func (*MockMongoDB) Delete added in v0.4.0

func (t *MockMongoDB) Delete(ctx context.Context, collection string, query interface{}, opt *options.DeleteOptions) int64

func (*MockMongoDB) Exec added in v0.4.0

func (t *MockMongoDB) Exec(ctx context.Context, collection string, query interface{}, opt *options.AggregateOptions) (interfaces.NoSQLRows, error)

func (*MockMongoDB) Exists added in v0.4.0

func (t *MockMongoDB) Exists(ctx context.Context, collection string, query interface{}) bool

func (*MockMongoDB) Find added in v0.4.0

func (t *MockMongoDB) Find(ctx context.Context, collection string, query interface{}, opt *options.FindOptions) (interfaces.NoSQLRows, error)

func (*MockMongoDB) FindOne added in v0.4.0

func (t *MockMongoDB) FindOne(ctx context.Context, collection string, query interface{}, opt *options.FindOneOptions) (interfaces.NoSQLRow, error)

func (*MockMongoDB) FindOneAndUpdate added in v0.4.2

func (t *MockMongoDB) FindOneAndUpdate(ctx context.Context, collection string, query interface{}, update interface{}, opt *options.FindOneAndUpdateOptions) (interfaces.NoSQLRow, error)

func (*MockMongoDB) GetDb added in v0.4.0

func (t *MockMongoDB) GetDb() *mongo.Database

func (*MockMongoDB) Insert added in v0.4.0

func (t *MockMongoDB) Insert(ctx context.Context, collection string, query interface{}, opt *options.InsertOneOptions) (interface{}, error)

func (*MockMongoDB) Update added in v0.4.0

func (t *MockMongoDB) Update(ctx context.Context, collection string, query interface{}, update interface{}, opt *options.UpdateOptions) error

type MongoDB

type MongoDB struct {
	Name   string
	Config MongoDBConfig
	// contains filtered or unexported fields
}

func NewMongoDB added in v0.0.9

func NewMongoDB(name string, cfg MongoDBConfig) *MongoDB

func (*MongoDB) Batch

func (t *MongoDB) Batch(ctx context.Context, collection string, query []mongo.WriteModel, opt *options.BulkWriteOptions) (int64, error)

func (*MongoDB) Count

func (t *MongoDB) Count(ctx context.Context, collection string, query interface{}, opt *options.CountOptions) int64

func (*MongoDB) Delete

func (t *MongoDB) Delete(ctx context.Context, collection string, query interface{}, opt *options.DeleteOptions) int64

func (*MongoDB) Exec

func (t *MongoDB) Exec(ctx context.Context, collection string, query interface{}, opt *options.AggregateOptions) (interfaces.NoSQLRows, error)

func (*MongoDB) Exists

func (t *MongoDB) Exists(ctx context.Context, collection string, query interface{}) bool

func (*MongoDB) Find

func (t *MongoDB) Find(ctx context.Context, collection string, query interface{}, opt *options.FindOptions) (interfaces.NoSQLRows, error)

func (*MongoDB) FindOne

func (t *MongoDB) FindOne(ctx context.Context, collection string, query interface{}, opt *options.FindOneOptions) (interfaces.NoSQLRow, error)

func (*MongoDB) FindOneAndUpdate added in v0.4.2

func (t *MongoDB) FindOneAndUpdate(ctx context.Context, collection string, query interface{}, update interface{}, opt *options.FindOneAndUpdateOptions) (interfaces.NoSQLRow, error)

func (*MongoDB) GetDb

func (t *MongoDB) GetDb() *mongo.Database

func (*MongoDB) Init

func (t *MongoDB) Init(app interfaces.IEngine) error

func (*MongoDB) Insert

func (t *MongoDB) Insert(ctx context.Context, collection string, query interface{}, opt *options.InsertOneOptions) (interface{}, error)

func (*MongoDB) Stop

func (t *MongoDB) Stop() error

func (*MongoDB) String

func (t *MongoDB) String() string

func (*MongoDB) Update

func (t *MongoDB) Update(ctx context.Context, collection string, query interface{}, update interface{}, opt *options.UpdateOptions) error

type MongoDBConfig added in v0.0.9

type MongoDBConfig struct {
	Database string        `yaml:"database"`
	User     string        `yaml:"user,omitempty"`
	Password string        `yaml:"password,omitempty"`
	Hosts    string        `yaml:"hosts,omitempty"`
	Mode     readpref.Mode `yaml:"mode,omitempty"`
	URI      string        `yaml:"uri,omitempty"`
}

type MongoRow added in v0.0.6

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

func (*MongoRow) Scan added in v0.0.6

func (t *MongoRow) Scan(dest any) error

type MongoRows added in v0.0.6

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

func (*MongoRows) Close added in v0.0.6

func (t *MongoRows) Close() error

func (*MongoRows) Next added in v0.0.6

func (t *MongoRows) Next() bool

func (*MongoRows) Scan added in v0.0.6

func (t *MongoRows) Scan(dest any) error

Jump to

Keyboard shortcuts

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