Documentation
¶
Index ¶
- func AddUnique(ctx context.Context, c *redis.Client, key string, value string) *redis.IntCmd
- func CheckUnique(ctx context.Context, c *redis.Client, key string, value string) ([]string, error)
- func DelUnique(ctx context.Context, c *redis.Client, key string, value string) *redis.IntCmd
- func GetIndex(ctx context.Context, c *redis.Client, key string) (int, error)
- func SetIndex(ctx context.Context, c *redis.Client, key string, value int) *redis.Cmd
- type Event
- type EventVO
- type Transaction
- type TransactionVO
- type User
- type UserVO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUnique ¶
Add Unique key
set key uk_user[FieldName] for user table set key uk_event[FieldName] for event table set key uk_transaction[FieldName] for transaction table
func CheckUnique ¶
"*\"fathimzr\"*"
func DelUnique ¶
Remove Unique key
set key uk_user[FieldName] for user table set key uk_event[FieldName] for event table set key uk_transaction[FieldName] for transaction table
Types ¶
type Event ¶
type Event struct { ID int `json:"id" form:"id"` CreatorId int `json:"creator_id" form:"creator_id"` TitleEvent string `json:"title_event" form:"title_event"` LinkWebinar string `json:"link_webinar" form:"link_webinar"` Description string `json:"description" form:"description"` TypeEvent string `json:"type_event" form:"type_event"` Banner string `json:"banner" form:"banner"` Price float64 `json:"price" form:"price"` Quantity int `json:"quantity" form:"quantity"` Status string `json:"status" form:"status"` EventStartDate *time.Time `json:"event_start_date" form:"event_start_date" time_format:"2006-01-02"` EventEndDate *time.Time `json:"event_end_date" form:"event_end_date" time_format:"2006-01-02"` CampaignStartDate *time.Time `json:"campaign_start_date" form:"campaign_start_date" time_format:"2006-01-02"` CampaignEndDate *time.Time `json:"campaign_end_date" form:"campaign_end_date" time_format:"2006-01-02"` DeletedAt gorm.DeletedAt `json:"deleted_at" form:"deleted_at" time_format:"unixNano"` CreatedAt time.Time `json:"created_at" form:"created_at" time_format:"unixNano"` UpdatedAt time.Time `json:"updated_at" form:"updated_at" time_format:"unixNano"` }
type EventVO ¶
type EventVO interface { CreateEvent(ctx context.Context, c *redis.Client) (entity.Event, error) GetEvent(ctx context.Context, c *redis.Client, key string) (entity.Event, error) GetAllEvent(ctx context.Context, c *redis.Client) ([]entity.Event, error) }
func NewEventVO ¶
type Transaction ¶
type Transaction struct { ID int `json:"id,string" form:"id"` ParticipantId int `json:"participant_id,string" form:"participant_id"` CreatorId int `json:"creator_id,string" form:"creator_id"` EventId int `json:"event_id,string" form:"event_id"` Amount float64 `json:"amount,string" form:"amount"` StatusPayment string `json:"status_payment" form:"status_payment"` DeletedAt gorm.DeletedAt `json:"deleted_at" form:"deleted_at" time_format:"unixNano"` CreatedAt time.Time `json:"created_at" form:"created_at" time_format:"unixNano"` UpdatedAt time.Time `json:"updated_at" form:"updated_at" time_format:"unixNano"` }
type TransactionVO ¶
type TransactionVO interface { CreateTransaction(ctx context.Context, c *redis.Client) (entity.Transaction, error) UpdateTransaction(ctx context.Context, c *redis.Client) (entity.Transaction, error) GetTransaction(ctx context.Context, c *redis.Client, key string) (entity.Transaction, error) }
func NewTransactionVO ¶
func NewTransactionVO(trx *entity.Transaction) TransactionVO
type User ¶
type User struct { ID int `json:"id,string"` Username string `json:"username" validate:"username"` Fullname string `json:"fullname"` Email string `json:"email" validate:"email"` // EmailVerifiedAt string `json:"email_verified_at"` Password string `json:"password"` Role string `json:"role"` DeletedAt int64 `json:"deleted_at,string"` CreatedAt int64 `json:"created_at,string"` UpdatedAt int64 `json:"updated_at,string"` }
type UserVO ¶
type UserVO interface { GetUser(ctx context.Context, c *redis.Client, key string) (entity.User, error) GetAllUser(ctx context.Context, c *redis.Client) ([]entity.User, error) InsertUser(ctx context.Context, c *redis.Client) (int64, error) UpdateUser(ctx context.Context, c *redis.Client) (int64, error) FindUser(ctx context.Context, c *redis.Client, value string) error }
Click to show internal directories.
Click to hide internal directories.