response

package
v0.0.0-...-18998a6 Latest Latest
Warning

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

Go to latest
Published: May 11, 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 BoardsInIndexGroup

type BoardsInIndexGroup struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

BoardsInIndexGroup - グループ一覧用 ボード一覧レスポンス

type CreateBoardList

type CreateBoardList struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Color     string    `json:"color"`
	BoardID   string    `json:"boardId"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

CreateBoardList - ボードリスト登録のレスポンス

type CreateTask

type CreateTask 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"`
	DeadlinedAt     time.Time `json:"deadlinedAt"`
	CreatedAt       time.Time `json:"createdAt"`
	UpdatedAt       time.Time `json:"updatedAt"`
}

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

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 Group

type Group struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	UserIDs       []string  `json:"userIds"`
	BoardIDs      []string  `json:"boardIds"`
	InvitedEmails []string  `json:"invitedEmails"`
	Description   string    `json:"description"`
	CreatedAt     time.Time `firestore:"createdAt"`
	UpdatedAt     time.Time `firestore:"updatedAt"`
}

Group - グループのレスポンス

type GroupInIndexGroup

type GroupInIndexGroup struct {
	ID            string                `json:"id"`
	Name          string                `json:"name"`
	UserIDs       []string              `json:"userIds"`
	Boards        []*BoardsInIndexGroup `json:"boards"`
	InvitedEmails []string              `json:"invitedEmails"`
	Description   string                `json:"description"`
	CreatedAt     time.Time             `firestore:"createdAt"`
	UpdatedAt     time.Time             `firestore:"updatedAt"`
}

GroupInIndexGroup - グループ一覧用 グループのレスポンス

type IndexGroups

type IndexGroups struct {
	Groups []*GroupInIndexGroup `json:"groups"`
}

IndexGroups - グループ一覧のレスポンス

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