repository

package
v0.0.0-...-de806f4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type URLRow

type URLRow struct {
	ID        string    `dynamodbav:"id"`
	URL       string    `dynamodbav:"url"`
	CreatedAt time.Time `dynamodbav:"created_at"`
}

func (URLRow) ToEntity

func (r URLRow) ToEntity() (*entity.TinyURL, error)

type URLStore

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

func NewURLStore

func NewURLStore(config *URLStoreConfig, db *dynamodb.Client) *URLStore

func (*URLStore) Create

func (s *URLStore) Create(ctx context.Context, url *entity.TinyURL) error

func (*URLStore) Find

func (s *URLStore) Find(ctx context.Context, id string) (*entity.TinyURL, error)

type URLStoreConfig

type URLStoreConfig struct {
	TableName string `env:"URL_TABLE,required"`
}

Jump to

Keyboard shortcuts

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