Documentation
¶
Index ¶
- type PaymentRepository
- func (pr *PaymentRepository) Add(payment *models.Payment) error
- func (pr *PaymentRepository) Delete(paymentID strfmt.UUID) error
- func (pr *PaymentRepository) Get(paymentID strfmt.UUID) (*models.Payment, error)
- func (pr *PaymentRepository) List(offset, limit int64) ([]*models.Payment, error)
- func (pr *PaymentRepository) Update(paymentID strfmt.UUID, payment *models.Payment) error
- type PaymentsService
- func (papi *PaymentsService) CreatePayment(ctx context.Context, params payments.CreatePaymentParams) middleware.Responder
- func (papi *PaymentsService) DeletePayment(ctx context.Context, params payments.DeletePaymentParams) middleware.Responder
- func (papi *PaymentsService) GetPayment(ctx context.Context, params payments.GetPaymentParams) middleware.Responder
- func (papi *PaymentsService) ListPayments(ctx context.Context, params payments.ListPaymentsParams) middleware.Responder
- func (papi *PaymentsService) UpdatePayment(ctx context.Context, params payments.UpdatePaymentParams) middleware.Responder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaymentRepository ¶
PaymentRepository stores a collection of payment resources that is safe for concurrent use
func NewPaymentRepository ¶
func NewPaymentRepository() *PaymentRepository
NewPaymentRepository creates a freshly brewed PaymentRepository
func (*PaymentRepository) Add ¶
func (pr *PaymentRepository) Add(payment *models.Payment) error
Add adds a new payment resource to the repository
Add returns an error if a payment with the same ID as the one to be added already exists
func (*PaymentRepository) Delete ¶
func (pr *PaymentRepository) Delete(paymentID strfmt.UUID) error
Delete deletes the payment resource associated to the given paymentID
Delete returns an error if the paymentID is not present in the respository
func (*PaymentRepository) Get ¶
Get returns the payment resource associated with the given paymentID
Get returns an error if the paymentID does not exist in the collection
func (*PaymentRepository) List ¶
func (pr *PaymentRepository) List(offset, limit int64) ([]*models.Payment, error)
List returns a slice of payment resources. An empty slice will be returned if no payment exists.
List implements basic pagination by means of offset and limit parameters. List will return an error if offset is beyond the number of elements available. A limit of 0 will return all elements available. Both parameters default to 0.
type PaymentsService ¶
type PaymentsService struct {
// Repo is a repository for payments
Repo *PaymentRepository
}
PaymentsService implements the business logic needed to fulfill the API's requirements
func (*PaymentsService) CreatePayment ¶
func (papi *PaymentsService) CreatePayment(ctx context.Context, params payments.CreatePaymentParams) middleware.Responder
CreatePayment Adds a new payment with the data included in params
func (*PaymentsService) DeletePayment ¶
func (papi *PaymentsService) DeletePayment(ctx context.Context, params payments.DeletePaymentParams) middleware.Responder
DeletePayment Deletes a payment identified by its ID
func (*PaymentsService) GetPayment ¶
func (papi *PaymentsService) GetPayment(ctx context.Context, params payments.GetPaymentParams) middleware.Responder
GetPayment Returns details of a payment identified by its ID
func (*PaymentsService) ListPayments ¶
func (papi *PaymentsService) ListPayments(ctx context.Context, params payments.ListPaymentsParams) middleware.Responder
ListPayments Returns details of a collection of payments
func (*PaymentsService) UpdatePayment ¶
func (papi *PaymentsService) UpdatePayment(ctx context.Context, params payments.UpdatePaymentParams) middleware.Responder
UpdatePayment Adds a new payment with the data included in params