Documentation ¶
Index ¶
- type Account
- 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, req 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
- type ListResponse
- type PatchRequest
- 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 UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Balance *decimal.Decimal `json:"balance"` DisplayName string `json:"displayName"` Icon *string `json:"icon"` ParentID *string `json:"parentID"` TotalIncomingAmount *decimal.Decimal `json:"totalIncomingAmount"` TotalOutgoingAmount *decimal.Decimal `json:"totalOutgoingAmount"` }
type CreateRequest ¶
type CreateRequest struct { TenantID string `json:"-"` DisplayName string `json:"displayName,omitempty"` Icon *string `json:"icon,omitempty"` ParentID *string `json:"parentID,omitempty"` // contains filtered or unexported fields }
func (*CreateRequest) HasBalance ¶
func (lr *CreateRequest) HasBalance() bool
func (*CreateRequest) HasIcon ¶
func (lr *CreateRequest) HasIcon() bool
func (*CreateRequest) HasParentID ¶
func (lr *CreateRequest) HasParentID() bool
func (*CreateRequest) HasTotalIncomingAmount ¶
func (lr *CreateRequest) HasTotalIncomingAmount() bool
func (*CreateRequest) HasTotalOutgoingAmount ¶
func (lr *CreateRequest) HasTotalOutgoingAmount() bool
func (*CreateRequest) UnmarshalJSON ¶
func (lr *CreateRequest) UnmarshalJSON(data []byte) error
type CreateResponse ¶
type CreateResponse Account
type DeleteAllRequest ¶
type DeleteAllRequest struct {
TenantID string `json:"-"`
}
func (*DeleteAllRequest) UnmarshalFromRequest ¶
func (lr *DeleteAllRequest) UnmarshalFromRequest(r *http.Request) error
type DeleteAllResponse ¶
type DeleteAllResponse struct{}
type DeleteRequest ¶
func (*DeleteRequest) UnmarshalFromRequest ¶
func (lr *DeleteRequest) UnmarshalFromRequest(r *http.Request) error
type DeleteResponse ¶
type DeleteResponse struct{}
type GetRequest ¶
type GetRequest struct { TenantID string `json:"-"` ID string `json:"id"` Currency *string `url:"currency,omitempty"` }
func (*GetRequest) UnmarshalFromRequest ¶
func (lr *GetRequest) UnmarshalFromRequest(r *http.Request) error
type GetResponse ¶
type GetResponse Account
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 }
func NewHandler ¶
func NewHandler() Handler
type HandlerImpl ¶
type HandlerImpl struct{}
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, req 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 { TenantID string Offset *uint `url:"_offset,omitempty"` Count *uint `url:"_count,omitempty"` Sort []string `url:"_sort,omitempty"` Currency *string `url:"currency,omitempty"` DisplayName *string `url:"displayName,omitempty"` // contains filtered or unexported fields }
func (*ListRequest) HasCurrency ¶
func (lr *ListRequest) HasCurrency() bool
func (*ListRequest) HasDisplayName ¶
func (lr *ListRequest) HasDisplayName() bool
func (*ListRequest) UnmarshalFromRequest ¶
func (lr *ListRequest) UnmarshalFromRequest(r *http.Request) error
type ListResponse ¶
type PatchRequest ¶
type PatchRequest struct { TenantID string `json:"-"` ID string `json:"id"` Balance *decimal.Decimal `json:"balance,omitempty"` DisplayName *string `json:"displayName,omitempty"` Icon *string `json:"icon,omitempty"` ParentID *string `json:"parentID,omitempty"` TotalIncomingAmount *decimal.Decimal `json:"totalIncomingAmount,omitempty"` TotalOutgoingAmount *decimal.Decimal `json:"totalOutgoingAmount,omitempty"` // contains filtered or unexported fields }
func (*PatchRequest) HasDisplayName ¶
func (lr *PatchRequest) HasDisplayName() bool
func (*PatchRequest) HasIcon ¶
func (lr *PatchRequest) HasIcon() bool
func (*PatchRequest) HasParentID ¶
func (lr *PatchRequest) HasParentID() bool
func (*PatchRequest) UnmarshalJSON ¶
func (lr *PatchRequest) UnmarshalJSON(data []byte) error
type PatchResponse ¶
type PatchResponse Account
type UpdateRequest ¶
type UpdateRequest struct { TenantID string `json:"-"` ID string `json:"id"` DisplayName string `json:"displayName,omitempty"` Icon *string `json:"icon,omitempty"` ParentID *string `json:"parentID,omitempty"` // contains filtered or unexported fields }
func (*UpdateRequest) HasIcon ¶
func (lr *UpdateRequest) HasIcon() bool
func (*UpdateRequest) HasParentID ¶
func (lr *UpdateRequest) HasParentID() bool
func (*UpdateRequest) UnmarshalJSON ¶
func (lr *UpdateRequest) UnmarshalJSON(data []byte) error
type UpdateResponse ¶
type UpdateResponse Account
Click to show internal directories.
Click to hide internal directories.