storage

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

XXX: Currently transactional operations are not used.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	ChannelID   string `dynamodbav:"channel_id"`
	ChannelName string `dynamodbav:"channel_name"`
	Token       string `dynamodbav:"token"`
	Version     int    `dynamodbav:"version"`
	CreatedAt   string `dynamodbav:"created_at"`
}

type Storage

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

func NewStorage

func NewStorage(ctx context.Context, tableName string) (*Storage, error)

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, rec Record) error

Delete removes a record. The record must be in the table.

func (*Storage) QueryByChannelName

func (s *Storage) QueryByChannelName(ctx context.Context, channelName string) ([]Record, error)

QueryByChannelName returns found Records sorted by .Version with descending order. https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html

func (*Storage) Save

func (s *Storage) Save(ctx context.Context, rec Record) error

func (*Storage) ScanAll

func (s *Storage) ScanAll(ctx context.Context) ([]Record, error)

Jump to

Keyboard shortcuts

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