model

package
v0.0.0-...-2b6f177 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meta

type Meta struct {
	CreatedAt time.Time  `json:"createdAt"` // 作成日時
	CreatedBy string     `json:"createdBy"` // 作成者
	UpdatedAt time.Time  `json:"updatedAt"` // 更新日時
	UpdatedBy string     `json:"updatedBy"` // 更新者
	DeletedAt *time.Time `json:"deletedAt"` // 削除日時
	DeletedBy string     `json:"deletedBy"` // 削除者
	Version   int        `json:"version"`   // 楽観的排他ロック用バージョン
}

Meta - メタ情報

func (*Meta) IsDeleted

func (m *Meta) IsDeleted() bool

IsDeleted - 削除済みかどうかを返す

type User

type User struct {
	ID   string `json:"id"   firestore:"-"` // ID
	Name string `json:"name"`               // ニックネーム
	Age  int    `json:"age"`                // 年齢
	Meta
}

User - ユーザー

func (User) Prepare

func (obj User) Prepare(context.Context) (*User, error)

Prepare - 新規/更新とValidation

Jump to

Keyboard shortcuts

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