Documentation ¶
Index ¶
- type AlbumSize
- type AlbumSizeDiff
- type AlbumView
- type Availability
- type CommandHandlerAlbumSize
- func (c *CommandHandlerAlbumSize) AlbumShared(ctx context.Context, albumId catalog.AlbumId, userId usermodel.UserId) error
- func (c *CommandHandlerAlbumSize) AlbumUnShared(ctx context.Context, albumId catalog.AlbumId, userId usermodel.UserId) error
- func (c *CommandHandlerAlbumSize) OnMediasInserted(ctx context.Context, medias map[catalog.AlbumId][]catalog.MediaId) error
- func (c *CommandHandlerAlbumSize) OnTransferredMedias(ctx context.Context, transfers catalog.TransferredMedias) error
- type FindAlbumByOwnerFunc
- type FindAlbumByOwnerPort
- type FindAlbumsByIdsFunc
- type FindAlbumsByIdsPort
- type GetAlbumSharingGridFunc
- type GetAlbumSharingGridPort
- type GetAvailabilitiesByUserFunc
- type GetAvailabilitiesByUserPort
- type ListAlbumsFilter
- type ListAlbumsProvider
- type ListAlbumsProviderFunc
- type ListUserWhoCanAccessAlbumPort
- type MediaCounterFromView
- type MediaCounterFunc
- type MediaCounterInjector
- type MediaCounterPort
- type OwnedAlbumListProvider
- type ProviderFactory
- type ProviderFactoryFunc
- type SharedAlbumListProvider
- type SharedWithUserFunc
- type SharedWithUserPort
- type ViewWriteRepository
- type VisibleAlbum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlbumSize ¶ added in v1.6.4
type AlbumSize struct { AlbumId catalog.AlbumId Users []Availability MediaCount int }
type AlbumSizeDiff ¶ added in v1.6.4
type AlbumSizeDiff struct { AlbumId catalog.AlbumId Users []Availability MediaCountDiff int // MediaCountDiff is the difference between the number of media added, or removed, to the album }
type AlbumView ¶
type AlbumView struct {
Providers []ListAlbumsProvider
}
func NewAlbumView ¶ added in v1.5.49
func NewAlbumView( FindAlbumByOwnerPort FindAlbumByOwnerPort, GetAlbumSharingGridPort GetAlbumSharingGridPort, FindAlbumsByIdsPort FindAlbumsByIdsPort, SharedWithUserPort SharedWithUserPort, GetAvailabilitiesByUserPort GetAvailabilitiesByUserPort, ) *AlbumView
func (*AlbumView) ListAlbums ¶
func (v *AlbumView) ListAlbums(ctx context.Context, user usermodel.CurrentUser, filter ListAlbumsFilter) ([]*VisibleAlbum, error)
ListAlbums returns albums visible by the user (owned by current user, and shared to him)
type Availability ¶ added in v1.6.4
type Availability struct { UserId usermodel.UserId AsOwner bool // AsOwner is true if the user is the owner of the album }
func OwnerAvailability ¶ added in v1.6.4
func OwnerAvailability(userId usermodel.UserId) Availability
func VisitorAvailability ¶ added in v1.6.4
func VisitorAvailability(userId usermodel.UserId) Availability
type CommandHandlerAlbumSize ¶ added in v1.6.4
type CommandHandlerAlbumSize struct { MediaCounterPort MediaCounterPort ListUserWhoCanAccessAlbumPort ListUserWhoCanAccessAlbumPort ViewWriteRepository ViewWriteRepository }
func (*CommandHandlerAlbumSize) AlbumShared ¶ added in v1.6.4
func (*CommandHandlerAlbumSize) AlbumUnShared ¶ added in v1.6.4
func (*CommandHandlerAlbumSize) OnMediasInserted ¶ added in v1.6.4
func (*CommandHandlerAlbumSize) OnTransferredMedias ¶ added in v1.6.4
func (c *CommandHandlerAlbumSize) OnTransferredMedias(ctx context.Context, transfers catalog.TransferredMedias) error
type FindAlbumByOwnerFunc ¶ added in v1.5.49
type FindAlbumByOwnerFunc func(ctx context.Context, owner ownermodel.Owner) ([]*catalog.Album, error)
func (FindAlbumByOwnerFunc) FindAlbumsByOwner ¶ added in v1.5.49
func (f FindAlbumByOwnerFunc) FindAlbumsByOwner(ctx context.Context, owner ownermodel.Owner) ([]*catalog.Album, error)
type FindAlbumByOwnerPort ¶
type FindAlbumsByIdsFunc ¶ added in v1.5.49
func (FindAlbumsByIdsFunc) FindAlbumsById ¶ added in v1.5.49
type FindAlbumsByIdsPort ¶
type GetAlbumSharingGridFunc ¶ added in v1.5.49
type GetAlbumSharingGridFunc func(ctx context.Context, owner ownermodel.Owner) (map[catalog.AlbumId][]usermodel.UserId, error)
func (GetAlbumSharingGridFunc) GetAlbumSharingGrid ¶ added in v1.5.49
func (f GetAlbumSharingGridFunc) GetAlbumSharingGrid(ctx context.Context, owner ownermodel.Owner) (map[catalog.AlbumId][]usermodel.UserId, error)
type GetAlbumSharingGridPort ¶ added in v1.5.49
type GetAvailabilitiesByUserFunc ¶ added in v1.6.4
type GetAvailabilitiesByUserFunc func(ctx context.Context, user usermodel.UserId) ([]AlbumSize, error)
func (GetAvailabilitiesByUserFunc) GetAvailabilitiesByUser ¶ added in v1.6.4
type GetAvailabilitiesByUserPort ¶ added in v1.6.4
type ListAlbumsFilter ¶
type ListAlbumsFilter struct {
OnlyDirectlyOwned bool // OnlyDirectlyOwned provides a sub-view where only resources directly owned by user are displayed and accessible
}
type ListAlbumsProvider ¶ added in v1.5.49
type ListAlbumsProvider interface {
ListAlbums(ctx context.Context, user usermodel.CurrentUser, filter ListAlbumsFilter) ([]*VisibleAlbum, error)
}
type ListAlbumsProviderFunc ¶ added in v1.5.49
type ListAlbumsProviderFunc func(ctx context.Context, user usermodel.CurrentUser, filter ListAlbumsFilter) ([]*VisibleAlbum, error)
func (ListAlbumsProviderFunc) ListAlbums ¶ added in v1.5.49
func (f ListAlbumsProviderFunc) ListAlbums(ctx context.Context, user usermodel.CurrentUser, filter ListAlbumsFilter) ([]*VisibleAlbum, error)
type ListUserWhoCanAccessAlbumPort ¶ added in v1.6.4
type MediaCounterFromView ¶ added in v1.6.4
type MediaCounterFromView struct {
AlbumSizes []AlbumSize
}
type MediaCounterFunc ¶ added in v1.5.50
type MediaCounterInjector ¶ added in v1.6.4
type MediaCounterInjector struct { GetAvailabilitiesByUserPort GetAvailabilitiesByUserPort ProviderFactories []ProviderFactory }
MediaCounterInjector is covering the function while the view only contains some of the data (the counts)
func (*MediaCounterInjector) ListAlbums ¶ added in v1.6.4
func (o *MediaCounterInjector) ListAlbums(ctx context.Context, user usermodel.CurrentUser, filter ListAlbumsFilter) ([]*VisibleAlbum, error)
type MediaCounterPort ¶ added in v1.5.50
type OwnedAlbumListProvider ¶ added in v1.5.49
type OwnedAlbumListProvider struct { FindAlbumByOwnerPort FindAlbumByOwnerPort GetAlbumSharingGridPort GetAlbumSharingGridPort MediaCounterPort MediaCounterPort }
func (*OwnedAlbumListProvider) ListAlbums ¶ added in v1.5.49
func (o *OwnedAlbumListProvider) ListAlbums(ctx context.Context, user usermodel.CurrentUser, filter ListAlbumsFilter) ([]*VisibleAlbum, error)
type ProviderFactory ¶ added in v1.6.4
type ProviderFactory interface {
NewProvider(ctx context.Context, mediaCounterPort MediaCounterPort) ListAlbumsProvider
}
type ProviderFactoryFunc ¶ added in v1.6.4
type ProviderFactoryFunc func(ctx context.Context, mediaCounterPort MediaCounterPort) ListAlbumsProvider
func (ProviderFactoryFunc) NewProvider ¶ added in v1.6.4
func (f ProviderFactoryFunc) NewProvider(ctx context.Context, mediaCounterPort MediaCounterPort) ListAlbumsProvider
type SharedAlbumListProvider ¶ added in v1.5.49
type SharedAlbumListProvider struct {}
func (*SharedAlbumListProvider) ListAlbums ¶ added in v1.5.49
func (s *SharedAlbumListProvider) ListAlbums(ctx context.Context, user usermodel.CurrentUser, filter ListAlbumsFilter) ([]*VisibleAlbum, error)
type SharedWithUserFunc ¶ added in v1.5.49
type SharedWithUserFunc func(ctx context.Context, userId usermodel.UserId) ([]catalog.AlbumId, error)
func (SharedWithUserFunc) ListAlbumIdsSharedWithUser ¶ added in v1.5.49
type SharedWithUserPort ¶
type SharedWithUserPort interface {
}type ViewWriteRepository ¶ added in v1.6.4
type VisibleAlbum ¶
type VisibleAlbum struct { catalog.Album MediaCount int // MediaCount is the number of medias on the album Visitors []usermodel.UserId // Visitors are the users that can see the album ; only visible to the owner of the album OwnedByCurrentUser bool // OwnedByCurrentUser is set to true when the user is an owner of the album }
Click to show internal directories.
Click to hide internal directories.