dtos

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Text = http.StatusText

	MsgSuccess = map[string]string{"en": "Success", "id": "Sukses"}
	MsgFailed  = map[string]string{"en": "Failed", "id": "Gagal"}
)
View Source
var (
	ErrInvalidUserType = errors.New("invalid user_type")
)

Functions

This section is empty.

Types

type CaptureError

type CaptureError struct {
	Details string `json:"details"`
	Message string `json:"message"`
}

type CreateUserPayload

type CreateUserPayload struct {
	FullName    string `json:"fullname"`
	PhoneNumber string `json:"phone_number"`
}

func (CreateUserPayload) Validate

func (cup CreateUserPayload) Validate() error

type Message

type Message map[string]string

type Response

type Response struct {
	Status  int            `json:"status"`
	Message Message        `json:"message"`
	Errors  []CaptureError `json:"errors,omitempty"`
	Data    interface{}    `json:"data,omitempty"`
	Meta    interface{}    `json:"meta,omitempty"`
	Header  http.Header    `json:"header,omitempty"`
	Body    interface{}    `json:"body,omitempty"`
}

func NewResponse

func NewResponse(statusCode int, message Message, data interface{}) Response

func NewResponseError

func NewResponseError(statusCode int, messageStatus Message, details string) Response

type UpdateUserPayload

type UpdateUserPayload struct {
	Fullname    string `json:"fullname"`
	PhoneNumber string `json:"phone_number"`
	UserType    string `json:"user_type"`
}

func (UpdateUserPayload) Validate

func (cup UpdateUserPayload) Validate() error

type UpdateUserStatusPayload

type UpdateUserStatusPayload struct {
	UserID   int64
	IsActive bool
}

Jump to

Keyboard shortcuts

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