Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddStoryRequest ¶
type AddStoryRequest struct {
ID types.ID `json:"-"`
CreatorID types.ID `json:"-"`
MediaFileID types.ID `json:"media_file_id"`
Title string `json:"title"`
Caption string `json:"caption"`
LinkURL string `json:"link_url"`
LinkText string `json:"link_text"`
DurationSeconds int `json:"duration_seconds"`
PublishAt time.Time `json:"publish_at"`
ExpiresAt time.Time `json:"expires_at"`
}
type AddStoryResponse ¶
type AddStoryResponse struct {
Story
}
type Repository ¶
type Repository interface {
SaveStory(ctx context.Context, req AddStoryRequest) (Story, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(repo Repository, vld Validate, storageService StorageService, tokenManager *tokenmanager.TokenManager, logger *slog.Logger) Service
func (Service) AddStory ¶
func (s Service) AddStory(ctx context.Context, req AddStoryRequest, creatorID types.ID) (AddStoryResponse, error)
type StorageService ¶
type StorageService interface {
GetFileInfo(ctx context.Context, req *storagepb.GetFileInfoRequest, opts ...grpc.CallOption) (*storagepb.File, error)
ConfirmFile(ctx context.Context, req *storagepb.ConfirmFileRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}
type Story ¶
type Story struct {
ID types.ID `json:"id"`
MediaFileID types.ID `json:"media_file_id"`
Title string `json:"title"`
Caption string `json:"caption"`
LinkURL string `json:"link_url"`
LinkText string `json:"link_text"`
DurationSeconds int `json:"duration_seconds"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
PublishAt time.Time `json:"publish_at"`
ExpiresAt time.Time `json:"expires_at"`
CreatorID types.ID `json:"creator_id"`
IsViewed bool `json:"is_viewed"`
}
type Validate ¶
type Validate struct {
// contains filtered or unexported fields
}
func NewValidate ¶
func NewValidate(t *translation.Translate) Validate
func (Validate) ValidateAddStoryRequest ¶
func (v Validate) ValidateAddStoryRequest(req AddStoryRequest) error
Click to show internal directories.
Click to hide internal directories.