tinyamodb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundPartitionKey    = errors.New("not found partition key")
	ErrInvalidPartitionKeyType = errors.New("partition key must be 'string' type")
	ErrCannotUnmarshal         = errors.New("cannot unmarshal")
)

Functions

func NewTinyamoDbItem

func NewTinyamoDbItem(item map[string]types.AttributeValue, c Config) (*tinyamodbItem, error)

Types

type Config

type Config struct {
	Partition struct {
		Num uint8
	}
	Segment struct {
		MaxStoreBytes uint64
		MaxIndexBytes uint64
	}
	Table struct {
		PartitionKey string
	}
}

type Db

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

func New

func New(dir string, c Config) (*Db, error)

func (*Db) Close

func (db *Db) Close() error

func (*Db) DeleteItem

func (db *Db) DeleteItem(ctx context.Context, input *DeleteItemInput) (*DeleteItemOutput, error)

func (*Db) GetItem

func (db *Db) GetItem(ctx context.Context, input *GetItemInput) (*GetItemOutput, error)

func (*Db) PutItem

func (db *Db) PutItem(ctx context.Context, input *PutItemInput) (*PutItemOutput, error)

type DeleteItemInput

type DeleteItemInput struct {
	Key map[string]types.AttributeValue
}

type DeleteItemOutput

type DeleteItemOutput struct {
}

type DeleteKeyItemOutput

type DeleteKeyItemOutput struct {
}

type GetItemInput

type GetItemInput struct {
	Key map[string]types.AttributeValue
}

type GetItemOutput

type GetItemOutput struct {
	Item map[string]types.AttributeValue
}

type Item

type Item interface {
	SHA256Key() []byte
	StrSHA2526Key() string
	Value() ([]byte, error)
	Unmarshal([]byte) error
}

type PutItemInput

type PutItemInput struct {
	Item map[string]types.AttributeValue
}

type PutItemOutput

type PutItemOutput struct {
}

type PutKeyItemOutput

type PutKeyItemOutput struct {
}

type ReadKeyItemOutput

type ReadKeyItemOutput struct {
	Key *string
}

Jump to

Keyboard shortcuts

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