Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type BaseResponse struct {
Status int `json:"status"`
Message *string `json:"message,omitempty"`
Error string `json:"error"`
}
We can define a base response struct that will be used by all other response structs. This will help us to maintain a consistent response format across the application. This will also help us to easily change the response format in the future. Example:
type TestResponse struct {
*BaseResponse `json:"response,omitempty"`
Data interface{} `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.