storage

package
v0.0.0-...-213eba4 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCustomer

func ValidateCustomer(ctx context.Context, c *pb.Customer, forUpdate bool) error

ValidateCustomer validates that *pb.Customer has valid fields.

Types

type Data

type Data interface {
	// AddCustomers adds pet entries into storage.
	AddCustomers(ctx context.Context, customers []*pb.Customer) error
	// UpdateCustomers updates customers entries in storage.
	UpdateCustomers(ctx context.Context, customers []*pb.Customer) error
	// DeleteCustomers deletes customers in storage by their ID. Will not error
	// on IDs not found.
	DeleteCustomers(ctx context.Context, ids []string) error
	// SearchCustomers searches storage for customers entries that match the
	// filter.
	SearchCustomers(ctx context.Context, filter *pb.SearchCustomersReq) chan SearchItem
}

Data represents our data storage.

type SearchItem

type SearchItem struct {
	// Customer is the customer that matched the search filters.
	Customer *pb.Customer
	// Error indicates that there was an error. If set the channel
	// will close after this entry.
	Error error
}

SearchItem is an item returned by a search.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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