Documentation
¶
Overview ¶
Package primitive provides primitive types and functionality for managing application statuses.
Package domain provides domain models and functionality for managing space apps.
Index ¶
- Variables
- type AppStatus
- type AppURL
- type Inference
- type InferenceDetail
- type InferenceIndex
- type InferenceInfo
- type SeverSentEvent
- type SeverSentStream
- type SpaceApp
- func (app *SpaceApp) GetFailedReason() string
- func (app *SpaceApp) IsAppNotAllowToInit() bool
- func (app *SpaceApp) SetBuildFailed(status AppStatus, reason string) error
- func (app *SpaceApp) SetStartFailed(status AppStatus, reason string) error
- func (app *SpaceApp) SetStarting() error
- func (app *SpaceApp) StartBuilding(logURL domain.URL) error
- func (app *SpaceApp) StartServing(appURL AppURL, logURL domain.URL) error
- type SpaceAppBuildLog
- type SpaceAppCreateEvent
- type SpaceAppIndex
- type StreamParameter
Constants ¶
This section is empty.
Variables ¶
var ( // AppStatusInit represents the application status when it is in the initialization phase. AppStatusInit = appStatus(appInit) // AppStatusServing represents the application status when it is serving requests. AppStatusServing = appStatus(serving) // AppStatusBuilding represents the application status when it is being built. AppStatusBuilding = appStatus(building) // AppStatusBuildFailed represents the application status when the build process fails. AppStatusBuildFailed = appStatus(buildFailed) // AppStatusStartFailed represents the application status when the start process fails. AppStatusStartFailed = appStatus(startFailed) // AppStatusServeStarting represents the application status when the build process is successful. AppStatusServeStarting = appStatus(starting) // AppStatusRestarted represents the application status when the app is restarted. AppStatusRestarted = appStatus(restarting) // AppStatusRestartFailed represents the application status when the app is restart failed. AppStatusRestartFailed = appStatus(restartFailed) // AppStatusPaused represents the application status when the app is pause. AppStatusPaused = appStatus(paused) // AppStatusResuming represents the application status when the app is resume. AppStatusResuming = appStatus(resuming) // AppStatusResumeFailed represents the application status when the app is resume failed. AppStatusResumeFailed = appStatus(resumeFailed) // AppStatusSleeping represents the application status when the app is sleeping. AppStatusSleeping = appStatus(sleeping) )
Functions ¶
This section is empty.
Types ¶
type AppStatus ¶ added in v1.5.0
type AppStatus interface { IsInit() bool AppStatus() string IsBuilding() bool IsStarting() bool IsRestarting() bool IsRestartFailed() bool IsPaused() bool IsResuming() bool IsResumeFailed() bool IsUpdateStatusAccept() bool IsStartFailed() bool IsServing() bool IsSleeping() bool }
AppStatus is an interface that defines methods for working with application statuses.
func CreateAppStatus ¶ added in v1.5.0
CreateAppStatus creates a new instance of AppStatus with the provided value.
func NewAppStatus ¶ added in v1.5.0
NewAppStatus creates a new instance of AppStatus based on the provided value.
type AppURL ¶ added in v1.5.0
type AppURL interface {
AppURL() string
}
AppURL is an interface for app url operations.
func CreateAppURL ¶ added in v1.5.0
CreateAppURL creates a new app URL instance with the given value without validation.
type Inference ¶
type Inference struct { InferenceInfo // following fields is not under the controlling of version InferenceDetail }
type InferenceDetail ¶
type InferenceIndex ¶
type InferenceIndex struct { Project dp.ResourceIndex Id string LastCommit string }
type InferenceInfo ¶
type InferenceInfo struct { InferenceIndex ProjectName dp.ResourceName ResourceLevel string Requester string }
type SeverSentEvent ¶ added in v1.5.0
type SeverSentEvent interface {
Request(*SeverSentStream) error
}
SeverSentEvent represents a server-sent event.
type SeverSentStream ¶ added in v1.5.0
type SeverSentStream struct { Parameter StreamParameter Ctx context.Context StreamWrite func(doOnce func() ([]byte, error)) }
SeverSentStream represents a server-sent stream.
type SpaceApp ¶ added in v1.5.0
type SpaceApp struct { Id domain.Identity SpaceAppIndex Status AppStatus Reason string ResumedAt int64 RestartedAt int64 AppURL AppURL AppLogURL domain.URL BuildLogURL domain.URL Version int }
SpaceApp represents a space app.
func (*SpaceApp) GetFailedReason ¶ added in v1.5.0
GetFailedReason app only return failed reason
func (*SpaceApp) IsAppNotAllowToInit ¶ added in v1.5.0
IsAppNotAllowToInit app can be init if return false
func (*SpaceApp) SetBuildFailed ¶ added in v1.5.0
SetBuildFailed set app status is build failed.
func (*SpaceApp) SetStartFailed ¶ added in v1.5.0
SetStartFailed set app status is start failed.
func (*SpaceApp) SetStarting ¶ added in v1.5.0
SetStarting sets the starting status of the space app based on the success parameter.
func (*SpaceApp) StartBuilding ¶ added in v1.5.0
StartBuilding starts the building process for the space app and sets the build log URL.
type SpaceAppBuildLog ¶ added in v1.5.0
SpaceAppBuildLog is the value object of log
type SpaceAppCreateEvent ¶ added in v1.5.0
type SpaceAppIndex ¶ added in v1.5.0
SpaceAppIndex represents the index for a space app.
type StreamParameter ¶ added in v1.5.0
type StreamParameter struct {
StreamUrl string `json:"stream_url" required:"true"`
}
StreamParameter is a type alias for StreamParameter.