response

package
v0.0.0-...-1c0d007 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BadRequest = &ErrorResponse{
		StatusCode: http.StatusBadRequest,
		Message:    "不正なパラメータが入力されています。",
	}

	Unauthorized = &ErrorResponse{
		StatusCode:       http.StatusUnauthorized,
		Message:          "認証に必要な情報がありません。",
		ValidationErrors: nil,
	}

	Forbidden = &ErrorResponse{
		StatusCode:       http.StatusForbidden,
		Message:          "その操作を実行する権限がありません。",
		ValidationErrors: nil,
	}

	NotFound = &ErrorResponse{
		StatusCode:       http.StatusNotFound,
		Message:          "指定の情報が見つかりません。",
		ValidationErrors: nil,
	}

	AlreadyExists = &ErrorResponse{
		StatusCode: http.StatusConflict,
		Message:    "不正なパラメータが入力されています。",
	}

	InternalServerError = &ErrorResponse{
		StatusCode:       http.StatusInternalServerError,
		Message:          "異常な処理が検出されました。",
		ValidationErrors: nil,
	}
)

ステータスコードを付与したエラーレスポンス

Functions

This section is empty.

Types

type Board

type Board struct {
	ID              string    `json:"id"`
	Name            string    `json:"name"`
	IsClosed        bool      `json:"isClosed"`
	ThumbnailURL    string    `json:"thumbnailUrl"`
	BackgroundColor string    `json:"backgroundColor"`
	Labels          []string  `json:"labels"`
	GroupID         string    `json:"groupId"`
	CreatedAt       time.Time `json:"createdAt"`
	UpdatedAt       time.Time `json:"updatedAt"`
}

Board - ボードのレスポンス

type Boards

type Boards struct {
	Boards []*Board `json:"boards"`
}

Boards - ボード一覧のレスポンス

type ErrorResponse

type ErrorResponse struct {
	StatusCode       int                `json:"status"`
	ErrorCode        domain.ErrorCode   `json:"code"`
	Message          string             `json:"message"`
	ValidationErrors []*ValidationError `json:"errors,omitempty"`
}

ErrorResponse - エラーのレスポンス

type ListInShowBoard

type ListInShowBoard struct {
	ID    string             `json:"id"`
	Name  string             `json:"name"`
	Color string             `json:"color"`
	Tasks []*TaskInShowBoard `json:"tasks"`
}

ListInShowBoard - ボード詳細用 リストのレスポンス

type ShowBoard

type ShowBoard struct {
	ID              string             `json:"id"`
	Name            string             `json:"name"`
	IsClosed        bool               `json:"isClosed"`
	ThumbnailURL    string             `json:"thumbnailUrl"`
	BackgroundColor string             `json:"backgroundColor"`
	Labels          []string           `json:"labels"`
	GroupID         string             `json:"groupId"`
	Lists           []*ListInShowBoard `json:"lists"`
	CreatedAt       time.Time          `json:"createdAt"`
	UpdatedAt       time.Time          `json:"updatedAt"`
}

ShowBoard - ボード詳細のレスポンス

type ShowTask

type ShowTask struct {
	ID              string    `json:"id"`
	Name            string    `json:"name"`
	Description     string    `json:"description"`
	Labels          []string  `json:"labels"`
	AttachmentURLs  []string  `json:"attachmentUrls"`
	GroupID         string    `json:"groupID"`
	BoardID         string    `json:"boardId"`
	AssignedUserIDs []string  `json:"assignedUserIds"`
	CheckListIDs    []string  `json:"checklistIds"`
	CommentIDs      []string  `json:"commentIds"`
	DeadlinedAt     time.Time `json:"deadlinedAt"`
	CreatedAt       time.Time `json:"createdAt"`
	UpdatedAt       time.Time `json:"updatedAt"`
}

ShowTask - タスク詳細のレスポンス

type TaskInShowBoard

type TaskInShowBoard struct {
	ID              string    `json:"id"`
	Name            string    `json:"name"`
	Labels          []string  `json:"labels"`
	AssignedUserIDs []string  `json:"assignedUserIds"`
	DeadlinedAt     time.Time `json:"deadlinedAt"`
}

TaskInShowBoard - ボード詳細用 タスクのレスポンス

type ValidationError

type ValidationError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

ValidationError - バリデーションエラーのレスポンス

Jump to

Keyboard shortcuts

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