drivers

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BloomFilter added in v1.0.4

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

func NewBloomFilter added in v1.0.4

func NewBloomFilter(pool *RedisPool, name string) *BloomFilter

func (*BloomFilter) Add added in v1.0.4

func (ckft *BloomFilter) Add(name string, key string) (bool, error)

func (*BloomFilter) Exists added in v1.0.4

func (ckft *BloomFilter) Exists(name string, key string) (bool, error)

type Cache

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

func NewCache

func NewCache(redis *RedisPool) *Cache

func (*Cache) Clear

func (c *Cache) Clear(api string, params ...string) error

func (*Cache) Get

func (c *Cache) Get(api string, params ...string) (interface{}, error)

func (*Cache) Set

func (c *Cache) Set(api string, value interface{}, expire int, params ...string) error

type ElasticSearch

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

func NewElasticSearchClient

func NewElasticSearchClient(ctx context.Context, uri string, username string, password string) (*ElasticSearch, error)

func (*ElasticSearch) BoolQuery

func (es *ElasticSearch) BoolQuery() *elastic.BoolQuery

func (*ElasticSearch) CreateIndex

func (es *ElasticSearch) CreateIndex(ctx context.Context, name string, mapping string) error

func (*ElasticSearch) DeleteIndex

func (es *ElasticSearch) DeleteIndex(ctx context.Context, name string) error

func (*ElasticSearch) DoMultiSearch

func (*ElasticSearch) DoSearch

func (*ElasticSearch) InsertDocument

func (es *ElasticSearch) InsertDocument(ctx context.Context, index string, id string, object interface{}) error

func (*ElasticSearch) MultiSearch

func (es *ElasticSearch) MultiSearch() *elastic.MultiSearchService

func (*ElasticSearch) Query

func (es *ElasticSearch) Query(key string, val interface{}) *elastic.MatchQuery

func (*ElasticSearch) Search

func (es *ElasticSearch) Search(index string) *elastic.SearchService

func (*ElasticSearch) Suggest

func (es *ElasticSearch) Suggest(key string) *elastic.CompletionSuggester

func (*ElasticSearch) TermSuggest

func (es *ElasticSearch) TermSuggest(key string) *elastic.TermSuggester

func (*ElasticSearch) TermsQuery

func (es *ElasticSearch) TermsQuery(key string, val []string) *elastic.TermsQuery

type MongoDatabase

type MongoDatabase struct {
	Context context.Context
	Client  *mongo.Client
	DB      *mongo.Database
}

func NewMongoDatabase

func NewMongoDatabase(context context.Context, uri string, dbname string) (*MongoDatabase, error)

func (*MongoDatabase) Close

func (db *MongoDatabase) Close() error

func (*MongoDatabase) Collection

func (db *MongoDatabase) Collection(colname string) *mongo.Collection

func (*MongoDatabase) Session

func (db *MongoDatabase) Session() (mongo.Session, error)

type NearDB

type NearDB struct {
	Conn   *grpc.ClientConn
	Client pb.NearDBServiceClient
}

func NewNearDB

func NewNearDB(uri string) (*NearDB, error)

func (*NearDB) Add

func (near *NearDB) Add(ctx context.Context, id uint64, set []string, pop uint) error

func (*NearDB) Query

func (near *NearDB) Query(ctx context.Context, set []string, k int, drif float64) ([]*pb.Item, error)

func (*NearDB) QueryById added in v1.0.2

func (near *NearDB) QueryById(ctx context.Context, id uint64, k int, drif float64) ([]*pb.Item, error)

type RabbitMQ

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

func NewRabbitMQ

func NewRabbitMQ(uri string) (*RabbitMQ, error)

func (*RabbitMQ) Ack

func (mq *RabbitMQ) Ack(tag uint64) error

func (*RabbitMQ) Close

func (mq *RabbitMQ) Close()

func (*RabbitMQ) Consume

func (mq *RabbitMQ) Consume(name string) (<-chan models.MQMessage, error)

func (*RabbitMQ) ExchangeDeclare

func (mq *RabbitMQ) ExchangeDeclare(name string, kind string) error

func (*RabbitMQ) Publish

func (mq *RabbitMQ) Publish(name string, message models.MQMessage) error

func (*RabbitMQ) PublishToExchange

func (mq *RabbitMQ) PublishToExchange(name string, message models.MQMessage) error

func (*RabbitMQ) QueueBindExchange

func (mq *RabbitMQ) QueueBindExchange(name, key, exchange string)

func (*RabbitMQ) QueueDeclare

func (mq *RabbitMQ) QueueDeclare(name string) (amqp.Queue, error)

func (*RabbitMQ) Reject

func (mq *RabbitMQ) Reject(tag uint64) error

func (*RabbitMQ) SetQos

func (mq *RabbitMQ) SetQos(prefetchCount int, prefetchSize int, global bool) error

type RedisClient

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

func NewRedisClient

func NewRedisClient(redisURL string) (*RedisClient, error)

func (*RedisClient) ClearDB

func (red *RedisClient) ClearDB() error

func (*RedisClient) Close

func (red *RedisClient) Close()

func (*RedisClient) Decrease

func (red *RedisClient) Decrease(key string) (int, error)

func (*RedisClient) DecreaseBy

func (red *RedisClient) DecreaseBy(key string, num uint) (int, error)

func (*RedisClient) DeleteValue

func (red *RedisClient) DeleteValue(key string) error

func (*RedisClient) GetExpire

func (red *RedisClient) GetExpire(key string) (string, error)

func (*RedisClient) GetValue

func (red *RedisClient) GetValue(key string) (string, error)

func (*RedisClient) GetValueBytes

func (red *RedisClient) GetValueBytes(key string) ([]byte, error)

func (*RedisClient) Increase

func (red *RedisClient) Increase(key string) (int, error)

func (*RedisClient) IncreaseBy

func (red *RedisClient) IncreaseBy(key string, num uint) (int, error)

func (*RedisClient) IsError

func (red *RedisClient) IsError(err error) bool

func (*RedisClient) IsExist

func (red *RedisClient) IsExist(err error) bool

func (*RedisClient) KeyExist

func (red *RedisClient) KeyExist(key string) (bool, error)

func (*RedisClient) Publish

func (red *RedisClient) Publish(key string, message string) error

func (*RedisClient) SetExpire

func (red *RedisClient) SetExpire(key string, exp string) error

func (*RedisClient) SetValue

func (red *RedisClient) SetValue(key string, value string) error

func (*RedisClient) SetValueBytes

func (red *RedisClient) SetValueBytes(key string, value []byte) error

func (*RedisClient) SetValueBytesExpire

func (red *RedisClient) SetValueBytesExpire(key string, value []byte, exp int) error

func (*RedisClient) SetValueExpire

func (red *RedisClient) SetValueExpire(key string, value string, exp int) error

func (*RedisClient) Subscribe

func (red *RedisClient) Subscribe(ctx context.Context, key string) (chan string, error)

type RedisPool

type RedisPool struct {
	RedisPool *redis.Pool
}

func NewRedisPool

func NewRedisPool(redisURL string) *RedisPool

func (*RedisPool) NewBloomFilter added in v1.0.4

func (red *RedisPool) NewBloomFilter(name string) *BloomFilter

func (*RedisPool) NewRedisClient

func (red *RedisPool) NewRedisClient() *RedisClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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