Documentation ¶
Overview ¶
Package entity TODO.
Package entity TODO.
Package entity TODO.
Package entity TODO.
Package entity TODO.
Package entity TODO.
Index ¶
- Constants
- func IsAssetNotFound(a Asset, err error) bool
- func IsFavoritesNotFound(f Favorites, err error) bool
- func IsUserNotFound(u User, err error) bool
- type Asset
- func (a Asset) AssetType() AssetType
- func (a *Asset) Copy() domain.Entity
- func (a Asset) CreatedAt() time.Time
- func (a *Asset) Delete(ctx context.Context, dtf domain.Dft[*Asset], inTransaction func()) (err error)
- func (a *Asset) DeleteArgs() []any
- func (a *Asset) DeleteSQL() string
- func (a *Asset) DeleteTxArgs() domain.TxArgs
- func (a Asset) Deleted() sql.NullBool
- func (a *Asset) FromJSON(data []byte) (err error)
- func (a *Asset) GetArgs() []any
- func (a *Asset) GetByFilterArgs() []any
- func (a *Asset) GetByFilterSQL() string
- func (a *Asset) GetSQL() string
- func (a *Asset) InsertArgs() []any
- func (a *Asset) InsertSQL() string
- func (a Asset) Isin() string
- func (a *Asset) Key() string
- func (a *Asset) String() string
- func (a *Asset) ToJSON() ([]byte, error)
- func (a *Asset) UpdateArgs() []any
- func (a *Asset) UpdateSQL() string
- func (a Asset) UpdatedAt() sql.NullTime
- func (a *Asset) Upsert(ctx context.Context, dtf domain.Dft[*Asset], inTransaction func()) (err error)
- func (a *Asset) UpsertTxArgs() domain.TxArgs
- type AssetType
- func (a *AssetType) Copy() domain.Entity
- func (a AssetType) CreatedAt() time.Time
- func (a *AssetType) Delete(ctx context.Context, repo domain.Repo[*AssetType]) (err error)
- func (a *AssetType) DeleteArgs() []any
- func (a *AssetType) DeleteSQL() string
- func (a AssetType) Deleted() sql.NullBool
- func (a *AssetType) FromJSON(data []byte) (err error)
- func (a *AssetType) GetArgs() []any
- func (a *AssetType) GetByFilterArgs() []any
- func (a *AssetType) GetByFilterSQL() string
- func (a *AssetType) GetSQL() string
- func (a *AssetType) Insert(ctx context.Context, repo domain.Repo[*AssetType]) (err error)
- func (a *AssetType) InsertArgs() []any
- func (a *AssetType) InsertSQL() string
- func (a *AssetType) Key() string
- func (a AssetType) Name() string
- func (a *AssetType) String() string
- func (a *AssetType) ToJSON() ([]byte, error)
- func (a *AssetType) Update(ctx context.Context, repo domain.Repo[*AssetType]) (err error)
- func (a *AssetType) UpdateArgs() []any
- func (a *AssetType) UpdateSQL() string
- func (a AssetType) UpdatedAt() sql.NullTime
- type Favorites
- func GetFavorites(ctx context.Context, repo domain.Repo[*Favorites], isin, upk string) (Favorites, error)
- func GetFavoritesForUser(ctx context.Context, repo domain.Repo[*Favorites], upk string) ([]Favorites, error)
- func MakeFavorites(id uuid.UUID, asset Asset, user User, version sql.NullInt64, a TAttributes) Favorites
- func (f Favorites) Asset() Asset
- func (f *Favorites) Copy() domain.Entity
- func (f Favorites) CreatedAt() time.Time
- func (f *Favorites) Delete(ctx context.Context, dtf domain.Dft[*Favorites], inTransaction func()) (err error)
- func (f *Favorites) DeleteArgs() []any
- func (f *Favorites) DeleteSQL() string
- func (f *Favorites) DeleteTxArgs() domain.TxArgs
- func (f Favorites) Deleted() sql.NullBool
- func (f *Favorites) FromJSON(data []byte) (err error)
- func (f *Favorites) GetArgs() []any
- func (f *Favorites) GetByFilterArgs() []any
- func (f *Favorites) GetByFilterSQL() string
- func (f *Favorites) GetSQL() string
- func (f Favorites) ID() uuid.UUID
- func (f *Favorites) InsertArgs() []any
- func (f *Favorites) InsertSQL() string
- func (f *Favorites) Key() string
- func (f *Favorites) String() string
- func (f Favorites) ToJSON() ([]byte, error)
- func (f *Favorites) Update(ctx context.Context, repo domain.Repo[*Favorites]) (err error)
- func (f *Favorites) UpdateArgs() []any
- func (f *Favorites) UpdateSQL() string
- func (f Favorites) UpdatedAt() sql.NullTime
- func (f *Favorites) Upsert(ctx context.Context, dtf domain.Dft[*Favorites], inTransaction func()) (err error)
- func (f *Favorites) UpsertTxArgs() domain.TxArgs
- func (f Favorites) User() User
- func (f Favorites) Version() sql.NullInt64
- type FavoritesDeleted
- func (f *FavoritesDeleted) Copy() domain.Entity
- func (f *FavoritesDeleted) Delete(ctx context.Context, repo domain.Repo[*FavoritesDeleted]) (err error)
- func (f *FavoritesDeleted) DeleteArgs() []any
- func (f *FavoritesDeleted) DeleteSQL() string
- func (f *FavoritesDeleted) FromJSON(data []byte) (err error)
- func (f *FavoritesDeleted) GetArgs() []any
- func (f *FavoritesDeleted) GetByFilterArgs() []any
- func (f *FavoritesDeleted) GetByFilterSQL() string
- func (f *FavoritesDeleted) GetSQL() string
- func (f *FavoritesDeleted) InsertArgs() []any
- func (f *FavoritesDeleted) InsertSQL() string
- func (f *FavoritesDeleted) Key() string
- func (f *FavoritesDeleted) String() string
- func (f FavoritesDeleted) ToFavorites() *Favorites
- func (f *FavoritesDeleted) ToJSON() ([]byte, error)
- func (f *FavoritesDeleted) Update(ctx context.Context, repo domain.Repo[*FavoritesDeleted]) (err error)
- func (f *FavoritesDeleted) UpdateArgs() []any
- func (f *FavoritesDeleted) UpdateSQL() string
- type JsonNullBool
- type JsonNullTime
- type TAttributes
- type User
- func (u *User) Copy() domain.Entity
- func (u User) CreatedAt() time.Time
- func (u *User) Delete(ctx context.Context, repo domain.Repo[*User]) (err error)
- func (u *User) DeleteArgs() []any
- func (u *User) DeleteSQL() string
- func (u User) Deleted() sql.NullBool
- func (u *User) FromJSON(data []byte) (err error)
- func (u *User) GetArgs() []any
- func (u *User) GetByFilterArgs() []any
- func (u *User) GetByFilterSQL() string
- func (u *User) GetSQL() string
- func (u *User) Insert(ctx context.Context, repo domain.Repo[*User]) (err error)
- func (u *User) InsertArgs() []any
- func (u *User) InsertSQL() string
- func (u *User) Key() string
- func (u *User) String() string
- func (u *User) ToJSON() ([]byte, error)
- func (u *User) Update(ctx context.Context, repo domain.Repo[*User]) (err error)
- func (u *User) UpdateArgs() []any
- func (u *User) UpdateSQL() string
- func (u User) UpdatedAt() sql.NullTime
- func (u User) Upk() string
- func (u User) Version() int64
Constants ¶
View Source
const ( AssetSelectSQL = `` /* 180-byte string literal not displayed */ AssetSelectByAssetTypeSQL = `` /* 238-byte string literal not displayed */ AssetDeleteSQL = `UPDATE assets SET deleted = true WHERE isin = $1 RETURNING deleted, updated_at` AssetDeleteTxSQL = `UPDATE assets SET deleted = true WHERE isin = $1 RETURNING isin, asset_type, deleted, created_at, updated_at` AssetInsertSQL = `INSERT INTO assets (isin, asset_type, created_at) VALUES ($1, $2, $3) RETURNING isin, asset_type, created_at` AssetUpdateSQL = `UPDATE assets SET asset_type = $2, updated_at = $3 WHERE isin = $1 RETURNING asset_type, updated_at` AssetUpsertTxAssetSQL = `` /* 255-byte string literal not displayed */ AssetUpsertTxAssetTypeSQL = `INSERT INTO asset_types (name, created_at) VALUES ($1, $2) ON CONFLICT (name) DO NOTHING` )
View Source
const ( KeyFormat = "%32s%s" FavoritesSelectSQL = `` /* 414-byte string literal not displayed */ FavoritesSelectForUserSQL = `` /* 505-byte string literal not displayed */ FavoritesDeleteSQL = `` /* 203-byte string literal not displayed */ FavoritesInsertSQL = `` /* 175-byte string literal not displayed */ FavoritesUpdateSQL = `` /* 172-byte string literal not displayed */ FavoritesDeleteTxSQL = `` /* 166-byte string literal not displayed */ FavoritesUpsertTxAssetSQL = `` /* 139-byte string literal not displayed */ FavoritesUpsertTxAssetTypeSQL = `INSERT INTO asset_types (name, created_at) VALUES ($1, $2) ON CONFLICT (name) DO NOTHING` FavoritesUpsertTxUserSQL = `` /* 127-byte string literal not displayed */ FavoritesUpsertTxFavoritesSQL = `` /* 417-byte string literal not displayed */ )
View Source
const ( FavoritesDeletedDeleteForUserSQL = `UPDATE favorites SET deleted = true, version = (SELECT u.version FROM users u WHERE u.upk = $2) WHERE user_upk = $1` FavoritesDeletedSelectForUserSQL = `` /* 442-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func IsAssetNotFound ¶
func IsFavoritesNotFound ¶
func IsUserNotFound ¶
Types ¶
type Asset ¶
type Asset struct { TAttributes // contains filtered or unexported fields }
func (*Asset) DeleteArgs ¶
func (*Asset) DeleteTxArgs ¶
func (*Asset) GetByFilterArgs ¶
func (*Asset) GetByFilterSQL ¶
func (*Asset) InsertArgs ¶
func (*Asset) UpdateArgs ¶
func (*Asset) UpsertTxArgs ¶
type AssetType ¶
type AssetType struct { TAttributes // contains filtered or unexported fields }
func GetAssetType ¶
func MakeAssetType ¶
func MakeAssetType(name string, a TAttributes) AssetType
func (*AssetType) DeleteArgs ¶
func (*AssetType) GetByFilterArgs ¶
func (*AssetType) GetByFilterSQL ¶
func (*AssetType) InsertArgs ¶
func (*AssetType) UpdateArgs ¶
type Favorites ¶
type Favorites struct { TAttributes // contains filtered or unexported fields }
func GetFavorites ¶
func GetFavoritesForUser ¶
func MakeFavorites ¶
func (*Favorites) DeleteArgs ¶
func (*Favorites) DeleteTxArgs ¶
func (*Favorites) GetByFilterArgs ¶
func (*Favorites) GetByFilterSQL ¶
func (*Favorites) InsertArgs ¶
func (*Favorites) UpdateArgs ¶
func (*Favorites) UpsertTxArgs ¶
type FavoritesDeleted ¶
type FavoritesDeleted struct { TAttributes // contains filtered or unexported fields }
func GetFavoritesDeletedForUser ¶
func GetFavoritesDeletedForUser(ctx context.Context, repo domain.Repo[*FavoritesDeleted], upk string) ([]FavoritesDeleted, error)
func MakeFavoritesDeletedUser ¶
func MakeFavoritesDeletedUser(upk string) FavoritesDeleted
func (*FavoritesDeleted) Copy ¶
func (f *FavoritesDeleted) Copy() domain.Entity
func (*FavoritesDeleted) Delete ¶
func (f *FavoritesDeleted) Delete(ctx context.Context, repo domain.Repo[*FavoritesDeleted]) (err error)
func (*FavoritesDeleted) DeleteArgs ¶
func (f *FavoritesDeleted) DeleteArgs() []any
func (*FavoritesDeleted) DeleteSQL ¶
func (f *FavoritesDeleted) DeleteSQL() string
func (*FavoritesDeleted) FromJSON ¶
func (f *FavoritesDeleted) FromJSON(data []byte) (err error)
func (*FavoritesDeleted) GetArgs ¶
func (f *FavoritesDeleted) GetArgs() []any
func (*FavoritesDeleted) GetByFilterArgs ¶
func (f *FavoritesDeleted) GetByFilterArgs() []any
func (*FavoritesDeleted) GetByFilterSQL ¶
func (f *FavoritesDeleted) GetByFilterSQL() string
func (*FavoritesDeleted) GetSQL ¶
func (f *FavoritesDeleted) GetSQL() string
func (*FavoritesDeleted) InsertArgs ¶
func (f *FavoritesDeleted) InsertArgs() []any
func (*FavoritesDeleted) InsertSQL ¶
func (f *FavoritesDeleted) InsertSQL() string
func (*FavoritesDeleted) Key ¶
func (f *FavoritesDeleted) Key() string
func (*FavoritesDeleted) String ¶
func (f *FavoritesDeleted) String() string
func (FavoritesDeleted) ToFavorites ¶
func (f FavoritesDeleted) ToFavorites() *Favorites
func (*FavoritesDeleted) ToJSON ¶
func (f *FavoritesDeleted) ToJSON() ([]byte, error)
func (*FavoritesDeleted) Update ¶
func (f *FavoritesDeleted) Update(ctx context.Context, repo domain.Repo[*FavoritesDeleted]) (err error)
func (*FavoritesDeleted) UpdateArgs ¶
func (f *FavoritesDeleted) UpdateArgs() []any
func (*FavoritesDeleted) UpdateSQL ¶
func (f *FavoritesDeleted) UpdateSQL() string
type JsonNullBool ¶
func FromNullBool ¶
func FromNullBool(b sql.NullBool) JsonNullBool
func (JsonNullBool) MarshalJSON ¶
func (v JsonNullBool) MarshalJSON() ([]byte, error)
func (JsonNullBool) ToNullBool ¶
func (v JsonNullBool) ToNullBool() sql.NullBool
func (*JsonNullBool) UnmarshalJSON ¶
func (v *JsonNullBool) UnmarshalJSON(data []byte) error
type JsonNullTime ¶
func FromNullTime ¶
func FromNullTime(b sql.NullTime) JsonNullTime
func (JsonNullTime) MarshalJSON ¶
func (v JsonNullTime) MarshalJSON() ([]byte, error)
func (JsonNullTime) ToNullTime ¶
func (v JsonNullTime) ToNullTime() sql.NullTime
func (*JsonNullTime) UnmarshalJSON ¶
func (v *JsonNullTime) UnmarshalJSON(data []byte) error
type TAttributes ¶
type TAttributes struct {
// contains filtered or unexported fields
}
func DefaultTAttributes ¶
func DefaultTAttributes() TAttributes
func MakeTAttributes ¶
type User ¶
type User struct { TAttributes // contains filtered or unexported fields }
func MakeUser ¶
func MakeUser(upk string, a TAttributes) User
func MakeUserWithVersion ¶
func MakeUserWithVersion(upk string, version int64, a TAttributes) User
func (*User) DeleteArgs ¶
func (*User) GetByFilterArgs ¶
func (*User) GetByFilterSQL ¶
func (*User) InsertArgs ¶
func (*User) UpdateArgs ¶
Click to show internal directories.
Click to hide internal directories.