Documentation ¶
Index ¶
- Variables
- func Open(dsn string) (string, *sql.DB, error)
- type App
- type AppRepository
- func (r *AppRepository) CreateApp(ctx context.Context, ownerID int64, cid string, ...) (int64, error)
- func (r *AppRepository) CreateRelease(ctx context.Context, ownerID, appID int64, cid string, ...) (int64, error)
- func (r *AppRepository) FetchApps(ctx context.Context, appIDs []int64) ([]*App, error)
- func (r *AppRepository) FindByID(ctx context.Context, id int64) (*App, error)
- func (r *AppRepository) ForEachApp(ctx context.Context, iterator func(context.Context, *App) error) error
- type Release
- type User
- type UserRepository
- func (r *UserRepository) Authenticate(ctx context.Context, username string, password string) (bool, error)
- func (r *UserRepository) Create(ctx context.Context, username, email, password string) (int64, error)
- func (r *UserRepository) FindByID(ctx context.Context, id int64) (*User, error)
- func (r *UserRepository) FindByUsername(ctx context.Context, username string) (*User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrAccountAlreadyExists = errors.New("account already exists") ErrAppAlreadyExists = errors.New("app already exists") ErrReleaseAlreadyExists = errors.New("release already exists") ErrInvalidVersion = errors.New("invalid version") ErrStaledVersion = errors.New("staled version") ErrForbidden = errors.New("forbidden") )
Functions ¶
Types ¶
type App ¶
type App struct { ID int64 `db:"id"` OwnerID int64 `db:"owner_id"` Owner *User `db:"owner" json:",omitempty"` Name string `db:"name"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` LatestReleaseID *int64 `db:"latest_release_id" json:",omitempty"` LatestRelease *Release `db:"latest_release" json:",omitempty"` Releases []*Release `db:"releases" json:",omitempty"` }
type AppRepository ¶
type AppRepository struct {
// contains filtered or unexported fields
}
func NewAppRepository ¶
func NewAppRepository(driver string, db *goqu.Database) *AppRepository
func NewAppRepositoryFromDSN ¶
func NewAppRepositoryFromDSN(dsn string) (*AppRepository, func() error, error)
func (*AppRepository) CreateApp ¶
func (r *AppRepository) CreateApp(ctx context.Context, ownerID int64, cid string, archiveFormat bundle.ArchiveExt, appManifest *repository.AppManifest) (int64, error)
func (*AppRepository) CreateRelease ¶
func (r *AppRepository) CreateRelease(ctx context.Context, ownerID, appID int64, cid string, archiveFormat bundle.ArchiveExt, appManifest *repository.AppManifest) (int64, error)
func (*AppRepository) ForEachApp ¶
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(driver string, db *goqu.Database) *UserRepository
func NewUserRepositoryFromDSN ¶
func NewUserRepositoryFromDSN(dsn string) (*UserRepository, func() error, error)
func (*UserRepository) Authenticate ¶
func (*UserRepository) FindByUsername ¶
Click to show internal directories.
Click to hide internal directories.