reqres

package
v0.0.0-...-ad482e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeActivateDonorRequest

func DecodeActivateDonorRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeActivateDonorRequest decode activate donor request

func DecodeActivateRecipientRequest

func DecodeActivateRecipientRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeActivateRecipientRequest decode activate recipient request

func DecodeCommentsRequest

func DecodeCommentsRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeCommentsRequest decode create recipient request

func DecodeCreateDonorRequest

func DecodeCreateDonorRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeCreateDonorRequest decode create donor request

func DecodeCreateRecipientRequest

func DecodeCreateRecipientRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeCreateRecipientRequest decode create recipient request

func DecodeDeleteDonorRequest

func DecodeDeleteDonorRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeDeleteDonorRequest decode delete donor request

func DecodeDeleteRecipientRequest

func DecodeDeleteRecipientRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeDeleteRecipientRequest decode delete recipient request

func DecodeEmptyRequest

func DecodeEmptyRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeEmptyRequest generic decoder for request with no parameteres, like GET /users

func DecodeProtectedEmptyRequest

func DecodeProtectedEmptyRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeProtectedEmptyRequest generic decoder for request with no parameteres validating api-key

func DecodePublicDonorListRequest

func DecodePublicDonorListRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodePublicDonorListRequest decode public donor list request

func DecodePublicDonorRequest

func DecodePublicDonorRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodePublicDonorRequest decode public donor request

func DecodePublicRecipientRequest

func DecodePublicRecipientRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodePublicRecipientRequest decode public recipient request

func DecodeUpdateDonorRequest

func DecodeUpdateDonorRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeUpdateDonorRequest decode update donor request

func DecodeUpdateRecipientRequest

func DecodeUpdateRecipientRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeUpdateRecipientRequest decode update recipient request

func DecodeUploaderRequest

func DecodeUploaderRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeUploaderRequest decode uploader request

func DecodeVerifyDonorRequest

func DecodeVerifyDonorRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeVerifyDonorRequest decode verify donor request

func DecodeVerifyRecipientRequest

func DecodeVerifyRecipientRequest(ctx context.Context, r *http.Request) (interface{}, error)

DecodeVerifyRecipientRequest decode verify recipient request

func EncodeResponse

func EncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error

EncodeResponse generic encoder

Types

type ActivateDonorResquest

type ActivateDonorResquest struct {
	ID int64 `json:"id,omitempty"`
}

ActivateDonorResquest activate donor request

type ActivateRecipientResquest

type ActivateRecipientResquest struct {
	ID int64 `json:"id,omitempty"`
}

ActivateRecipientResquest activate recipient request

type CommentsResquest

type CommentsResquest struct {
	Email   string `json:"email"`
	Comment string `json:"comment"`
}

CommentsResquest uploader request

type CreateDonorRequest

type CreateDonorRequest struct {
	Donor entities.Donor `json:"donor"`
}

CreateDonorRequest create donor request

type CreateDonorResponse

type CreateDonorResponse struct {
	ID  int64 `json:"id"`
	Err error `json:"error,omitempty"`
}

CreateDonorResponse create donor response

type CreateRecipientRequest

type CreateRecipientRequest struct {
	Recipient entities.Recipient `json:"recipient"`
}

CreateRecipientRequest create recipient request

type CreateRecipientResponse

type CreateRecipientResponse struct {
	ID  int64 `json:"id"`
	Err error `json:"error,omitempty"`
}

CreateRecipientResponse create recipient response

type DeleteDonorResquest

type DeleteDonorResquest struct {
	ID      int64  `json:"id,omitempty"`
	Answer  bool   `json:"answer"`
	Comment string `json:"comment"`
}

DeleteDonorResquest delete donor request

type DeleteRecipientResquest

type DeleteRecipientResquest struct {
	ID      int64  `json:"id,omitempty"`
	Answer  bool   `json:"answer"`
	Comment string `json:"comment"`
}

DeleteRecipientResquest delete recipient request

type GetDonorsRequest

type GetDonorsRequest struct {
	Query   string
	Page    int64
	PerPage int64
}

GetDonorsRequest recipient list request

type GetDonorsResponse

type GetDonorsResponse struct {
	Donors []entities.Donor `json:"donors"`
	Total  int64            `json:"total_records"`
	Err    error            `json:"error,omitempty"`
}

GetDonorsResponse Get a list of donors

type GetRecipientsResponse

type GetRecipientsResponse struct {
	Recipients []entities.Recipient `json:"recipients"`
	Err        error                `json:"error,omitempty"`
}

GetRecipientsResponse Get a list of recipients

type OkErrorResponse

type OkErrorResponse struct {
	Ok  bool  `json:"ok"`
	Err error `json:"error,omitempty"`
}

OkErrorResponse Empty response, just OK or Error

type PublicDonorResquest

type PublicDonorResquest struct {
	ID     int64 `json:"id,omitempty"`
	Public bool  `json:"public"`
}

PublicDonorResquest public donor request

type PublicRecipientResquest

type PublicRecipientResquest struct {
	ID     int64 `json:"id,omitempty"`
	Public bool  `json:"public"`
}

PublicRecipientResquest public recipient request

type UpdateDonorRequest

type UpdateDonorRequest struct {
	Donor entities.Donor `json:"donor"`
}

UpdateDonorRequest update donor request

type UpdateDonorResponse

type UpdateDonorResponse struct {
	Donor entities.Donor `json:"donor"`
	Err   error          `json:"error,omitempty"`
}

UpdateDonorResponse create donor request

type UpdateRecipientRequest

type UpdateRecipientRequest struct {
	Recipient entities.Recipient `json:"recipient"`
}

UpdateRecipientRequest update recipient request

type UpdateRecipientResponse

type UpdateRecipientResponse struct {
	Recipient entities.Recipient `json:"recipient"`
	Err       error              `json:"error,omitempty"`
}

UpdateRecipientResponse create recipient request

type UploaderResponse

type UploaderResponse struct {
	Filename string `json:"filename"`
	Err      error  `json:"error,omitempty"`
}

UploaderResponse uploader request

type UploaderResquest

type UploaderResquest struct {
	Filename string `json:"filename"`
}

UploaderResquest uploader request

type VerifyDonorResquest

type VerifyDonorResquest struct {
	ID       int64 `json:"id,omitempty"`
	Verified bool  `json:"verified"`
}

VerifyDonorResquest vefiry donor request

type VerifyRecipientResquest

type VerifyRecipientResquest struct {
	ID       int64 `json:"id,omitempty"`
	Verified bool  `json:"verified"`
}

VerifyRecipientResquest vefiry recipient request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL