domain

package
v0.0.0-...-704a905 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSetUserPlayerState = errors.New("error while set user player state")
	ErrGetUserPlayerState = errors.New("error while get user player state")
	ErrUnmarshal          = errors.New("error while unmarshal user player state")
	ErrDeletePlayerState  = errors.New("error while delete user player state")
)

Functions

This section is empty.

Types

type FromIs

type FromIs string

type TypePushState

type TypePushState string
const (
	PushTrackInQueue        TypePushState = "push_track"
	NewTracksQueue          TypePushState = "new_tracks_queue"
	NewTrackInQueue         TypePushState = "new_track"
	OnPause                 TypePushState = "on_pause"
	OffPause                TypePushState = "off_pause"
	ChangePosition          TypePushState = "change_position"
	NoTrackState            TypePushState = "no_track_state"
	InvalidTrackStateFormat TypePushState = "invalid_format"
	GetPlayerState          TypePushState = "get_player_state"
)

type UserPlayerState

type UserPlayerState struct {
	TracksQueue     []trackProto.TrackDataTransfer `json:"tracks_queue"`
	QueuePosition   int                            `json:"queue_position"`
	OnPause         bool                           `json:"on_pause"`
	LastSecPosition float64                        `json:"last_sec_position"`
	TimeStateUpdate unix.Time_t                    `json:"time_state_update"`
}

type UserPlayerUpdateStateMessage

type UserPlayerUpdateStateMessage struct {
	TypePushState TypePushState   `json:"type_push_state"`
	Data          UserPlayerState `json:"data,omitempty"`
}

сообщения такого типа будут приходить от клиента

type UserSyncPlayerRepo

type UserSyncPlayerRepo interface {
	CreateUserPlayerState(userId uint, state *UserPlayerState) error
	UpdateUserPlayerState(userId uint, state *UserPlayerState) error
	GetUserPlayerState(userId uint) (*UserPlayerState, error)
	DeleteUserPlayerState(userId uint) error
}

type UserSyncPlayerUseCase

type UserSyncPlayerUseCase interface {
	PushTrackUpdateState(userId uint, tracksToAdd []trackProto.TrackDataTransfer) error
	NewTrackQueueUpdateState(userId uint, tracksQueue []trackProto.TrackDataTransfer, queuePosition int, lastSecPosition float64, timeStateUpdate unix.Time_t) error
	NewTrackUpdateState(userId uint, queuePosition int, timeStateUpdate unix.Time_t) error
	OnPauseUpdateState(userId uint, lastSecPosition float64, timeStateUpdate unix.Time_t) error
	OffPauseUpdateState(userId uint, timeStateUpdate unix.Time_t) error
	ChangePositionUpdateState(userId uint, lastSecPosition float64, timeStateUpdate unix.Time_t) error
	GetTrackState(userId uint) (*UserPlayerState, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL