Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound means resource not found ErrNotFound = &AppError{Code: "NOT_FOUND", Message: "resource was not found", Status: codes.NotFound} ErrWrongStatus = &AppError{Code: "WRONG_STATUS", Message: "status of resource is wrong", Status: codes.Internal} ErrStale = &AppError{Code: "STALE", Message: "resource is stale. please retry", Status: codes.Internal} )
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct { Code string `json:"code"` Message string `json:"message"` Status codes.Code `json:"status"` Details map[string]interface{} `json:"details"` }
AppError handles application exception.
type Event ¶
type Event struct { ID int64 `gorm:"column:id;primary_key" json:"id"` Title string `gorm:"column:title" json:"title"` Description string `gorm:"column:description" json:"description"` PublishedStatus PublishedStatus `gorm:"column:published_status" json:"published_status"` Version int64 `gorm:"column:version" json:"version"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` }
Event is Event
type EventRepository ¶
type EventRepository interface { WithTX(tx *gorm.DB) EventRepository Event(ctx context.Context, id int64) (Event, error) Events(ctx context.Context, opts FindEventOptions) ([]Event, error) UpdatePublishStatus(ctx context.Context, request UpdateEventStatusRequest) error }
EventRepository represents the event's repository contract
type EventUsecase ¶
type EventUsecase interface { Events(ctx context.Context, opts FindEventOptions) ([]Event, error) UpdatePublishStatus(ctx context.Context, request UpdateEventStatusRequest) error }
EventUsecase represents the wallet's usecases
type FindEventOptions ¶
type FindEventOptions struct { ID int64 `gorm:"column:id;primary_key" json:"id"` Title string `gorm:"column:title" json:"title"` CreatedAtStart time.Time CreatedAtEnd time.Time }
FindEventOptions is a query condition for finding events
func (*FindEventOptions) TableName ¶
func (f *FindEventOptions) TableName() string
type PublishedStatus ¶
type PublishedStatus int32
PublishedStatus identifies event published status.
const ( // Draft ... Draft PublishedStatus = 1 // Published ... Published PublishedStatus = 2 )
type UpdateEventStatusRequest ¶
type UpdateEventStatusRequest struct { EventID int64 TransID string PublishedStatus PublishedStatus Version int64 }
UpdateEventStatusRequest ...
Click to show internal directories.
Click to hide internal directories.