Versions in this module Expand all Collapse all v1 v1.1.1 Oct 30, 2021 v1.1.0 Oct 25, 2021 Changes in this version + var ErrInvalidScheme = errors.New("invalid url scheme") + var MimeTypeQEMU = "application/x-qemu-disk" + func DownloadJobInit(db *sqlx.DB, q queue.Queue, log *log.Logger, store fs.Store) queue.InitFunc + func InitEvent(dis event.Dispatcher) queue.InitFunc + func NewDownloadJob(db *sqlx.DB, i *Image, url DownloadURL) (queue.Job, error) + type Download struct + CreatedAt time.Time + Error sql.NullString + FinishedAt sql.NullTime + ID int64 + Image *Image + ImageID int64 + Source DownloadURL + StartedAt sql.NullTime + User *user.User + type DownloadJob struct + ID int64 + ImageID int64 + Source DownloadURL + func (d *DownloadJob) Name() string + func (d *DownloadJob) Perform() error + type DownloadStore struct + Image *Image + User *user.User + func NewDownloadStore(db *sqlx.DB, mm ...database.Model) *DownloadStore + func (s *DownloadStore) All(opts ...query.Option) ([]*Download, error) + func (s *DownloadStore) Bind(mm ...database.Model) + func (s *DownloadStore) Get(opts ...query.Option) (*Download, error) + type DownloadURL struct + func (u *DownloadURL) GobDecode(p []byte) error + func (u *DownloadURL) GobEncode() ([]byte, error) + func (u *DownloadURL) Scan(v interface{}) error + func (u *DownloadURL) String() string + func (u *DownloadURL) UnmarshalText(b []byte) error + func (u *DownloadURL) Validate() error + func (u DownloadURL) Value() (driver.Value, error) + type Event struct + Action string + Image *Image + func (ev *Event) Name() string + func (ev *Event) Perform() error type Form + DownloadURL DownloadURL type Image + Download *Download + func (i *Image) Downloaded() bool type Store + func (s *Store) SetBlockStore(store fs.Store) v1.0.0 Apr 20, 2021 Changes in this version + func LoadRelations(loaders *database.Loaders, ii ...*Image) error + func Model(ii []*Image) func(int) database.Model + type Form struct + Images *Store + Name string + func (f *Form) Fields() map[string]string + func (f *Form) Validate() error + type Image struct + Author *user.User + AuthorID int64 + CreatedAt time.Time + Driver driver.Type + Hash string + ID int64 + Name string + Namespace *namespace.Namespace + NamespaceID sql.NullInt64 + User *user.User + UserID int64 + func FromContext(ctx context.Context) (*Image, bool) + func (i *Image) Bind(mm ...database.Model) + func (i *Image) Endpoint(uri ...string) string + func (i *Image) IsZero() bool + func (i *Image) JSON(addr string) map[string]interface{} + func (i *Image) Primary() (string, int64) + func (i *Image) SetPrimary(id int64) + func (i *Image) Values() map[string]interface{} + type Store struct + Namespace *namespace.Namespace + User *user.User + func NewStore(db *sqlx.DB, mm ...database.Model) *Store + func NewStoreWithBlockStore(db *sqlx.DB, blockStore fs.Store, mm ...database.Model) *Store + func (s *Store) All(opts ...query.Option) ([]*Image, error) + func (s *Store) Bind(mm ...database.Model) + func (s *Store) Chown(from, to int64) error + func (s *Store) Create(authorId int64, hash, name string, t driver.Type, r io.Reader) (*Image, error) + func (s *Store) Delete(id int64, t driver.Type, hash string) error + func (s *Store) Get(opts ...query.Option) (*Image, error) + func (s *Store) Index(vals url.Values, opts ...query.Option) ([]*Image, database.Paginator, error) + func (s *Store) Load(key string, vals []interface{}, fn database.LoaderFunc) error + func (s *Store) New() *Image + func (s *Store) Paginate(page int64, opts ...query.Option) (database.Paginator, error)