Documentation
¶
Index ¶
- type CreateRequest
- type CreateResponse
- type DeleteAllRequest
- type DeleteAllResponse
- type DeleteRequest
- type DeleteResponse
- type GetRequest
- type GetResponse
- type Handler
- type HandlerImpl
- func (h *HandlerImpl) Create(ctx context.Context, req CreateRequest) (*CreateResponse, error)
- func (h *HandlerImpl) Delete(ctx context.Context, req DeleteRequest) error
- func (h *HandlerImpl) DeleteAll(ctx context.Context, _ DeleteAllRequest) error
- func (h *HandlerImpl) Get(ctx context.Context, req GetRequest) (*GetResponse, error)
- func (h *HandlerImpl) List(ctx context.Context, req ListRequest) (*ListResponse, error)
- func (h *HandlerImpl) Patch(ctx context.Context, req PatchRequest) (*PatchResponse, error)
- func (h *HandlerImpl) Update(ctx context.Context, req UpdateRequest) (*UpdateResponse, error)
- type ListRequest
- func (lr *ListRequest) HasDescription() bool
- func (lr *ListRequest) HasMaxAmount() bool
- func (lr *ListRequest) HasMaxDate() bool
- func (lr *ListRequest) HasMinAmount() bool
- func (lr *ListRequest) HasMinDate() bool
- func (lr *ListRequest) HasReferenceID() bool
- func (lr *ListRequest) HasSourceAccountID() bool
- func (lr *ListRequest) HasTargetAccountID() bool
- func (lr *ListRequest) UnmarshalFromRequest(r *http.Request) error
- type ListResponse
- type PatchRequest
- func (lr *PatchRequest) HasAmount() bool
- func (lr *PatchRequest) HasCurrency() bool
- func (lr *PatchRequest) HasDate() bool
- func (lr *PatchRequest) HasDescription() bool
- func (lr *PatchRequest) HasReferenceID() bool
- func (lr *PatchRequest) HasSourceAccountID() bool
- func (lr *PatchRequest) HasTargetAccountID() bool
- func (lr *PatchRequest) UnmarshalJSON(data []byte) error
- type PatchResponse
- type Server
- func (s *Server) Create(w http.ResponseWriter, r *http.Request)
- func (s *Server) Delete(w http.ResponseWriter, r *http.Request)
- func (s *Server) DeleteAll(w http.ResponseWriter, r *http.Request)
- func (s *Server) Get(w http.ResponseWriter, r *http.Request)
- func (s *Server) List(w http.ResponseWriter, r *http.Request)
- func (s *Server) Patch(w http.ResponseWriter, r *http.Request)
- func (s *Server) Register(mux *http.ServeMux)
- func (s *Server) Update(w http.ResponseWriter, r *http.Request)
- type Transaction
- type UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type CreateRequest struct {
Amount decimal.Decimal `json:"amount,omitempty"`
Currency string `json:"currency,omitempty"`
Date time.Time `json:"date,omitempty"`
Description *string `json:"description,omitempty"`
ReferenceID string `json:"referenceId,omitempty"`
SourceAccountID string `json:"sourceAccountId,omitempty"`
TargetAccountID string `json:"targetAccountId,omitempty"`
// contains filtered or unexported fields
}
func (*CreateRequest) HasDescription ¶
func (lr *CreateRequest) HasDescription() bool
func (*CreateRequest) UnmarshalJSON ¶
func (lr *CreateRequest) UnmarshalJSON(data []byte) error
type CreateResponse ¶
type CreateResponse Transaction
type DeleteAllRequest ¶
type DeleteAllRequest struct{}
type DeleteAllResponse ¶
type DeleteAllResponse struct{}
type DeleteRequest ¶
type DeleteRequest struct {
ID string `json:"id"`
}
func (*DeleteRequest) UnmarshalFromRequest ¶
func (lr *DeleteRequest) UnmarshalFromRequest(r *http.Request) error
type DeleteResponse ¶
type DeleteResponse struct{}
type GetRequest ¶
func (*GetRequest) UnmarshalFromRequest ¶
func (lr *GetRequest) UnmarshalFromRequest(r *http.Request) error
type GetResponse ¶
type GetResponse Transaction
type Handler ¶
type Handler interface {
List(context.Context, ListRequest) (*ListResponse, error)
Create(context.Context, CreateRequest) (*CreateResponse, error)
Get(context.Context, GetRequest) (*GetResponse, error)
Patch(context.Context, PatchRequest) (*PatchResponse, error)
Update(context.Context, UpdateRequest) (*UpdateResponse, error)
Delete(context.Context, DeleteRequest) error
DeleteAll(context.Context, DeleteAllRequest) error
}
type HandlerImpl ¶
func (*HandlerImpl) Create ¶
func (h *HandlerImpl) Create(ctx context.Context, req CreateRequest) (*CreateResponse, error)
func (*HandlerImpl) Delete ¶
func (h *HandlerImpl) Delete(ctx context.Context, req DeleteRequest) error
func (*HandlerImpl) DeleteAll ¶
func (h *HandlerImpl) DeleteAll(ctx context.Context, _ DeleteAllRequest) error
func (*HandlerImpl) Get ¶
func (h *HandlerImpl) Get(ctx context.Context, req GetRequest) (*GetResponse, error)
func (*HandlerImpl) List ¶
func (h *HandlerImpl) List(ctx context.Context, req ListRequest) (*ListResponse, error)
func (*HandlerImpl) Patch ¶
func (h *HandlerImpl) Patch(ctx context.Context, req PatchRequest) (*PatchResponse, error)
func (*HandlerImpl) Update ¶
func (h *HandlerImpl) Update(ctx context.Context, req UpdateRequest) (*UpdateResponse, error)
type ListRequest ¶
type ListRequest struct {
Offset *uint `url:"_offset,omitempty"`
Count *uint `url:"_count,omitempty"`
Sort []string `url:"_sort,omitempty"`
Description *string `url:"description,omitempty"`
MaxAmount *decimal.Decimal `url:"maxAmount,omitempty"`
MaxDate *time.Time `url:"maxDate,omitempty"`
MinAmount *decimal.Decimal `url:"minAmount,omitempty"`
MinDate *time.Time `url:"minDate,omitempty"`
ReferenceID *string `url:"referenceId,omitempty"`
SourceAccountID *string `url:"sourceAccountId,omitempty"`
TargetAccountID *string `url:"targetAccountId,omitempty"`
Currency string `url:"currency,omitempty"`
// contains filtered or unexported fields
}
func (*ListRequest) HasDescription ¶
func (lr *ListRequest) HasDescription() bool
func (*ListRequest) HasMaxAmount ¶
func (lr *ListRequest) HasMaxAmount() bool
func (*ListRequest) HasMaxDate ¶
func (lr *ListRequest) HasMaxDate() bool
func (*ListRequest) HasMinAmount ¶
func (lr *ListRequest) HasMinAmount() bool
func (*ListRequest) HasMinDate ¶
func (lr *ListRequest) HasMinDate() bool
func (*ListRequest) HasReferenceID ¶
func (lr *ListRequest) HasReferenceID() bool
func (*ListRequest) HasSourceAccountID ¶
func (lr *ListRequest) HasSourceAccountID() bool
func (*ListRequest) HasTargetAccountID ¶
func (lr *ListRequest) HasTargetAccountID() bool
func (*ListRequest) UnmarshalFromRequest ¶
func (lr *ListRequest) UnmarshalFromRequest(r *http.Request) error
type ListResponse ¶
type ListResponse struct {
TotalCount uint `json:"totalCount"`
Items []Transaction `json:"items"`
}
type PatchRequest ¶
type PatchRequest struct {
ID string `json:"id"`
Amount *decimal.Decimal `json:"amount,omitempty"`
ConvertedAmount *decimal.Decimal `json:"convertedAmount,omitempty"`
Currency *string `json:"currency,omitempty"`
Date *time.Time `json:"date,omitempty"`
Description *string `json:"description,omitempty"`
ReferenceID *string `json:"referenceId,omitempty"`
SourceAccountID *string `json:"sourceAccountId,omitempty"`
TargetAccountID *string `json:"targetAccountId,omitempty"`
// contains filtered or unexported fields
}
func (*PatchRequest) HasAmount ¶
func (lr *PatchRequest) HasAmount() bool
func (*PatchRequest) HasCurrency ¶
func (lr *PatchRequest) HasCurrency() bool
func (*PatchRequest) HasDate ¶
func (lr *PatchRequest) HasDate() bool
func (*PatchRequest) HasDescription ¶
func (lr *PatchRequest) HasDescription() bool
func (*PatchRequest) HasReferenceID ¶
func (lr *PatchRequest) HasReferenceID() bool
func (*PatchRequest) HasSourceAccountID ¶
func (lr *PatchRequest) HasSourceAccountID() bool
func (*PatchRequest) HasTargetAccountID ¶
func (lr *PatchRequest) HasTargetAccountID() bool
func (*PatchRequest) UnmarshalJSON ¶
func (lr *PatchRequest) UnmarshalJSON(data []byte) error
type PatchResponse ¶
type PatchResponse Transaction
type Transaction ¶
type Transaction struct {
ID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Amount decimal.Decimal `json:"amount"`
ConvertedAmount *decimal.Decimal `json:"convertedAmount"`
Currency string `json:"currency"`
Date time.Time `json:"date"`
Description *string `json:"description"`
ReferenceID string `json:"referenceId"`
SourceAccountID string `json:"sourceAccountId"`
TargetAccountID string `json:"targetAccountId"`
}
type UpdateRequest ¶
type UpdateRequest struct {
ID string `json:"id"`
Amount decimal.Decimal `json:"amount,omitempty"`
Currency string `json:"currency,omitempty"`
Date time.Time `json:"date,omitempty"`
Description *string `json:"description,omitempty"`
ReferenceID string `json:"referenceId,omitempty"`
SourceAccountID string `json:"sourceAccountId,omitempty"`
TargetAccountID string `json:"targetAccountId,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateRequest) HasDescription ¶
func (lr *UpdateRequest) HasDescription() bool
func (*UpdateRequest) UnmarshalJSON ¶
func (lr *UpdateRequest) UnmarshalJSON(data []byte) error
type UpdateResponse ¶
type UpdateResponse Transaction
Click to show internal directories.
Click to hide internal directories.