Documentation ¶
Index ¶
- func BuildApplicationManifest(application *models.Application, environment *models.Environment, ...) (map[string]interface{}, error)
- func GenerateRoutes(relativePath string, r *gin.Engine, appHandler *ApiHandler)
- type ApiHandler
- func (a *ApiHandler) ComponentPods(c *gin.Context)
- func (a *ApiHandler) CreateApplication(c *gin.Context)
- func (a *ApiHandler) CreateComponent(c *gin.Context)
- func (a *ApiHandler) CreateEnvironment(c *gin.Context)
- func (a *ApiHandler) CreateOrganization(c *gin.Context)
- func (a *ApiHandler) DeleteComponent(c *gin.Context)
- func (a *ApiHandler) DeleteEnvironment(c *gin.Context)
- func (a *ApiHandler) DeployApplication(c *gin.Context)
- func (a *ApiHandler) DetailApplication(c *gin.Context)
- func (a *ApiHandler) DetailComponent(c *gin.Context)
- func (a *ApiHandler) DetailOrganization(c *gin.Context)
- func (a *ApiHandler) ListApplications(c *gin.Context)
- func (a *ApiHandler) ListComponents(c *gin.Context)
- func (a *ApiHandler) ListOrganization(c *gin.Context)
- func (a *ApiHandler) StatusApplication(c *gin.Context)
- func (a *ApiHandler) StatusComponent(c *gin.Context)
- func (a *ApiHandler) StatusComponentHealth(c *gin.Context)
- func (a *ApiHandler) StreamLogs(c *gin.Context)
- func (a *ApiHandler) UpdateComponent(c *gin.Context)
- type ApplicationHandler
- type ApplicationListResponse
- type ApplicationResponse
- type ApplicationStatus
- type ApplicationStatusResponse
- type ComponentListResponse
- type ComponentPodsResponse
- type ComponentProperties
- type ComponentResponse
- type ComponentStatusResponse
- type CreateApplicationRequest
- type CreateComponentRequest
- type CreateEnvironmentRequest
- type CreateOrganizationRequest
- type EnvironmentListResponse
- type EnvironmentResponse
- type OrganizationListResponse
- type OrganizationResponse
- type Properties
- type ProviderDispatcher
- type ProviderStatus
- type ProviderType
- type ServiceComponentStatusResponse
- type Trait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildApplicationManifest ¶
func BuildApplicationManifest(application *models.Application, environment *models.Environment, db *database.MongoDB) (map[string]interface{}, error)
func GenerateRoutes ¶
func GenerateRoutes(relativePath string, r *gin.Engine, appHandler *ApiHandler)
Types ¶
type ApiHandler ¶
func NewApiHandler ¶
func NewApiHandler(config *apiConfig.Config, mongo *database.MongoDB) *ApiHandler
func (*ApiHandler) ComponentPods ¶
func (a *ApiHandler) ComponentPods(c *gin.Context)
func (*ApiHandler) CreateApplication ¶
func (a *ApiHandler) CreateApplication(c *gin.Context)
func (*ApiHandler) CreateComponent ¶
func (a *ApiHandler) CreateComponent(c *gin.Context)
func (*ApiHandler) CreateEnvironment ¶
func (a *ApiHandler) CreateEnvironment(c *gin.Context)
func (*ApiHandler) CreateOrganization ¶
func (a *ApiHandler) CreateOrganization(c *gin.Context)
func (*ApiHandler) DeleteComponent ¶
func (a *ApiHandler) DeleteComponent(c *gin.Context)
func (*ApiHandler) DeleteEnvironment ¶
func (a *ApiHandler) DeleteEnvironment(c *gin.Context)
func (*ApiHandler) DeployApplication ¶
func (a *ApiHandler) DeployApplication(c *gin.Context)
func (*ApiHandler) DetailApplication ¶
func (a *ApiHandler) DetailApplication(c *gin.Context)
func (*ApiHandler) DetailComponent ¶
func (a *ApiHandler) DetailComponent(c *gin.Context)
func (*ApiHandler) DetailOrganization ¶
func (a *ApiHandler) DetailOrganization(c *gin.Context)
func (*ApiHandler) ListApplications ¶
func (a *ApiHandler) ListApplications(c *gin.Context)
func (*ApiHandler) ListComponents ¶
func (a *ApiHandler) ListComponents(c *gin.Context)
func (*ApiHandler) ListOrganization ¶
func (a *ApiHandler) ListOrganization(c *gin.Context)
func (*ApiHandler) StatusApplication ¶
func (a *ApiHandler) StatusApplication(c *gin.Context)
func (*ApiHandler) StatusComponent ¶
func (a *ApiHandler) StatusComponent(c *gin.Context)
func (*ApiHandler) StatusComponentHealth ¶
func (a *ApiHandler) StatusComponentHealth(c *gin.Context)
func (*ApiHandler) StreamLogs ¶
func (a *ApiHandler) StreamLogs(c *gin.Context)
func (*ApiHandler) UpdateComponent ¶
func (a *ApiHandler) UpdateComponent(c *gin.Context)
type ApplicationHandler ¶
type ApplicationHandler struct { ID string OrganizationID string Model *models.Application DB *database.MongoDB }
func ListOrganizationApplications ¶
func ListOrganizationApplications(organizationID string, db *database.MongoDB) ([]*ApplicationHandler, error)
func NewApplicationHandler ¶
func NewApplicationHandler(db *database.MongoDB) (*ApplicationHandler, error)
func (*ApplicationHandler) GetApplicationByID ¶
func (ah *ApplicationHandler) GetApplicationByID(appID string) error
func (*ApplicationHandler) Status ¶
func (ah *ApplicationHandler) Status(environment *models.Environment) (ProviderStatus, error)
type ApplicationListResponse ¶
type ApplicationListResponse struct { Organization OrganizationResponse `json:"organization"` Applications []ApplicationResponse `json:"applications"` }
type ApplicationResponse ¶
type ApplicationResponse struct { *models.Application TotalComponents int64 `json:"total_components"` }
type ApplicationStatus ¶
type ApplicationStatus string
ApplicationStatus Indicate the current condition of the overall application
const ( ApplicationStarting ApplicationStatus = "starting" ApplicationRendering ApplicationStatus = "rendering" ApplicationPolicyGenerating ApplicationStatus = "generatingPolicy" ApplicationRunningWorkflow ApplicationStatus = "runningWorkflow" ApplicationWorkflowSuspending ApplicationStatus = "workflowSuspending" ApplicationWorkflowTerminated ApplicationStatus = "workflowTerminated" ApplicationWorkflowFailed ApplicationStatus = "workflowFailed" ApplicationRunning ApplicationStatus = "running" ApplicationUnhealthy ApplicationStatus = "unhealthy" ApplicationDeleting ApplicationStatus = "deleting" )
type ApplicationStatusResponse ¶
type ApplicationStatusResponse struct {
Status ApplicationStatus `json:"status"`
}
type ComponentListResponse ¶
type ComponentListResponse struct {
Components []ComponentResponse `json:"components"`
}
type ComponentPodsResponse ¶
type ComponentProperties ¶
type ComponentProperties struct { NetworkProperties *providers.NetworkProperties `json:"network"` ResourcesProperties *providers.ResourcesProperties `json:"resources"` StorageProperties *providers.StorageProperties `json:"storage"` SourceProperties *providers.SourceProperties `json:"source"` Health *providers.ComponentStatusHealth `json:"health"` }
type ComponentResponse ¶
type ComponentStatusResponse ¶
type ComponentStatusResponse struct { Component ComponentResponse `json:"component"` Properties ComponentProperties `json:"properties"` }
type CreateComponentRequest ¶
type CreateComponentRequest struct { Name string `json:"name" binding:"required"` Type string `json:"type" binding:"required"` Description string `json:"description"` Settings models.ComponentSettings `json:"settings"` }
type CreateEnvironmentRequest ¶
type CreateEnvironmentRequest struct {
Name string `json:"name" validate:"required,regexp=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"` // TODO: Validate this field with a regex, current implementation doesn't work
}
type CreateOrganizationRequest ¶
type CreateOrganizationRequest struct {
Name string `json:"name" binding:"required"`
}
func (*CreateOrganizationRequest) ParseRequestToModel ¶
func (r *CreateOrganizationRequest) ParseRequestToModel() *models.Organization
type EnvironmentListResponse ¶
type EnvironmentListResponse struct {
Environments []EnvironmentResponse `json:"environments"`
}
type EnvironmentResponse ¶
type EnvironmentResponse struct {
*models.Environment
}
type OrganizationListResponse ¶
type OrganizationListResponse struct {
Organizations []OrganizationResponse `json:"organizations"`
}
type OrganizationResponse ¶
type OrganizationResponse struct {
*models.Organization
}
type Properties ¶
type Properties interface { }
type ProviderDispatcher ¶
type ProviderDispatcher interface { DeployApplication(manifest map[string]interface{}) error UpdateApplication(manifest map[string]interface{}) error }
func NewProviderDispatcher ¶
func NewProviderDispatcher(application *models.Application, environment *models.Environment) (ProviderDispatcher, error)
type ProviderStatus ¶
type ProviderStatus interface { GetApplicationStatus() (string, error) GetNetworkProperties(componentName string) (*providers.NetworkProperties, error) GetResourcesProperties(componentName string) (*providers.ResourcesProperties, error) GetStorageProperties(componentName string) (*providers.StorageProperties, error) GetSourceProperties(componentName string) (*providers.SourceProperties, error) GetComponentStatus(componentName string) (*providers.ComponentStatusHealth, error) GetPodList(componentName string) ([]providers.Pod, error) StreamLogs(c context.Context, podName string, logStream *providers.LogStream, linesBuffer int) }
func NewProviderStatus ¶
func NewProviderStatus(application *models.Application, environment *models.Environment) (ProviderStatus, error)
type ServiceComponentStatusResponse ¶
type ServiceComponentStatusResponse struct { UpdatedReplicas int32 `json:"updated_replicas"` ReadyReplicas int32 `json:"ready_replicas"` AvailableReplicas int32 `json:"available_replicas"` ConditionAvailable string `json:"condition_available"` ConditionProgressing string `json:"condition_progressing"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
func (*ServiceComponentStatusResponse) FromClientsetToResponse ¶
func (r *ServiceComponentStatusResponse) FromClientsetToResponse(deployment k8sV1.Deployment)
Click to show internal directories.
Click to hide internal directories.