Documentation ¶
Index ¶
- Constants
- Variables
- func MarshalManifest(m *ApplicationManifest) ([]byte, error)
- type AppRepository
- type Application
- func (a *Application) AddBuild(branchName string, buildID ID) (*BuildInfo, error)
- func (a *Application) FindBranch(name string) (*Branch, error)
- func (a *Application) NewBranch(name string) (*Branch, error)
- func (a *Application) PromoteBranch(from, to string) error
- func (a *Application) PublishBuild(branchName string, build string) (*Branch, error)
- func (a *Application) RemoveBranch(name string) error
- type ApplicationManifest
- type Applications
- type Branch
- type Build
- type BuildDownloader
- type BuildInfo
- type BuildRepository
- type BuildUploader
- type Bundle
- type Exclude
- type FileInfo
- type ID
- type LaunchOption
- type Locale
- type Platform
- type Token
- type TokenRepository
- type TokenService
- type UserID
Constants ¶
View Source
const DefaultBranchName = "master"
View Source
const MaxBranches = 100
Variables ¶
View Source
var ( ErrApplicationNotFound = errors.New("application not found") ErrBranchNotFound = errors.New("branch not found") ErrBranchExist = errors.New("branch already exist") ErrTooManyBranches = errors.New("too many branches") ErrCantRemoveDefaultBranch = errors.New("can't remove default branch") ErrBuildNotFound = errors.New("build not found") ErrBuildAlreadyUploaded = errors.New("build already uploaded") ErrWrongManifestApplication = errors.New("wrong application in manifest") ErrTokenNotFound = errors.New("auth token not found") )
Functions ¶
func MarshalManifest ¶
func MarshalManifest(m *ApplicationManifest) ([]byte, error)
Types ¶
type AppRepository ¶
type AppRepository interface { FindByID(ctx context.Context, id ID) (*Application, error) FindByUserIdent(ctx context.Context, id UserID, ident string) (*Application, error) FindByUser(ctx context.Context, id UserID) ([]*Application, error) Create(ctx context.Context, app *Application) error Update(ctx context.Context, app *Application) error }
type Application ¶
type Application struct { ID ID Owner UserID Name string Title string DefaultBranch string Branches []*Branch }
func NewApplication ¶
func NewApplication(owner UserID, name, title string) *Application
func (*Application) AddBuild ¶
func (a *Application) AddBuild(branchName string, buildID ID) (*BuildInfo, error)
func (*Application) FindBranch ¶
func (a *Application) FindBranch(name string) (*Branch, error)
func (*Application) PromoteBranch ¶
func (a *Application) PromoteBranch(from, to string) error
func (*Application) PublishBuild ¶
func (a *Application) PublishBuild(branchName string, build string) (*Branch, error)
func (*Application) RemoveBranch ¶
func (a *Application) RemoveBranch(name string) error
type ApplicationManifest ¶
type ApplicationManifest struct { // Application ID AppID ID `json:"app_id"` Bundles []Bundle `json:"bundles"` }
func UnmarshalManifest ¶
func UnmarshalManifest(data []byte) (*ApplicationManifest, error)
func (*ApplicationManifest) RequiredSpace ¶
func (m *ApplicationManifest) RequiredSpace(platform Platform, locale Locale) int64
func (*ApplicationManifest) Validate ¶
func (m *ApplicationManifest) Validate() error
type Applications ¶
type Applications []*Application
type Branch ¶
type Branch struct { AppID ID Name string LiveBuildID ID PublishedAt time.Time Builds []*BuildInfo }
func NewBranch ¶
func NewBranch(app *Application, name string) *Branch
func (*Branch) BuildsCount ¶
func (*Branch) HasLiveBuild ¶
func (*Branch) LatestBuild ¶
func (*Branch) PublishBuild ¶
type Build ¶
type Build struct { ID ID AppID ID Manifest *ApplicationManifest Uploaded bool CreatedAt time.Time }
func NewBuild ¶
func NewBuild(app *Application, m *ApplicationManifest) (*Build, error)
func (*Build) MarkUploaded ¶
type BuildDownloader ¶
type BuildDownloader interface {
Download(manifest *ApplicationManifest, path string) error
}
type BuildRepository ¶
type BuildUploader ¶
type BuildUploader interface {
Upload(manifest *ApplicationManifest, path string) error
}
type Bundle ¶
type Bundle struct { Label string `json:"label"` Platforms []Platform `json:"platforms"` Locales []Locale `json:"locales"` LocalRoot string `json:"local_root"` Exclude []Exclude `json:"exclude"` InstallPath string `json:"install_path"` LaunchOptions []LaunchOption `json:"launch_options"` Files []FileInfo `json:"files"` }
func (*Bundle) GetInstallPath ¶
func (*Bundle) MatchLocale ¶
func (*Bundle) MatchPlatform ¶
type LaunchOption ¶
type LaunchOption struct {
Executable string `json:"executable"`
}
type TokenRepository ¶
type TokenService ¶
type TokenService interface { NewToken(ctx context.Context, userID UserID) (string, error) NewPersonalToken(ctx context.Context, userID UserID) (string, error) RevokeToken(ctx context.Context, token string) error RevokeUserTokens(ctx context.Context, userID UserID) error RevokePersonalToken(ctx context.Context, userID UserID) error AuthenticateUser(ctx context.Context, token string) (UserID, error) }
Click to show internal directories.
Click to hide internal directories.