Documentation ¶
Overview ¶
Package payment is a generated GoMock package.
Index ¶
Constants ¶
View Source
const AuthorizationHeader = "Authorization"
View Source
const AuthorizationHeaderPrefix = "Bearer "
View Source
const IdempotencyKeyHeader = "Idempotency-Key"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockVerifier ¶
type MockVerifier struct {
// contains filtered or unexported fields
}
MockVerifier is a mock of Verifier interface.
func NewMockVerifier ¶
func NewMockVerifier(ctrl *gomock.Controller) *MockVerifier
NewMockVerifier creates a new mock instance.
func (*MockVerifier) EXPECT ¶
func (m *MockVerifier) EXPECT() *MockVerifierMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockVerifier) Verify ¶
func (m *MockVerifier) Verify(p *Payment) Status
Verify mocks base method.
type MockVerifierMockRecorder ¶
type MockVerifierMockRecorder struct {
// contains filtered or unexported fields
}
MockVerifierMockRecorder is the mock recorder for MockVerifier.
func (*MockVerifierMockRecorder) Verify ¶
func (mr *MockVerifierMockRecorder) Verify(p any) *MockVerifierVerifyCall
Verify indicates an expected call of Verify.
type MockVerifierVerifyCall ¶
MockVerifierVerifyCall wrap *gomock.Call
func (*MockVerifierVerifyCall) Do ¶
func (c *MockVerifierVerifyCall) Do(f func(*Payment) Status) *MockVerifierVerifyCall
Do rewrite *gomock.Call.Do
func (*MockVerifierVerifyCall) DoAndReturn ¶
func (c *MockVerifierVerifyCall) DoAndReturn(f func(*Payment) Status) *MockVerifierVerifyCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockVerifierVerifyCall) Return ¶
func (c *MockVerifierVerifyCall) Return(arg0 Status) *MockVerifierVerifyCall
Return rewrite *gomock.Call.Return
type Payment ¶
type Payment struct { IdempotencyKey string Token string Amount int Status Status // contains filtered or unexported fields }
func NewPayment ¶
type PostPaymentRequest ¶
type PostPaymentRequest struct {
Amount int `json:"amount"`
}
func (*PostPaymentRequest) IsSamePayload ¶
func (r *PostPaymentRequest) IsSamePayload(token string, p *Payment) bool
type ResponsePayment ¶
func NewResponsePayment ¶
func NewResponsePayment(p *Payment) ResponsePayment
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetPaymentsHandler ¶
func (s *Server) GetPaymentsHandler(w http.ResponseWriter, r *http.Request)
func (*Server) PostPaymentsHandler ¶
func (s *Server) PostPaymentsHandler(w http.ResponseWriter, r *http.Request)
type Status ¶
type Status struct { Type StatusType Err error }
type StatusType ¶
type StatusType int
const ( StatusInitial StatusType = iota StatusSuccess StatusInvalidAmount StatusInvalidToken )
func (StatusType) String ¶
func (s StatusType) String() string
Click to show internal directories.
Click to hide internal directories.