Documentation ¶
Index ¶
- func BuildUrlWithQueryString(url string, params interface{}) string
- func GetValidate() *validator.Validate
- func Upload(config HttpConfig, path string, data FileData) (*HttpSuccessBasicResponse, *HttpErrorResponse)
- type File
- type FileData
- type HttpConfig
- type HttpErrorResponse
- func Delete[T any](config HttpConfig, path string, resultType T) (*T, *HttpErrorResponse)
- func Download(config HttpConfig, path string) ([]byte, *HttpErrorResponse)
- func Get[T any](config HttpConfig, path string, resultType T) (*T, *HttpErrorResponse)
- func HttpRequest[T any](request *http.Request, url string, successResponse T) (*T, *HttpErrorResponse)
- func Patch[T any](config HttpConfig, path string, payload interface{}, resultType T) (*T, *HttpErrorResponse)
- func Post[T any](config HttpConfig, path string, payload interface{}, resultType T) (*T, *HttpErrorResponse)
- func Put[T any](config HttpConfig, path string, payload interface{}, resultType T) (*T, *HttpErrorResponse)
- type HttpSuccessBasicResponse
- type OptionalDateParams
- type OptionalDatePayload
- type Pagination
- type PaginationParams
- type PaginationPayload
- type PaginationResponse
- type PayloadDateParams
- type QueryDateParams
- type RequiredDateParams
- type RequiredDatePayload
- type SyncHangupResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildUrlWithQueryString ¶
func GetValidate ¶
func GetValidate() *validator.Validate
func Upload ¶
func Upload(config HttpConfig, path string, data FileData) (*HttpSuccessBasicResponse, *HttpErrorResponse)
Types ¶
type HttpConfig ¶
func InitHttpConfig ¶
func InitHttpConfig(baseUrl string, appId string) *HttpConfig
type HttpErrorResponse ¶
type HttpErrorResponse struct { Success bool `json:"success,omitempty"` Message string `json:"message,omitempty"` Errors *map[string]string `json:"errors,omitempty"` }
func Delete ¶
func Delete[T any](config HttpConfig, path string, resultType T) (*T, *HttpErrorResponse)
func Download ¶
func Download(config HttpConfig, path string) ([]byte, *HttpErrorResponse)
func Get ¶
func Get[T any](config HttpConfig, path string, resultType T) (*T, *HttpErrorResponse)
func HttpRequest ¶
func HttpRequest[T any](request *http.Request, url string, successResponse T) (*T, *HttpErrorResponse)
func Patch ¶
func Patch[T any](config HttpConfig, path string, payload interface{}, resultType T) (*T, *HttpErrorResponse)
func Post ¶
func Post[T any](config HttpConfig, path string, payload interface{}, resultType T) (*T, *HttpErrorResponse)
func Put ¶
func Put[T any](config HttpConfig, path string, payload interface{}, resultType T) (*T, *HttpErrorResponse)
type HttpSuccessBasicResponse ¶
type HttpSuccessBasicResponse struct {
Success bool `json:"success"`
}
type OptionalDateParams ¶
type OptionalDateParams struct { From QueryDateParams `validate:"omitempty" url:"from,omitempty"` To QueryDateParams `validate:"omitempty" url:"to,omitempty"` }
type OptionalDatePayload ¶
type OptionalDatePayload struct { From PayloadDateParams `validate:"omitempty" json:"from,omitempty"` To PayloadDateParams `validate:"omitempty" json:"to,omitempty"` }
type Pagination ¶
type PaginationParams ¶
type PaginationPayload ¶
type PaginationResponse ¶
type PaginationResponse[T any] struct { Items []T `json:"items"` Pagination Pagination `json:"pagination"` }
type PayloadDateParams ¶
func (PayloadDateParams) MarshalJSON ¶
func (dp PayloadDateParams) MarshalJSON() ([]byte, error)
func (*PayloadDateParams) UnmarshalJSON ¶
func (dp *PayloadDateParams) UnmarshalJSON(data []byte) error
type QueryDateParams ¶
func (QueryDateParams) EncodeValues ¶
func (qdp QueryDateParams) EncodeValues(key string, v *url.Values) error
func (QueryDateParams) String ¶
func (qdp QueryDateParams) String() string
type RequiredDateParams ¶
type RequiredDateParams struct { From QueryDateParams `validate:"required" url:"from,omitempty"` To QueryDateParams `validate:"required" url:"to,omitempty"` }
type RequiredDatePayload ¶
type RequiredDatePayload struct { From PayloadDateParams `validate:"required" json:"from,omitempty"` To PayloadDateParams `validate:"required" json:"to,omitempty"` }
type SyncHangupResponse ¶
Click to show internal directories.
Click to hide internal directories.