domain

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	ID              string                `firestore:"id"`
	Name            string                `firestore:"name"`
	IsClosed        bool                  `firestore:"is_closed"`
	ThumbnailURL    string                `firestore:"thumbnail_url"`
	BackgroundColor string                `firestore:"background_color"`
	Labels          []string              `firestore:"labels"`
	GroupID         string                `firestore:"group_id"`
	ListIDs         []string              `firestore:"board_list_ids"`
	Lists           map[string]*BoardList `firestore:"-"`
	CreatedAt       time.Time             `firestore:"created_at"`
	UpdatedAt       time.Time             `firestore:"updated_at"`
}

Board - Boardエンティティ

type BoardList

type BoardList struct {
	ID        string           `firestore:"id"`
	Name      string           `firestore:"name"`
	Color     string           `firestore:"color"`
	BoardID   string           `firestore:"board_id"`
	TaskIDs   []string         `firestore:"task_ids"`
	Tasks     map[string]*Task `firestore:"-"`
	CreatedAt time.Time        `firestore:"created_at"`
	UpdatedAt time.Time        `firestore:"updated_at"`
}

BoardList - BoardListエンティティ

type CustomError

type CustomError struct {
	ErrorCode        ErrorCode
	Value            error
	ValidationErrors []*ValidationError
}

CustomError - エラーコードを含めた構造体

func (CustomError) Code

func (ce CustomError) Code() ErrorCode

Code - エラーコードを返す

func (CustomError) Error

func (ce CustomError) Error() string

Error - エラー内容を返す

func (CustomError) Validation

func (ce CustomError) Validation() []*ValidationError

Validation - エラー詳細を返す

type ErrorCode

type ErrorCode uint

ErrorCode - エラーの種類

const (
	// Unknown - 不明なエラー
	Unknown ErrorCode = iota
	// Unauthorized - 認証エラー
	Unauthorized
	// Forbidden - 権限エラー
	Forbidden
	// NotFound - 取得エラー
	NotFound
	// InvalidDomainValidation - ドメインのバリデーションエラー
	InvalidDomainValidation
	// InvalidRequestValidation - リクエストのバリデーションエラー
	InvalidRequestValidation
	// UnableParseJSON - JSON型から構造体への変換エラー
	UnableParseJSON
	// ErrorInDatastore - データストアでのエラー
	ErrorInDatastore
	// ErrorInStorage - ストレージでのエラー
	ErrorInStorage
	// AlreadyExists - ユニークチェックでのエラー
	AlreadyExists
	// NotEqualRequestWithDatastore - リクエスト値がデータストアの値と一致しない
	NotEqualRequestWithDatastore
)

func (ErrorCode) New

func (ec ErrorCode) New(err error, ves ...*ValidationError) error

New - 指定したErrorCodeを持つCustomErrorを返す

type Group

type Group struct {
	ID            string    `firestore:"id"`
	Name          string    `firestore:"name"`
	Description   string    `firestore:"description"`
	UserIDs       []string  `firestore:"user_ids,omitempty"`
	BoardIDs      []string  `firestore:"-"`
	InvitedEmails []string  `firestore:"invited_emails,omitempty"`
	CreatedAt     time.Time `firestore:"created_at"`
	UpdatedAt     time.Time `firestore:"updated_at"`
}

Group - Groupエンティティ

type ShowError

type ShowError interface {
	Code() ErrorCode
	Error() string
	Validation() []*ValidationError
}

ShowError - エラー内容を返すインターフェース

type Task

type Task struct {
	ID              string    `firestore:"id"`
	Name            string    `firestore:"name"`
	Description     string    `firestore:"description"`
	Labels          []string  `firestore:"labels"`
	AttachmentURLs  []string  `firestore:"attachment_urls"`
	GroupID         string    `firestore:"group_id"`
	BoardID         string    `firestore:"board_id"`
	BoardListID     string    `firestore:"-"`
	AssignedUserIDs []string  `firestore:"assigned_user_ids"`
	CheckListIDs    []string  `firestore:"checklist_ids"`
	CommentIDs      []string  `firestore:"comment_ids"`
	DeadlinedAt     time.Time `firestore:"deadlined_at"`
	CreatedAt       time.Time `firestore:"created_at"`
	UpdatedAt       time.Time `firestore:"updated_at"`
}

Task - Taskエンティティ

type User

type User struct {
	ID           string    `firestore:"id"`
	Email        string    `firestore:"email"`
	Password     string    `firestore:"-"`
	Name         string    `firestore:"name"`
	ThumbnailURL string    `firestore:"thumbnail_url"`
	GroupIDs     []string  `firestore:"group_ids,omitempty"`
	CreatedAt    time.Time `firestore:"created_at"`
	UpdatedAt    time.Time `firestore:"updated_at"`
}

User - Userエンティティ

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError - バリデーションエラー用構造体

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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