cache

package
v0.0.0-...-8b292c0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis is a struct that represents (and is a proxy for) a Redis Cluster. This objectis a wrpaeer around the github.com/go-redis/redis library and implements the DataSource interface

func NewRedis

func NewRedis(dsConfig dataaccess.DataSourceConfiguration) (*Redis, error)

NewRedis creates and returns a reference to a new Redis instance

func (*Redis) DeleteBulk

func (redis *Redis) DeleteBulk(documents []dataaccess.Document) (interface{}, error)

DeleteBulk removes/deletes the passed in slice of documkents from the datastore and returns the slice of deleted objects. Otherwise an error is returned.

func (*Redis) DeleteItem

func (redis *Redis) DeleteItem(attributeName string, attributeValue interface{}) (interface{}, error)

DeleteItem removes/deletes the passed in document from the datastore and returns the deleted object. Otherwise an error is returned.

func (*Redis) Exists

func (redis *Redis) Exists(document dataaccess.Document) (bool, error)

Exists simply checks if a document exists in the configured index and returns a boolean indicating whether the doc exists. Otherwise an error is returned.

func (*Redis) Get

func (redis *Redis) Get(query dataaccess.Query) ([]dataaccess.Document, error)

Get retrieves all of the records that are contained in the query parameter

func (*Redis) GetAll

func (redis *Redis) GetAll() ([]dataaccess.Document, error)

GetAll retrieves all records from the given table, index, etc... Otherwise an error is returned.

func (*Redis) GetItem

func (redis *Redis) GetItem(attributeName string, attributeValue interface{}) (dataaccess.Document, error)

GetItem executes a query to return a single item based on the attribue name and value. Otherwise an error is returned. For Redis the attributeName is ignored

func (*Redis) GetList

func (redis *Redis) GetList(attributeName string, attributeValue interface{}) ([]dataaccess.Document, error)

GetList executes a query to return a list of Documents based on the attribute name and value. Otherwise an error is returned.

func (*Redis) SaveBulk

func (redis *Redis) SaveBulk(documents []dataaccess.Document) (interface{}, error)

SaveBulk saves the slice of documents passed and returns the list of document ids. Otherwise an error is returned.

func (*Redis) SaveItem

func (redis *Redis) SaveItem(document dataaccess.Document, allowUpdate bool) (interface{}, error)

SaveItem saves the passed in docuemnt and returns the object id. Otherwise an error is returned.

func (*Redis) SetUnmarshalFn

func (redis *Redis) SetUnmarshalFn(unmarshal dataaccess.UnmarshalFn)

SetUnmarshalFn sets the object specific logic to unmarshal the Elasticsearch objects to their respective object respresentation

func (*Redis) UpdateBulk

func (redis *Redis) UpdateBulk(documents []dataaccess.Document) (interface{}, error)

UpdateBulk updates the slice of documents passed in and returns a slice of document ids. Otherwise an error is returned.

func (*Redis) UpdateItem

func (redis *Redis) UpdateItem(document dataaccess.Document, replace bool) (interface{}, error)

UpdateItem updates the existing document passed and returns the document id. Otherwise an error is returned.

type RedisDatabaseConfiguration

type RedisDatabaseConfiguration struct {
	Password        string `json:"password" mapstructure:"password" secure:"encrypt"`
	TTLDurationUnit string `json:"ttldurationunit" mapstructure:"ttldurationunit"`
	TTLDuration     int    `json:"ttlduration" mapstructur:"ttlduration"`
	Database        int    `json:"database" mapstructure:"database"`
}

RedisDatabaseConfiguration holds all of the information needed to define a Redis database and provides the optimal configuration parameters for the database

Jump to

Keyboard shortcuts

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