Documentation
¶
Index ¶
- type Dynamo
- func (d *Dynamo[T]) Delete(hash string) (T, error)
- func (d *Dynamo[T]) Get(hash string) (T, error)
- func (d *Dynamo[T]) Put(item T) error
- func (d *Dynamo[T]) QueryBy(parameter string, queryBy interface{}, indexName string, filter FilterData, ...) ([]T, error)
- func (d *Dynamo[T]) Scan(query string, valuesToFilter []interface{}) ([]T, error)
- type FilterData
- type RangeData
- type StorableDynamo
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dynamo ¶
type Dynamo[T StorableDynamo] struct { // contains filtered or unexported fields }
func CreateDynamoTable ¶
func CreateDynamoTable[T StorableDynamo](tableName string, db *dynamo.DB) (Dynamo[T], error)
func (*Dynamo[T]) QueryBy ¶
func (d *Dynamo[T]) QueryBy(parameter string, queryBy interface{}, indexName string, filter FilterData, rangeData *RangeData, asc *bool, limit int) ([]T, error)
QueryBy used to get multiple results of a query, if error then something happened with dynamo. If found none value, then empty array is returned parameter: The id from which you want to start fetching, this is thought as a method which will always have a parameter and a value to search by queryBy: The value of previous parameter indexName: the name of the index to look for, if empty normal index used filter: a filter if necessary, this has to be a query, for example "'someValue' > ?" and the ? will be replaced for the values in filterValues rangeData
type FilterData ¶ added in v0.3.0
type FilterData struct { FilterQuery string FilterValues []interface{} }
type RangeData ¶ added in v0.3.0
type RangeData struct { RangeName string RangeValue []interface{} Operator dynamo.Operator }
type StorableDynamo ¶
type StorableDynamo interface {
GetTableId() string
}
type Table ¶
type Table[T StorableDynamo] interface { Put(item T) error Get(hash string) (T, error) Delete(hash string) (T, error) QueryBy(parameter string, queryBy interface{}, indexName string, filter FilterData, rangeData *RangeData, asc *bool, limit int) ([]T, error) Scan(query string, valuesToFilter []interface{}) ([]T, error) }
Click to show internal directories.
Click to hide internal directories.