dynamotest

package
v3.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestGet

func TestGet[S any](
	t *testing.T,
	encoder Encoder[S],
	factory func(*S, *S) dynamo.KeyVal[Person],
)

func TestMatch

func TestMatch[S any](
	t *testing.T,
	encoder Encoder[S],
	factory func(*S, int, *S, *S) dynamo.KeyVal[Person],
)

func TestPut

func TestPut[S any](
	t *testing.T,
	encoder Encoder[S],
	factory func(*S) dynamo.KeyVal[Person],
)

func TestRemove

func TestRemove[S any](
	t *testing.T,
	encoder Encoder[S],
	factory func(*S, *S) dynamo.KeyVal[Person],
)

func TestUpdate

func TestUpdate[S any](
	t *testing.T,
	encoder Encoder[S],
	factory func(*S, *S, *S) dynamo.KeyVal[Person],
)

Types

type Encoder

type Encoder[A any] func(Person) (A, error)

Encoder of test type to storage internal format

type Person

type Person struct {
	Prefix  curie.IRI `dynamodbav:"prefix,omitempty"`
	Suffix  curie.IRI `dynamodbav:"suffix,omitempty"`
	Name    string    `dynamodbav:"name,omitempty"`
	Age     int       `dynamodbav:"age,omitempty"`
	Address string    `dynamodbav:"address,omitempty"`
}

Person is a type used for testing

func (Person) HashKey

func (p Person) HashKey() curie.IRI

func (Person) SortKey

func (p Person) SortKey() curie.IRI

type Persons

type Persons []Person

Use type aliases and methods to implement FMap

func (*Persons) Join

func (seq *Persons) Join(val Person) error

Jump to

Keyboard shortcuts

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