mem

package
v0.0.0-...-3736fb9 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mem contains an in-memory storage implementation of storage.Data. This is great for unit tests and demos. Our implementation uses a left-leaning red black tree for storage of entries by birthdays and maps for all other indexes. Filtering is done by searching all indexes for matches by each filter and if all matches succeed we stream the entry found.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

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

Data implements storage.Data.

func New

func New() *Data

New is the constructor for Data.

func (*Data) AddPets

func (d *Data) AddPets(ctx context.Context, pets []*pb.Pet) error

AddPets implements storage.Data.AddPets().

func (*Data) DeletePets

func (d *Data) DeletePets(ctx context.Context, ids []string) error

DeletePets implements stroage.Data.DeletePets().

func (*Data) SearchPets

func (d *Data) SearchPets(ctx context.Context, filter *pb.SearchPetsReq) chan storage.SearchItem

SearchPets implements storage.Data.SearchPets().

func (*Data) UpdatePets

func (d *Data) UpdatePets(ctx context.Context, pets []*pb.Pet) error

UpdatePets implements storage.Data.AddPets().

Jump to

Keyboard shortcuts

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