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: 0

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