Documentation ¶
Index ¶
- type Client
- type ErrNoViableIndexes
- type ErrParsingComplete
- type Logger
- type QueryExpr
- func (expr *QueryExpr) And(key string) *QueryExprKey
- func (expr *QueryExpr) ConsistentRead(val bool) *QueryExpr
- func (expr *QueryExpr) LimitPerPage(count int) *QueryExpr
- func (expr *QueryExpr) MaxPagination(count int) *QueryExpr
- func (expr *QueryExpr) OrderAscending(sortKey string) *QueryExpr
- func (expr *QueryExpr) OrderDescending(sortKey string) *QueryExpr
- func (expr *QueryExpr) Select(attributes ...string) *QueryExpr
- func (expr *QueryExpr) WithFilter(condition expression.ConditionBuilder) *QueryExpr
- func (expr *QueryExpr) WithLogger(logger Logger) *QueryExpr
- type QueryExprKey
- func (k *QueryExprKey) BeginsWith(prefix string) *QueryExpr
- func (k *QueryExprKey) Between(lowval, highval interface{}) *QueryExpr
- func (k *QueryExprKey) Equals(val interface{}) *QueryExpr
- func (k *QueryExprKey) GreaterThan(val interface{}) *QueryExpr
- func (k *QueryExprKey) GreaterThanEqual(val interface{}) *QueryExpr
- func (k *QueryExprKey) LessThan(val interface{}) *QueryExpr
- func (k *QueryExprKey) LessThanEqual(val interface{}) *QueryExpr
- type QueryParser
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Base dynamodbiface.DynamoDBAPI
}
Client is a high-level client to DynamoDB. Client is a wrapper around a DynamoDB interface implementer, such as dynamodb.DynamoDB, that enables high-level functionality provided by this package.
func NewClient ¶
func NewClient(dynamoDB dynamodbiface.DynamoDBAPI) *Client
NewClient creates a new Client instance from a regular DynamoDB client from the AWS SDK v1 for Go.
type ErrNoViableIndexes ¶
ErrNoViableIndexes is returned when no viable indexes are found to execute a query expression on a table.
func (ErrNoViableIndexes) Error ¶
func (e ErrNoViableIndexes) Error() string
type ErrParsingComplete ¶
type ErrParsingComplete struct {
// contains filtered or unexported fields
}
ErrParsingComplete is returned by QueryParser.Next() when all query items have been returned or when max pagination has been reached.
func (ErrParsingComplete) Error ¶
func (e ErrParsingComplete) Error() string
type Logger ¶
type Logger interface {
Printf(format string, v ...interface{})
}
Logger is an interface used by dynamodbfriend for all logging.
type QueryExpr ¶
type QueryExpr struct {
// contains filtered or unexported fields
}
QueryExpr is a fully-formed query expression.
func (*QueryExpr) And ¶
func (expr *QueryExpr) And(key string) *QueryExprKey
And extends a query with an additional query condition.
func (*QueryExpr) ConsistentRead ¶
ConsistentRead sets the read consistency. NOTE: For read consistency to be set to true, the partition key must be used with an Equals condition expression. Additionally, the max pagination will be set to 1.
func (*QueryExpr) LimitPerPage ¶
LimitPerPage restricts the number of items evaluated per query page.
func (*QueryExpr) MaxPagination ¶
MaxPagination restricts the number of paginated requests to make to DynamoDB. If the max pagination is reached and all items have been read, the iterator will return Done.
func (*QueryExpr) OrderAscending ¶
OrderAscending sets the order of items returned based on values associated with a sort key, starting with the lowest value.
func (*QueryExpr) OrderDescending ¶
OrderDescending sets the order of items returned based on values associated with a sort key, starting with the highest value.
func (*QueryExpr) WithFilter ¶
func (expr *QueryExpr) WithFilter(condition expression.ConditionBuilder) *QueryExpr
WithFilter applies an additional condition in addition to other filters on the query expression. This allows for filter conditions that are not otherwise supported by the query expression, such as OR conditions.
func (*QueryExpr) WithLogger ¶
WithLogger sets a logger used to print logs about querying operations performed using this expression.
type QueryExprKey ¶
type QueryExprKey struct {
// contains filtered or unexported fields
}
QueryExprKey is a partially-formed query expression.
To make a fully-formed query expression, the key part must be followed by a conditional.
func (*QueryExprKey) BeginsWith ¶
func (k *QueryExprKey) BeginsWith(prefix string) *QueryExpr
BeginsWith is a conditional expression where the value associated with a query key must begin with a specified prefix.
func (*QueryExprKey) Between ¶
func (k *QueryExprKey) Between(lowval, highval interface{}) *QueryExpr
Between is a conditional expression where the value associated with a query key must be between lowval and highval.
func (*QueryExprKey) Equals ¶
func (k *QueryExprKey) Equals(val interface{}) *QueryExpr
Equals is a conditional where the value associated with a query key must equal val.
func (*QueryExprKey) GreaterThan ¶
func (k *QueryExprKey) GreaterThan(val interface{}) *QueryExpr
GreaterThan is a conditional expression where the value associated with a query key must be greater than val.
func (*QueryExprKey) GreaterThanEqual ¶
func (k *QueryExprKey) GreaterThanEqual(val interface{}) *QueryExpr
GreaterThanEqual is a conditional expression where the value associated with a query key must be greater than or equal to val.
func (*QueryExprKey) LessThan ¶
func (k *QueryExprKey) LessThan(val interface{}) *QueryExpr
LessThan is a conditional where the value associated with a query key must be less than val.
func (*QueryExprKey) LessThanEqual ¶
func (k *QueryExprKey) LessThanEqual(val interface{}) *QueryExpr
LessThanEqual is a conditional expression where the value associated with a query key must be less than or equal to val.
type QueryParser ¶
type QueryParser struct {
// contains filtered or unexported fields
}
QueryParser is used for parsing query results. The query is executed lazily. The underlying query will only happen when new items are requested and all buffered items have already been consumed.
func (*QueryParser) Next ¶
func (parser *QueryParser) Next(ctx context.Context, val interface{}) error
Next retrieves the next value returned by the query. The val must be a non-nil pointer. The underlying query will only execute when new items are requested and any buffered items have already been consumed.
type Table ¶
type Table struct { Name string // contains filtered or unexported fields }
Table represents a DynamoDB table. This type keeps the table name ready for all calls to the underlying DynamoDB client.