persistence

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() model.DataStore

func NewAlbumRepository

func NewAlbumRepository(ctx context.Context, o orm.Ormer) model.AlbumRepository

func NewArtistRepository

func NewArtistRepository(ctx context.Context, o orm.Ormer) model.ArtistRepository

func NewGenreRepository

func NewGenreRepository(ctx context.Context, o orm.Ormer) model.GenreRepository

func NewMediaFileRepository

func NewMediaFileRepository(ctx context.Context, o orm.Ormer) *mediaFileRepository

func NewMediaFolderRepository

func NewMediaFolderRepository(ctx context.Context, o orm.Ormer) model.MediaFolderRepository

func NewPlayerRepository added in v0.10.0

func NewPlayerRepository(ctx context.Context, o orm.Ormer) model.PlayerRepository

func NewPlaylistRepository

func NewPlaylistRepository(ctx context.Context, o orm.Ormer) model.PlaylistRepository

func NewPropertyRepository

func NewPropertyRepository(ctx context.Context, o orm.Ormer) model.PropertyRepository

func NewTranscodingRepository added in v0.10.0

func NewTranscodingRepository(ctx context.Context, o orm.Ormer) model.TranscodingRepository

func NewUserRepository

func NewUserRepository(ctx context.Context, o orm.Ormer) model.UserRepository

func ToStruct added in v0.5.0

func ToStruct(m map[string]interface{}, rec interface{}, fieldNames []string) error

Types

type MockAlbum

type MockAlbum struct {
	model.AlbumRepository

	Options model.QueryOptions
	// contains filtered or unexported fields
}

func CreateMockAlbumRepo

func CreateMockAlbumRepo() *MockAlbum

func (*MockAlbum) Exists

func (m *MockAlbum) Exists(id string) (bool, error)

func (*MockAlbum) FindByArtist

func (m *MockAlbum) FindByArtist(artistId string) (model.Albums, error)

func (*MockAlbum) Get

func (m *MockAlbum) Get(id string) (*model.Album, error)

func (*MockAlbum) GetAll

func (m *MockAlbum) GetAll(qo ...model.QueryOptions) (model.Albums, error)

func (*MockAlbum) SetData

func (m *MockAlbum) SetData(j string, size int)

func (*MockAlbum) SetError

func (m *MockAlbum) SetError(err bool)

type MockArtist

type MockArtist struct {
	model.ArtistRepository
	// contains filtered or unexported fields
}

func CreateMockArtistRepo

func CreateMockArtistRepo() *MockArtist

func (*MockArtist) Exists

func (m *MockArtist) Exists(id string) (bool, error)

func (*MockArtist) Get

func (m *MockArtist) Get(id string) (*model.Artist, error)

func (*MockArtist) SetData

func (m *MockArtist) SetData(j string, size int)

func (*MockArtist) SetError

func (m *MockArtist) SetError(err bool)

type MockDataStore

type MockDataStore struct {
	MockedGenre       model.GenreRepository
	MockedAlbum       model.AlbumRepository
	MockedArtist      model.ArtistRepository
	MockedMediaFile   model.MediaFileRepository
	MockedUser        model.UserRepository
	MockedPlayer      model.PlayerRepository
	MockedTranscoding model.TranscodingRepository
}

func (*MockDataStore) Album

func (*MockDataStore) Artist

func (*MockDataStore) GC added in v0.5.0

func (db *MockDataStore) GC(ctx context.Context) error

func (*MockDataStore) Genre

func (*MockDataStore) MediaFile

func (*MockDataStore) MediaFolder

func (*MockDataStore) Player added in v0.10.0

func (*MockDataStore) Playlist

func (*MockDataStore) Property

func (*MockDataStore) Resource

func (db *MockDataStore) Resource(ctx context.Context, m interface{}) model.ResourceRepository

func (*MockDataStore) Transcoding added in v0.10.0

func (*MockDataStore) User

func (*MockDataStore) WithTx

func (db *MockDataStore) WithTx(block func(db model.DataStore) error) error

type MockMediaFile

type MockMediaFile struct {
	model.MediaFileRepository
	// contains filtered or unexported fields
}

func CreateMockMediaFileRepo

func CreateMockMediaFileRepo() *MockMediaFile

func (*MockMediaFile) Exists

func (m *MockMediaFile) Exists(id string) (bool, error)

func (*MockMediaFile) FindByAlbum

func (m *MockMediaFile) FindByAlbum(artistId string) (model.MediaFiles, error)

func (*MockMediaFile) Get

func (m *MockMediaFile) Get(id string) (*model.MediaFile, error)

func (*MockMediaFile) SetData

func (m *MockMediaFile) SetData(j string, size int)

func (*MockMediaFile) SetError

func (m *MockMediaFile) SetError(err bool)

type SQLStore

type SQLStore struct {
	// contains filtered or unexported fields
}

func (*SQLStore) Album

func (*SQLStore) Artist

func (*SQLStore) GC added in v0.5.0

func (s *SQLStore) GC(ctx context.Context) error

func (*SQLStore) Genre

func (*SQLStore) MediaFile

func (s *SQLStore) MediaFile(ctx context.Context) model.MediaFileRepository

func (*SQLStore) MediaFolder

func (s *SQLStore) MediaFolder(ctx context.Context) model.MediaFolderRepository

func (*SQLStore) Player added in v0.10.0

func (*SQLStore) Playlist

func (s *SQLStore) Playlist(ctx context.Context) model.PlaylistRepository

func (*SQLStore) Property

func (s *SQLStore) Property(ctx context.Context) model.PropertyRepository

func (*SQLStore) Resource

func (s *SQLStore) Resource(ctx context.Context, m interface{}) model.ResourceRepository

func (*SQLStore) Transcoding added in v0.10.0

func (s *SQLStore) Transcoding(ctx context.Context) model.TranscodingRepository

func (*SQLStore) User

func (*SQLStore) WithTx

func (s *SQLStore) WithTx(block func(tx model.DataStore) error) error

Jump to

Keyboard shortcuts

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