Documentation ¶
Index ¶
- Constants
- func GetCreateTableRequest(config Config) *dynamodb.CreateTableInput
- type BatchWritePointOutput
- type Config
- type DeletePointInput
- type DeletePointOutput
- type ErrFailedToConvertItemToGeoPoint
- type ErrMissingDynamoClient
- type ErrMissingDynamoTableName
- type ErrPaginatedQueryInvalidLimit
- type Geo
- func (g Geo) BatchWritePoints(ctx context.Context, inputs []PutPointInput) (*BatchWritePointOutput, error)
- func (g Geo) DeletePoint(ctx context.Context, input DeletePointInput) (*DeletePointOutput, error)
- func (g Geo) GetPoint(ctx context.Context, input GetPointInput) (*GetPointOutput, error)
- func (g Geo) PutPoint(ctx context.Context, input PutPointInput) (*PutPointOutput, error)
- func (g Geo) QueryRadius(ctx context.Context, input QueryRadiusInput, out interface{}) error
- func (g Geo) QueryRadiusPaginated(ctx context.Context, input QueryRadiusInput, ...) (GeoHashToLastEvaluatedDBValue, error)
- func (g Geo) QueryRectangle(ctx context.Context, input QueryRectangleInput, out interface{}) error
- func (g Geo) UpdatePoint(ctx context.Context, input UpdatePointInput) (*UpdatePointOutput, error)
- type GeoHashToLastEvaluatedDBValue
- type GeoJSONAttribute
- type GeoOptions
- func WithConsistentRead(consistentRead bool) GeoOptions
- func WithDynamoClient(client *dynamodb.Client) GeoOptions
- func WithGeoHashkey(attributeName string) GeoOptions
- func WithGeoIndex(name string) GeoOptions
- func WithGeoJSONKey(attributeName string) GeoOptions
- func WithHashkey(attributeName string) GeoOptions
- func WithHashkeyLen(len int8) GeoOptions
- func WithLongitudeFirst(f bool) GeoOptions
- func WithRangekey(attributeName string) GeoOptions
- func WithRetryOnFilterOfRadiusQuery(maxRetries, multiplier int) GeoOptions
- func WithS2RegionCoverer(s2rc s2.RegionCoverer) GeoOptions
- func WithTableName(name string) GeoOptions
- func WithUnmarshalAsJSON(f bool) GeoOptions
- type GeoPoint
- type GeoQueryInput
- type GeoQueryOutput
- type GetPointInput
- type GetPointOutput
- type PointInput
- type PutPointInput
- type PutPointOutput
- type QueryRadiusInput
- type QueryRadiusOutput
- type QueryRectangleInput
- type QueryRectangleOutput
- type UpdatePointInput
- type UpdatePointOutput
Constants ¶
const EARTH_RADIUS_METERS = 6367000.0
S2 Util
Variables ¶
This section is empty.
Functions ¶
func GetCreateTableRequest ¶
func GetCreateTableRequest(config Config) *dynamodb.CreateTableInput
Types ¶
type BatchWritePointOutput ¶
type BatchWritePointOutput struct {
*dynamodb.BatchWriteItemOutput
}
type Config ¶ added in v0.1.2
type Config struct {
// contains filtered or unexported fields
}
func MakeConfig ¶ added in v0.1.2
func MakeConfig(opts ...GeoOptions) *Config
type DeletePointInput ¶
type DeletePointInput struct { PointInput DeleteItemInput dynamodb.DeleteItemInput }
type DeletePointOutput ¶
type DeletePointOutput struct {
*dynamodb.DeleteItemOutput
}
type ErrFailedToConvertItemToGeoPoint ¶ added in v0.1.2
type ErrFailedToConvertItemToGeoPoint struct {
// contains filtered or unexported fields
}
func (ErrFailedToConvertItemToGeoPoint) Error ¶ added in v0.1.2
func (e ErrFailedToConvertItemToGeoPoint) Error() string
type ErrMissingDynamoClient ¶ added in v0.1.2
type ErrMissingDynamoClient struct{}
func (ErrMissingDynamoClient) Error ¶ added in v0.1.2
func (ErrMissingDynamoClient) Error() string
type ErrMissingDynamoTableName ¶ added in v0.1.2
type ErrMissingDynamoTableName struct{}
func (ErrMissingDynamoTableName) Error ¶ added in v0.1.2
func (ErrMissingDynamoTableName) Error() string
type ErrPaginatedQueryInvalidLimit ¶ added in v0.1.2
type ErrPaginatedQueryInvalidLimit struct{}
func (ErrPaginatedQueryInvalidLimit) Error ¶ added in v0.1.2
func (ErrPaginatedQueryInvalidLimit) Error() string
type Geo ¶ added in v0.1.2
type Geo struct {
// contains filtered or unexported fields
}
func (Geo) BatchWritePoints ¶ added in v0.1.2
func (g Geo) BatchWritePoints(ctx context.Context, inputs []PutPointInput) (*BatchWritePointOutput, error)
func (Geo) DeletePoint ¶ added in v0.1.2
func (g Geo) DeletePoint(ctx context.Context, input DeletePointInput) (*DeletePointOutput, error)
func (Geo) GetPoint ¶ added in v0.1.2
func (g Geo) GetPoint(ctx context.Context, input GetPointInput) (*GetPointOutput, error)
func (Geo) PutPoint ¶ added in v0.1.2
func (g Geo) PutPoint(ctx context.Context, input PutPointInput) (*PutPointOutput, error)
func (Geo) QueryRadius ¶ added in v0.1.2
func (g Geo) QueryRadius(ctx context.Context, input QueryRadiusInput, out interface{}) error
func (Geo) QueryRadiusPaginated ¶ added in v0.1.2
func (g Geo) QueryRadiusPaginated(ctx context.Context, input QueryRadiusInput, hashToLastEvaluatedEntry GeoHashToLastEvaluatedDBValue, limit uint, out interface{}) (GeoHashToLastEvaluatedDBValue, error)
func (Geo) QueryRectangle ¶ added in v0.1.2
func (g Geo) QueryRectangle(ctx context.Context, input QueryRectangleInput, out interface{}) error
func (Geo) UpdatePoint ¶ added in v0.1.2
func (g Geo) UpdatePoint(ctx context.Context, input UpdatePointInput) (*UpdatePointOutput, error)
type GeoHashToLastEvaluatedDBValue ¶
type GeoHashToLastEvaluatedDBValue map[uint64]map[string]types.AttributeValue
type GeoJSONAttribute ¶
type GeoOptions ¶ added in v0.1.2
type GeoOptions func(c *Config)
func WithConsistentRead ¶ added in v0.1.2
func WithConsistentRead(consistentRead bool) GeoOptions
func WithDynamoClient ¶ added in v0.1.2
func WithDynamoClient(client *dynamodb.Client) GeoOptions
WithDynamoClient sets the dynamo client to be used
func WithGeoHashkey ¶ added in v0.1.2
func WithGeoHashkey(attributeName string) GeoOptions
WithGeoHashkey sets a custom geo hashKey attribute name. When it's missing, the value is `geohash`
func WithGeoIndex ¶ added in v0.1.2
func WithGeoIndex(name string) GeoOptions
WithGeoIndex sets a custom geo index name. When it's missing, the value is `geohash-index`
func WithGeoJSONKey ¶ added in v0.1.2
func WithGeoJSONKey(attributeName string) GeoOptions
WithGeoJSONKey sets a custom geo JSON key attribute name. When it's missing, the value is `geoJson`
func WithHashkey ¶ added in v0.1.2
func WithHashkey(attributeName string) GeoOptions
WithHashKey sets a custom hashKey attribute name. When it's missing, the value is `hashKey`
func WithHashkeyLen ¶ added in v0.1.2
func WithHashkeyLen(len int8) GeoOptions
WithHashkeyLen sets a custom hashKey len. When it's missing, the value is `5`
func WithLongitudeFirst ¶ added in v0.1.2
func WithLongitudeFirst(f bool) GeoOptions
WithLongitudeFirst sets the order of a geo coordinate to be readed, the default value is false.
func WithRangekey ¶ added in v0.1.2
func WithRangekey(attributeName string) GeoOptions
WithHashKey sets a custom rangeKey attribute name. When it's missing, the value is `rangeKey`
func WithRetryOnFilterOfRadiusQuery ¶ added in v0.1.2
func WithRetryOnFilterOfRadiusQuery(maxRetries, multiplier int) GeoOptions
WithRetryOnFilterOfRadiusQuery sets a max number of retries allowed for radius query; Important to mention, this retry will be applied when the algo is trying to find if the results from dynamo db are part of the created circle. When this is enabled, the algorithm will do
radius = radius * multiplier; for each reach the maxRetries - do radius * multiplier
be aware that multipler has set 2 as default
func WithS2RegionCoverer ¶ added in v0.1.2
func WithS2RegionCoverer(s2rc s2.RegionCoverer) GeoOptions
WithS2RegionCoverer sets the s2.RegionCoverer to be used
func WithTableName ¶ added in v0.1.2
func WithTableName(name string) GeoOptions
WithTableName sets the table name expected to be queried
func WithUnmarshalAsJSON ¶ added in v0.1.2
func WithUnmarshalAsJSON(f bool) GeoOptions
type GeoQueryInput ¶
type GeoQueryInput struct {
QueryInput dynamodb.QueryInput
}
type GeoQueryOutput ¶
type GeoQueryOutput struct {
*dynamodb.QueryOutput
}
type GetPointInput ¶
type GetPointInput struct { PointInput GetItemInput dynamodb.GetItemInput }
type GetPointOutput ¶
type GetPointOutput struct {
*dynamodb.GetItemOutput
}
type PointInput ¶
type PointInput struct { RangeKeyValue types.AttributeValue GeoPoint GeoPoint }
type PutPointInput ¶
type PutPointInput struct { PointInput PutItemInput dynamodb.PutItemInput }
type PutPointOutput ¶
type PutPointOutput struct {
*dynamodb.PutItemOutput
}
type QueryRadiusInput ¶
type QueryRadiusInput struct { GeoQueryInput CenterPoint GeoPoint RadiusInMeter int }
type QueryRadiusOutput ¶
type QueryRadiusOutput struct {
*GeoQueryOutput
}
type QueryRectangleInput ¶
type QueryRectangleInput struct { GeoQueryInput MinPoint *GeoPoint MaxPoint *GeoPoint }
type QueryRectangleOutput ¶
type QueryRectangleOutput struct {
*GeoQueryOutput
}
type UpdatePointInput ¶
type UpdatePointInput struct { PointInput UpdateItemInput dynamodb.UpdateItemInput }
type UpdatePointOutput ¶
type UpdatePointOutput struct {
*dynamodb.UpdateItemOutput
}