Documentation
¶
Index ¶
- Constants
- Variables
- func ParseDateString(data map[string]interface{}) error
- type Chain
- type Currency
- func (a *Currency) BackToDomain() (domain.IEntity, error)
- func (a *Currency) BeforeCreate() (err error)
- func (a *Currency) BeforeUpdate() (err error)
- func (a *Currency) GetID() string
- func (a *Currency) GetListType() interface{}
- func (a *Currency) GetPreloads() []string
- func (a *Currency) ParseMap(data map[string]interface{}) (IRepoEntity, error)
- func (a *Currency) SetID(id string)
- func (a *Currency) TableName() string
- func (a *Currency) ToJSON() (string, error)
- func (a *Currency) Transform(i domain.IEntity) (IRepoEntity, error)
- func (a *Currency) UnmarshalJSON(data []byte) error
- type Group
- func (a *Group) BackToDomain() (domain.IEntity, error)
- func (a *Group) BeforeCreate() (err error)
- func (a *Group) BeforeUpdate() (err error)
- func (a *Group) GetID() string
- func (a *Group) GetListType() interface{}
- func (a *Group) GetPreloads() []string
- func (a *Group) ParseMap(data map[string]interface{}) (IRepoEntity, error)
- func (a *Group) SetID(id string)
- func (a *Group) TableName() string
- func (a *Group) ToJSON() (string, error)
- func (a *Group) Transform(i domain.IEntity) (IRepoEntity, error)
- func (a *Group) UnmarshalJSON(data []byte) error
- type IRepoEntity
- type List
- type Role
- func (a *Role) BackToDomain() (domain.IEntity, error)
- func (a *Role) BeforeCreate() (err error)
- func (a *Role) BeforeUpdate() (err error)
- func (a *Role) GetID() string
- func (a *Role) GetListType() interface{}
- func (a *Role) GetPreloads() []string
- func (a *Role) ParseMap(data map[string]interface{}) (IRepoEntity, error)
- func (a *Role) SetID(id string)
- func (a *Role) TableName() string
- func (a *Role) ToJSON() (string, error)
- func (a *Role) Transform(i domain.IEntity) (IRepoEntity, error)
- func (a *Role) UnmarshalJSON(data []byte) error
- type User
- func (a *User) BackToDomain() (domain.IEntity, error)
- func (a *User) BeforeCreate() (err error)
- func (a *User) BeforeUpdate() (err error)
- func (a *User) GetID() string
- func (a *User) GetListType() interface{}
- func (a *User) GetPreloads() []string
- func (a *User) ParseMap(data map[string]interface{}) (IRepoEntity, error)
- func (a *User) SetID(id string)
- func (a *User) TableName() string
- func (a *User) ToJSON() (string, error)
- func (a *User) Transform(i domain.IEntity) (IRepoEntity, error)
- func (a *User) UnmarshalJSON(data []byte) error
- type Wallet
- func (a *Wallet) BackToDomain() (domain.IEntity, error)
- func (a *Wallet) BeforeCreate() (err error)
- func (a *Wallet) BeforeUpdate() (err error)
- func (a *Wallet) GetID() string
- func (a *Wallet) GetListType() interface{}
- func (a *Wallet) GetPreloads() []string
- func (a *Wallet) ParseMap(data map[string]interface{}) (IRepoEntity, error)
- func (a *Wallet) SetID(id string)
- func (a *Wallet) TableName() string
- func (a *Wallet) ToJSON() (string, error)
- func (a *Wallet) Transform(i domain.IEntity) (IRepoEntity, error)
- func (a *Wallet) UnmarshalJSON(data []byte) error
- type WalletBalance
- func (a *WalletBalance) BackToDomain() (domain.IEntity, error)
- func (a *WalletBalance) BeforeCreate() (err error)
- func (a *WalletBalance) BeforeUpdate() (err error)
- func (a *WalletBalance) GetID() string
- func (a *WalletBalance) GetListType() interface{}
- func (a *WalletBalance) GetPreloads() []string
- func (a *WalletBalance) ParseMap(data map[string]interface{}) (IRepoEntity, error)
- func (a *WalletBalance) SetID(id string)
- func (a *WalletBalance) TableName() string
- func (a *WalletBalance) ToJSON() (string, error)
- func (a *WalletBalance) Transform(i domain.IEntity) (IRepoEntity, error)
- func (a *WalletBalance) UnmarshalJSON(data []byte) error
Constants ¶
View Source
const ( ErrorCodeDtoBase = domainerrors.ErrorCodeInfraDTO + domainerrors.ErrorCodeInfraDTO + domainerrors.ErrorCodeInfraDTOBase + iota ErrorCodeTransform ErrorCodeBackToDomain ErrorCodeToJSON ErrorCodeDecodeJSON ErrorCodeInvalidFilterField ErrorCodeInvalidOrderField ErrorCodeParseMap )
Variables ¶
View Source
var ( ErrParesMapFailed = errors.New("parse map failed") ErrCastTypeFailed = errors.New("cast type failed") )
Functions ¶
func ParseDateString ¶
Types ¶
type Currency ¶
type Currency struct { ID string `json:"id" gorm:"primary_key"` Name string `json:"name"` Symbol string `json:"symbol"` WalletBalances []WalletBalance CreatedAt time.Time `json:"created_at" mapstructure:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at" mapstructure:"updated_at" gorm:"column:updated_at"` DeletedAt *gorm.DeletedAt `json:"deleted_at" mapstructure:"deleted_at" gorm:"index;column:deleted_at"` }
func (*Currency) BeforeCreate ¶
func (*Currency) BeforeUpdate ¶
func (*Currency) GetListType ¶
func (a *Currency) GetListType() interface{}
func (*Currency) GetPreloads ¶
func (*Currency) ParseMap ¶
func (a *Currency) ParseMap(data map[string]interface{}) (IRepoEntity, error)
func (*Currency) UnmarshalJSON ¶
type Group ¶
type Group struct { ID string `json:"id" gorm:"primary_key"` Name string `json:"name"` Description string `json:"description"` Users []User `json:"users" gorm:"foreignKey:GroupID"` OwnerID string `json:"ownerId"` Metadata string `json:"metadata"` CreatedAt time.Time `json:"created_at" mapstructure:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at" mapstructure:"updated_at" gorm:"column:updated_at"` DeletedAt *gorm.DeletedAt `json:"deleted_at" mapstructure:"deleted_at" gorm:"index;column:deleted_at"` }
func (*Group) BeforeCreate ¶
func (*Group) BeforeUpdate ¶
func (*Group) GetListType ¶
func (a *Group) GetListType() interface{}
func (*Group) GetPreloads ¶
func (*Group) UnmarshalJSON ¶
type IRepoEntity ¶
type IRepoEntity interface { // domain.IEntity TableName() string Transform(domain.IEntity) (IRepoEntity, error) BackToDomain() (domain.IEntity, error) ParseMap(map[string]interface{}) (IRepoEntity, error) ToJSON() (string, error) UnmarshalJSON([]byte) error GetListType() interface{} GetPreloads() []string // Hook BeforeCreate() error BeforeUpdate() error GetID() string SetID(string) }
type List ¶
type List struct { Limit int `json:"limit"` Offset int `json:"offset"` Total int `json:"total"` Data interface{} `json:"data"` }
func (*List) BackToDomain ¶
func (l *List) BackToDomain(model IRepoEntity) (*domain.List, error)
type Role ¶
type Role struct { ID string `json:"id" gorm:"type:varchar(20);primary_key"` Name string `json:"name"` Description string `json:"description"` Permissions pq.StringArray `json:"permissions" gorm:"type:varchar(100)[]"` Users []User `json:"users" gorm:"many2many:user_roles;"` CreatedAt time.Time `json:"created_at" mapstructure:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at" mapstructure:"updated_at" gorm:"column:updated_at"` DeletedAt *gorm.DeletedAt `json:"deleted_at" mapstructure:"deleted_at" gorm:"index;column:deleted_at"` }
func (*Role) BeforeCreate ¶
func (*Role) BeforeUpdate ¶
func (*Role) GetListType ¶
func (a *Role) GetListType() interface{}
func (*Role) GetPreloads ¶
func (*Role) UnmarshalJSON ¶
type User ¶
type User struct { ID string `json:"id" gorm:"primary_key"` Username string `json:"username"` Password string `json:"password"` EMail string `json:"email"` DisplayName string `json:"display_name"` Avatar string `json:"avatar"` Enabled bool `json:"enabled"` Roles []Role `json:"roles" gorm:"many2many:user_roles;"` Wallets []Wallet `json:"wallets" gorm:"foreignKey:UserID"` Group Group `json:"group"` GroupID string `json:"groupId" gorm:"index"` CreatedAt time.Time `json:"created_at" mapstructure:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at" mapstructure:"updated_at" gorm:"column:updated_at"` DeletedAt *gorm.DeletedAt `json:"deleted_at" mapstructure:"deleted_at" gorm:"index;column:deleted_at"` }
func (*User) BeforeCreate ¶
func (*User) BeforeUpdate ¶
func (*User) GetListType ¶
func (a *User) GetListType() interface{}
func (*User) GetPreloads ¶
func (*User) UnmarshalJSON ¶
type Wallet ¶
type Wallet struct { ID string `json:"id" gorm:"primary_key"` Name string `json:"name"` Description string `json:"description"` Chain Chain `json:"chain"` Address string `json:"address"` UserID string `json:"userId" gorm:"index"` WalletBalances []WalletBalance `json:"walletBalances" gorm:"foreignKey:WalletID"` CreatedAt time.Time `json:"created_at" mapstructure:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at" mapstructure:"updated_at" gorm:"column:updated_at"` DeletedAt *gorm.DeletedAt `json:"deleted_at" mapstructure:"deleted_at" gorm:"index;column:deleted_at"` }
func (*Wallet) BeforeCreate ¶
func (*Wallet) BeforeUpdate ¶
func (*Wallet) GetListType ¶
func (a *Wallet) GetListType() interface{}
func (*Wallet) GetPreloads ¶
func (*Wallet) ParseMap ¶
func (a *Wallet) ParseMap(data map[string]interface{}) (IRepoEntity, error)
func (*Wallet) UnmarshalJSON ¶
type WalletBalance ¶
type WalletBalance struct { ID string `json:"id" gorm:"primary_key"` WalletID string `json:"walletId" gorm:"index"` CurrencyID string `json:"currencyId" gorm:"index"` Balance uint `json:"balance"` Decimal uint `json:"decimal"` CreatedAt time.Time `json:"created_at" mapstructure:"created_at" gorm:"column:created_at"` UpdatedAt time.Time `json:"updated_at" mapstructure:"updated_at" gorm:"column:updated_at"` DeletedAt *gorm.DeletedAt `json:"deleted_at" mapstructure:"deleted_at" gorm:"index;column:deleted_at"` }
func (*WalletBalance) BackToDomain ¶
func (a *WalletBalance) BackToDomain() (domain.IEntity, error)
func (*WalletBalance) BeforeCreate ¶
func (a *WalletBalance) BeforeCreate() (err error)
func (*WalletBalance) BeforeUpdate ¶
func (a *WalletBalance) BeforeUpdate() (err error)
func (*WalletBalance) GetID ¶
func (a *WalletBalance) GetID() string
func (*WalletBalance) GetListType ¶
func (a *WalletBalance) GetListType() interface{}
func (*WalletBalance) GetPreloads ¶
func (a *WalletBalance) GetPreloads() []string
func (*WalletBalance) ParseMap ¶
func (a *WalletBalance) ParseMap(data map[string]interface{}) (IRepoEntity, error)
func (*WalletBalance) SetID ¶
func (a *WalletBalance) SetID(id string)
func (*WalletBalance) TableName ¶
func (a *WalletBalance) TableName() string
func (*WalletBalance) ToJSON ¶
func (a *WalletBalance) ToJSON() (string, error)
func (*WalletBalance) Transform ¶
func (a *WalletBalance) Transform(i domain.IEntity) (IRepoEntity, error)
func (*WalletBalance) UnmarshalJSON ¶
func (a *WalletBalance) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.