Documentation ¶
Overview ¶
Package storage provides database-related implementations.
Index ¶
- Constants
- type AlbumImage
- type AlbumRepository
- func (ir *AlbumRepository) Add(ctx context.Context, value V) error
- func (r *AlbumRepository) AddImages(ctx context.Context, albumHash uniq.Hash, imageHashes ...uniq.Hash) error
- func (ir *AlbumRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (r *AlbumRepository) DeleteImages(ctx context.Context, albumHash uniq.Hash, imageHashes ...uniq.Hash) error
- func (ir *AlbumRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *AlbumRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *AlbumRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *AlbumRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *AlbumRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (r *AlbumRepository) FindByName(ctx context.Context, name string) (photo.Album, error)
- func (r *AlbumRepository) FindImages(ctx context.Context, albumHash uniq.Hash) ([]photo.Image, error)
- func (r *AlbumRepository) FindPreviewImages(ctx context.Context, albumHash uniq.Hash, coverImage uniq.Hash, limit uint64) ([]photo.Image, error)
- func (r *AlbumRepository) PhotoAlbumDeleter() uniq.Deleter[photo.Album]
- func (r *AlbumRepository) PhotoAlbumEnsurer() uniq.Ensurer[photo.Album]
- func (r *AlbumRepository) PhotoAlbumFinder() uniq.Finder[photo.Album]
- func (r *AlbumRepository) PhotoAlbumImageAdder() photo.AlbumImageAdder
- func (r *AlbumRepository) PhotoAlbumImageDeleter() photo.AlbumImageDeleter
- func (r *AlbumRepository) PhotoAlbumImageFinder() photo.AlbumImageFinder
- func (r *AlbumRepository) PhotoAlbumUpdater() uniq.Updater[photo.Album]
- func (ir *AlbumRepository) Update(ctx context.Context, value V) error
- type ExifRepository
- func (ir *ExifRepository) Add(ctx context.Context, value V) error
- func (ir *ExifRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *ExifRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *ExifRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *ExifRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *ExifRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *ExifRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (ir *ExifRepository) PhotoExifEnsurer() uniq.Ensurer[photo.Exif]
- func (ir *ExifRepository) PhotoExifFinder() uniq.Finder[photo.Exif]
- func (ir *ExifRepository) Update(ctx context.Context, value V) error
- type GpsRepository
- func (ir *GpsRepository) Add(ctx context.Context, value V) error
- func (ir *GpsRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *GpsRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *GpsRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *GpsRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *GpsRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *GpsRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (ir *GpsRepository) PhotoGpsEnsurer() uniq.Ensurer[photo.Gps]
- func (ir *GpsRepository) PhotoGpsFinder() uniq.Finder[photo.Gps]
- func (ir *GpsRepository) Update(ctx context.Context, value V) error
- type GpxRepository
- func (ir *GpxRepository) Add(ctx context.Context, value V) error
- func (ir *GpxRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *GpxRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *GpxRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *GpxRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *GpxRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *GpxRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (ir *GpxRepository) PhotoGpxEnsurer() uniq.Ensurer[photo.Gpx]
- func (ir *GpxRepository) PhotoGpxFinder() uniq.Finder[photo.Gpx]
- func (ir *GpxRepository) PhotoGpxUpdater() uniq.Updater[photo.Gpx]
- func (ir *GpxRepository) Update(ctx context.Context, value V) error
- type ImageRepository
- func (ir *ImageRepository) Add(ctx context.Context, value V) error
- func (ir *ImageRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *ImageRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *ImageRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *ImageRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *ImageRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *ImageRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (ir *ImageRepository) PhotoImageEnsurer() uniq.Ensurer[photo.Image]
- func (ir *ImageRepository) PhotoImageFinder() uniq.Finder[photo.Image]
- func (ir *ImageRepository) PhotoImageUpdater() uniq.Updater[photo.Image]
- func (ir *ImageRepository) Update(ctx context.Context, value V) error
- type MessageRepository
- func (ir *MessageRepository) Add(ctx context.Context, value V) error
- func (ir *MessageRepository) CommentMessageEnsurer() uniq.Ensurer[comment.Message]
- func (ir *MessageRepository) CommentMessageFinder() uniq.Finder[comment.Message]
- func (ir *MessageRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *MessageRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *MessageRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *MessageRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *MessageRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *MessageRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (ir *MessageRepository) Update(ctx context.Context, value V) error
- type SettingsRepository
- type ThreadRepository
- func (ir *ThreadRepository) Add(ctx context.Context, value V) error
- func (ir *ThreadRepository) CommentThreadEnsurer() uniq.Ensurer[comment.Thread]
- func (ir *ThreadRepository) CommentThreadFinder() uniq.Finder[comment.Thread]
- func (ir *ThreadRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *ThreadRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *ThreadRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *ThreadRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *ThreadRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *ThreadRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (ir *ThreadRepository) Update(ctx context.Context, value V) error
- type ThumbRepository
- func (ir *ThumbRepository) Add(ctx context.Context, value V) error
- func (ir *ThumbRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *ThumbRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *ThumbRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (tr *ThumbRepository) Find(ctx context.Context, imageHash uniq.Hash, width, height uint) (photo.Thumb, error)
- func (ir *ThumbRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *ThumbRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *ThumbRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (tr *ThumbRepository) FindLarger(ctx context.Context, imageHash uniq.Hash, width, height uint) (photo.Thumb, error)
- func (tr *ThumbRepository) PhotoThumbnailer() photo.Thumbnailer
- func (tr *ThumbRepository) Thumbnail(ctx context.Context, img photo.Image, size photo.ThumbSize) (photo.Thumb, error)
- func (ir *ThumbRepository) Update(ctx context.Context, value V) error
- type VisitorRepository
- func (ir *VisitorRepository) Add(ctx context.Context, value V) error
- func (ir *VisitorRepository) Delete(ctx context.Context, h uniq.Hash) error
- func (ir *VisitorRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
- func (ir *VisitorRepository) Exists(ctx context.Context, hash uniq.Hash) (bool, error)
- func (ir *VisitorRepository) FindAll(ctx context.Context) ([]V, error)
- func (ir *VisitorRepository) FindByHash(ctx context.Context, hash uniq.Hash) (V, error)
- func (ir *VisitorRepository) FindByHashes(ctx context.Context, hashes ...uniq.Hash) ([]V, error)
- func (ir *VisitorRepository) SiteVisitorEnsurer() uniq.Ensurer[site.Visitor]
- func (ir *VisitorRepository) SiteVisitorFinder() uniq.Finder[site.Visitor]
- func (ir *VisitorRepository) Update(ctx context.Context, value V) error
Constants ¶
View Source
const ( // AlbumTable is the name of the table. AlbumTable = "album" // AlbumImageTable is the name of the table. AlbumImageTable = "album_image" )
View Source
const ErrMissingHash = ctxd.SentinelError("missing hash")
View Source
const (
// ExifTable is the name of the table.
ExifTable = "exif"
)
View Source
const (
// GpsTable is the name of the table.
GpsTable = "gps"
)
View Source
const (
// GpxTable is the name of the table.
GpxTable = "gpx"
)
View Source
const (
// ImageTable is the name of the table.
ImageTable = "image"
)
View Source
const (
// MessageTable is the name of the table.
MessageTable = "message"
)
View Source
const (
// SettingsTable is the name of the table.
SettingsTable = "settings"
)
View Source
const (
// ThreadTable is the name of the table.
ThreadTable = "thread"
)
View Source
const (
// ThumbTable is the name of the table.
ThumbTable = "thumb"
)
View Source
const (
// VisitorTable is the name of the table.
VisitorTable = "visitor"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlbumImage ¶
type AlbumImage struct { AlbumHash uniq.Hash `db:"album_hash"` ImageHash uniq.Hash `db:"image_hash"` }
AlbumImage describes database mapping.
type AlbumRepository ¶
type AlbumRepository struct {
// contains filtered or unexported fields
}
AlbumRepository saves images to database.
func NewAlbumRepository ¶
func NewAlbumRepository(storage *sqluct.Storage, ir *ImageRepository) *AlbumRepository
func (*AlbumRepository) DeleteImages ¶
func (*AlbumRepository) Ensure ¶
func (ir *AlbumRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*AlbumRepository) FindByHash ¶
func (*AlbumRepository) FindByHashes ¶
func (*AlbumRepository) FindByName ¶
func (*AlbumRepository) FindImages ¶
func (*AlbumRepository) FindPreviewImages ¶
func (*AlbumRepository) PhotoAlbumDeleter ¶
func (r *AlbumRepository) PhotoAlbumDeleter() uniq.Deleter[photo.Album]
func (*AlbumRepository) PhotoAlbumEnsurer ¶
func (r *AlbumRepository) PhotoAlbumEnsurer() uniq.Ensurer[photo.Album]
func (*AlbumRepository) PhotoAlbumFinder ¶
func (r *AlbumRepository) PhotoAlbumFinder() uniq.Finder[photo.Album]
func (*AlbumRepository) PhotoAlbumImageAdder ¶
func (r *AlbumRepository) PhotoAlbumImageAdder() photo.AlbumImageAdder
func (*AlbumRepository) PhotoAlbumImageDeleter ¶
func (r *AlbumRepository) PhotoAlbumImageDeleter() photo.AlbumImageDeleter
func (*AlbumRepository) PhotoAlbumImageFinder ¶
func (r *AlbumRepository) PhotoAlbumImageFinder() photo.AlbumImageFinder
func (*AlbumRepository) PhotoAlbumUpdater ¶
func (r *AlbumRepository) PhotoAlbumUpdater() uniq.Updater[photo.Album]
type ExifRepository ¶
type ExifRepository struct {
// contains filtered or unexported fields
}
ExifRepository saves images to database.
func NewExifRepository ¶
func NewExifRepository(storage *sqluct.Storage) *ExifRepository
func (*ExifRepository) Ensure ¶
func (ir *ExifRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*ExifRepository) FindByHash ¶
func (*ExifRepository) FindByHashes ¶
func (*ExifRepository) PhotoExifEnsurer ¶
func (ir *ExifRepository) PhotoExifEnsurer() uniq.Ensurer[photo.Exif]
func (*ExifRepository) PhotoExifFinder ¶
func (ir *ExifRepository) PhotoExifFinder() uniq.Finder[photo.Exif]
type GpsRepository ¶
type GpsRepository struct {
// contains filtered or unexported fields
}
GpsRepository saves images to database.
func NewGpsRepository ¶
func NewGpsRepository(storage *sqluct.Storage) *GpsRepository
func (*GpsRepository) Ensure ¶
func (ir *GpsRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*GpsRepository) FindByHash ¶
func (*GpsRepository) FindByHashes ¶
func (*GpsRepository) PhotoGpsEnsurer ¶
func (ir *GpsRepository) PhotoGpsEnsurer() uniq.Ensurer[photo.Gps]
func (*GpsRepository) PhotoGpsFinder ¶
func (ir *GpsRepository) PhotoGpsFinder() uniq.Finder[photo.Gps]
type GpxRepository ¶
type GpxRepository struct {
// contains filtered or unexported fields
}
GpxRepository saves images to database.
func NewGpxRepository ¶
func NewGpxRepository(storage *sqluct.Storage) *GpxRepository
func (*GpxRepository) Ensure ¶
func (ir *GpxRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*GpxRepository) FindByHash ¶
func (*GpxRepository) FindByHashes ¶
func (*GpxRepository) PhotoGpxEnsurer ¶
func (ir *GpxRepository) PhotoGpxEnsurer() uniq.Ensurer[photo.Gpx]
func (*GpxRepository) PhotoGpxFinder ¶
func (ir *GpxRepository) PhotoGpxFinder() uniq.Finder[photo.Gpx]
func (*GpxRepository) PhotoGpxUpdater ¶
func (ir *GpxRepository) PhotoGpxUpdater() uniq.Updater[photo.Gpx]
type ImageRepository ¶
type ImageRepository struct {
// contains filtered or unexported fields
}
ImageRepository saves images to database.
func NewImageRepository ¶
func NewImageRepository(storage *sqluct.Storage) *ImageRepository
func (*ImageRepository) Ensure ¶
func (ir *ImageRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*ImageRepository) FindByHash ¶
func (*ImageRepository) FindByHashes ¶
func (*ImageRepository) PhotoImageEnsurer ¶
func (ir *ImageRepository) PhotoImageEnsurer() uniq.Ensurer[photo.Image]
func (*ImageRepository) PhotoImageFinder ¶
func (ir *ImageRepository) PhotoImageFinder() uniq.Finder[photo.Image]
func (*ImageRepository) PhotoImageUpdater ¶
func (ir *ImageRepository) PhotoImageUpdater() uniq.Updater[photo.Image]
type MessageRepository ¶ added in v0.0.6
type MessageRepository struct {
// contains filtered or unexported fields
}
MessageRepository saves images to database.
func NewMessageRepository ¶ added in v0.0.6
func NewMessageRepository(storage *sqluct.Storage) *MessageRepository
func (*MessageRepository) CommentMessageEnsurer ¶ added in v0.0.6
func (ir *MessageRepository) CommentMessageEnsurer() uniq.Ensurer[comment.Message]
func (*MessageRepository) CommentMessageFinder ¶ added in v0.0.6
func (ir *MessageRepository) CommentMessageFinder() uniq.Finder[comment.Message]
func (*MessageRepository) Ensure ¶ added in v0.0.6
func (ir *MessageRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*MessageRepository) FindByHash ¶ added in v0.0.6
func (*MessageRepository) FindByHashes ¶ added in v0.0.6
type SettingsRepository ¶
type SettingsRepository struct {
// contains filtered or unexported fields
}
func NewSettingsRepository ¶
func NewSettingsRepository(storage *sqluct.Storage) *SettingsRepository
type ThreadRepository ¶ added in v0.0.6
type ThreadRepository struct {
// contains filtered or unexported fields
}
ThreadRepository saves images to database.
func NewThreadRepository ¶ added in v0.0.6
func NewThreadRepository(storage *sqluct.Storage) *ThreadRepository
func (*ThreadRepository) CommentThreadEnsurer ¶ added in v0.0.6
func (ir *ThreadRepository) CommentThreadEnsurer() uniq.Ensurer[comment.Thread]
func (*ThreadRepository) CommentThreadFinder ¶ added in v0.0.6
func (ir *ThreadRepository) CommentThreadFinder() uniq.Finder[comment.Thread]
func (*ThreadRepository) Ensure ¶ added in v0.0.6
func (ir *ThreadRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*ThreadRepository) FindByHash ¶ added in v0.0.6
func (*ThreadRepository) FindByHashes ¶ added in v0.0.6
type ThumbRepository ¶
type ThumbRepository struct {
// contains filtered or unexported fields
}
ThumbRepository saves images to database.
func NewThumbRepository ¶
func NewThumbRepository(storage *sqluct.Storage, upstream photo.Thumbnailer) *ThumbRepository
func (*ThumbRepository) Ensure ¶
func (ir *ThumbRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*ThumbRepository) FindByHash ¶
func (*ThumbRepository) FindByHashes ¶
func (*ThumbRepository) FindLarger ¶
func (*ThumbRepository) PhotoThumbnailer ¶
func (tr *ThumbRepository) PhotoThumbnailer() photo.Thumbnailer
type VisitorRepository ¶ added in v0.0.6
type VisitorRepository struct {
// contains filtered or unexported fields
}
VisitorRepository saves images to database.
func NewVisitorRepository ¶ added in v0.0.6
func NewVisitorRepository(storage *sqluct.Storage) *VisitorRepository
func (*VisitorRepository) Ensure ¶ added in v0.0.6
func (ir *VisitorRepository) Ensure(ctx context.Context, value V, options ...uniq.EnsureOption[V]) (V, error)
func (*VisitorRepository) FindByHash ¶ added in v0.0.6
func (*VisitorRepository) FindByHashes ¶ added in v0.0.6
func (*VisitorRepository) SiteVisitorEnsurer ¶ added in v0.0.6
func (ir *VisitorRepository) SiteVisitorEnsurer() uniq.Ensurer[site.Visitor]
func (*VisitorRepository) SiteVisitorFinder ¶ added in v0.0.6
func (ir *VisitorRepository) SiteVisitorFinder() uniq.Finder[site.Visitor]
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package sqlite provides migrations.
|
Package sqlite provides migrations. |
Package sqlite_thumbs provides migrations.
|
Package sqlite_thumbs provides migrations. |
Click to show internal directories.
Click to hide internal directories.