model

package
v0.0.0-...-509b86c Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: MIT Imports: 2 Imported by: 8

Documentation

Index

Constants

View Source
const (
	ErrorProperty = "Property"
	ErrorMessage  = "Message"
)

エラー用の名称。

View Source
const (
	TestName      = "testName"
	TestFeature   = "testFeature, testFeature, testFeature, testFeature, testFeature, testFeature, testFeature"
	TestDBSomeErr = "DB some error"
)

テスト用の定数。

View Source
const (
	DBMethodCreate = "Create"
	DBMethodList   = "List"
	DBMethodRead   = "Read"
	DBMethodUpdate = "Update"
	DBMethodDelete = "Delete"
)

DBの操作。

View Source
const (
	ModelNameProgrammingLang = "ProgrammingLang"
)

モデル名。

View Source
const (
	NameShouldBeMoreThanOneUnderTheTwenty = "Length of Name should be 0 < name < 21"
)

エラー系。

View Source
const (
	PropertyName = "Name"
)

プロパティの名称。

Variables

This section is empty.

Functions

func GetTestTime

func GetTestTime(month time.Month, day int) time.Time

GetTestTime は、テスト用の時刻を生成し、返す。

Types

type AlreadyExistError

type AlreadyExistError struct {
	ID        int
	Name      string
	ModelName string
}

AlreadyExistError は、既に存在することを表すエラー。

func (*AlreadyExistError) Error

func (e *AlreadyExistError) Error() string

Error は、エラーメッセージを返却する。

type DBError

type DBError struct {
	ModelName string
	DBMethod  string
	Detail    string
}

DBError は、DBのエラーを表す。

func (*DBError) Error

func (e *DBError) Error() string

Error は、エラー文を返す。

type InvalidParameterError

type InvalidParameterError struct {
	Parameter string
	Message   string
}

InvalidParameterError は、Parameterが不適切な場合のエラー。

func (*InvalidParameterError) Error

func (e *InvalidParameterError) Error() string

Error は、エラー文を返す。

type InvalidPropertyError

type InvalidPropertyError struct {
	Property string
	Message  string
}

InvalidPropertyError は、Propertyが不適切な場合のエラー。

func (*InvalidPropertyError) Error

func (e *InvalidPropertyError) Error() string

Error は、エラー文を返す。

type NoSuchDataError

type NoSuchDataError struct {
	ID        int
	Name      string
	ModelName string
}

NoSuchDataError は、データが存在しないことを表すエラー。

func (*NoSuchDataError) Error

func (e *NoSuchDataError) Error() string

Error は、エラーメッセージを返す。

type ProgrammingLang

type ProgrammingLang struct {
	ID        int       `json:"id"`
	Name      string    `json:"name"`
	Feature   string    `json:"feature"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

ProgrammingLang は、プログラミング言語を表す。

func CreateProgrammingLangs

func CreateProgrammingLangs(num int) []*ProgrammingLang

CreateProgrammingLangs は、引数で与えられた数だけProgrammingLangを生成し、返す。

type RequiredError

type RequiredError struct {
	Property string
}

RequiredError は、必要なものが存在しない場合のエラー。

func (*RequiredError) Error

func (e *RequiredError) Error() string

Error は、エラー文を返す。

Jump to

Keyboard shortcuts

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