Documentation ¶
Index ¶
- Variables
- type Customers
- type DDBCustomers
- func (dc *DDBCustomers) CreateCustomer(ctx context.Context, id, name string, obj proto.Message) (int64, error)
- func (dc *DDBCustomers) GetCustomer(ctx context.Context, id string, into proto.Message) (int64, error)
- func (dc *DDBCustomers) ListCustomers(ctx context.Context, nextToken string, limit int) (string, []Record, error)
- type Record
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCustomerNameConflict when creating a new customer a name conflict was found ErrCustomerNameConflict = errors.New("customer name already exists") // ErrCustomerNotFound when retrieving a customer the id wasn't found ErrCustomerNotFound = errors.New("customer not found") )
Functions ¶
This section is empty.
Types ¶
type Customers ¶
type Customers interface { GetCustomer(ctx context.Context, id string, into proto.Message) (int64, error) CreateCustomer(ctx context.Context, id, name string, obj proto.Message) (int64, error) ListCustomers(ctx context.Context, nextToken string, limit int) (string, []Record, error) }
Customers store used to manage customers
type DDBCustomers ¶
type DDBCustomers struct {
// contains filtered or unexported fields
}
DDBCustomers DynamoDB based customer store
func (*DDBCustomers) CreateCustomer ¶
func (dc *DDBCustomers) CreateCustomer(ctx context.Context, id, name string, obj proto.Message) (int64, error)
CreateCustomer create a customer using the supplied message and return the version
func (*DDBCustomers) GetCustomer ¶
func (dc *DDBCustomers) GetCustomer(ctx context.Context, id string, into proto.Message) (int64, error)
GetCustomer retrieve the customer and marshall it into the supplied message
func (*DDBCustomers) ListCustomers ¶
func (dc *DDBCustomers) ListCustomers(ctx context.Context, nextToken string, limit int) (string, []Record, error)
ListCustomers list customers and retrieve the raw records for marshaling in the consuming method, this is done to avoid tying this method to a given storage model
Click to show internal directories.
Click to hide internal directories.