models

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse[T any] struct {
	Success bool   `json:"success"`
	Data    T      `json:"data,omitempty"`
	Error   string `json:"error,omitempty"`
	Code    string `json:"code,omitempty"`
}

APIResponse represents a standard API response wrapper

func ErrorResponse

func ErrorResponse(message, code string) APIResponse[any]

func ListSuccessResponse

func ListSuccessResponse[T any](items []T, total, page, pageSize int) APIResponse[ListResponse[T]]

func SuccessResponse

func SuccessResponse[T any](data T) APIResponse[T]

type BindingReleaseState

type BindingReleaseState string
const (
	ReleaseStateActive   BindingReleaseState = "Active"
	ReleaseStateSuspend  BindingReleaseState = "Suspend"
	ReleaseStateUndeploy BindingReleaseState = "Undeploy"
)

type BindingResponse

type BindingResponse struct {
	Name          string        `json:"name"`
	Type          string        `json:"type"`
	ComponentName string        `json:"componentName"`
	ProjectName   string        `json:"projectName"`
	OrgName       string        `json:"orgName"`
	Environment   string        `json:"environment"`
	BindingStatus BindingStatus `json:"status"`
	// Component-specific binding data
	ServiceBinding        *ServiceBinding        `json:"serviceBinding,omitempty"`
	WebApplicationBinding *WebApplicationBinding `json:"webApplicationBinding,omitempty"`
	ScheduledTaskBinding  *ScheduledTaskBinding  `json:"scheduledTaskBinding,omitempty"`
}

type BindingStatus

type BindingStatus struct {
	Reason           string            `json:"reason"`
	Message          string            `json:"message"`
	Status           BindingStatusType `json:"status"`
	LastTransitioned time.Time         `json:"lastTransitioned"`
}

type BindingStatusType

type BindingStatusType string
const (
	BindingStatusTypeInProgress BindingStatusType = "InProgress"
	BindingStatusTypeReady      BindingStatusType = "Active"
	BindingStatusTypeFailed     BindingStatusType = "Failed"
	BindingStatusTypeSuspended  BindingStatusType = "Suspended"
	BindingStatusTypeUndeployed BindingStatusType = "NotYetDeployed"
)

type BuildConfig

type BuildConfig struct {
	RepoURL          string              `json:"repoUrl"`
	Branch           string              `json:"repoBranch"`
	ComponentPath    string              `json:"componentPath"`
	BuildTemplateRef string              `json:"buildTemplateRef"`
	TemplateParams   []TemplateParameter `json:"buildTemplateParams,omitempty"`
}

type BuildPlaneResponse

type BuildPlaneResponse struct {
	Name                  string    `json:"name"`
	Namespace             string    `json:"namespace"`
	DisplayName           string    `json:"displayName,omitempty"`
	Description           string    `json:"description,omitempty"`
	KubernetesClusterName string    `json:"kubernetesClusterName"`
	APIServerURL          string    `json:"apiServerURL"`
	ObserverURL           string    `json:"observerURL,omitempty"`
	ObserverUsername      string    `json:"observerUsername,omitempty"`
	CreatedAt             time.Time `json:"createdAt"`
	Status                string    `json:"status,omitempty"`
}

BuildPlaneResponse represents a buildplane in API responses

type BuildResponse

type BuildResponse struct {
	Name          string    `json:"name"`
	UUID          string    `json:"uuid"`
	ComponentName string    `json:"componentName"`
	ProjectName   string    `json:"projectName"`
	OrgName       string    `json:"orgName"`
	Commit        string    `json:"commit,omitempty"`
	Status        string    `json:"status,omitempty"`
	CreatedAt     time.Time `json:"createdAt"`
	Image         string    `json:"image,omitempty"`
}

BuildResponse represents a build in API responses

type BuildTemplateParameter

type BuildTemplateParameter struct {
	Name    string `json:"name"`
	Default string `json:"default,omitempty"`
}

BuildTemplateParameter represents a parameter of a build template

type BuildTemplateResponse

type BuildTemplateResponse struct {
	Name       string                   `json:"name"`
	Parameters []BuildTemplateParameter `json:"parameters,omitempty"`
	CreatedAt  time.Time                `json:"createdAt"`
}

BuildTemplateResponse represents a build template (ClusterWorkflowTemplate) in API responses

type ComponentResponse

type ComponentResponse struct {
	Name           string                                 `json:"name"`
	DisplayName    string                                 `json:"displayName,omitempty"`
	Description    string                                 `json:"description,omitempty"`
	Type           string                                 `json:"type"`
	ProjectName    string                                 `json:"projectName"`
	OrgName        string                                 `json:"orgName"`
	CreatedAt      time.Time                              `json:"createdAt"`
	Status         string                                 `json:"status,omitempty"`
	Service        *openchoreov1alpha1.ServiceSpec        `json:"service,omitempty"`
	WebApplication *openchoreov1alpha1.WebApplicationSpec `json:"webApplication,omitempty"`
	ScheduledTask  *openchoreov1alpha1.ScheduledTaskSpec  `json:"scheduledTask,omitempty"`
	API            *openchoreov1alpha1.APISpec            `json:"api,omitempty"`
	Workload       *openchoreov1alpha1.WorkloadSpec       `json:"workload,omitempty"`
	BuildConfig    *BuildConfig                           `json:"buildConfig,omitempty"`
}

ComponentResponse represents a component in API responses

type CreateComponentRequest

type CreateComponentRequest struct {
	Name        string      `json:"name"`
	DisplayName string      `json:"displayName,omitempty"`
	Description string      `json:"description,omitempty"`
	Type        string      `json:"type"`
	BuildConfig BuildConfig `json:"buildConfig,omitempty"`
}

CreateComponentRequest represents the request to create a new component

func (*CreateComponentRequest) Sanitize

func (req *CreateComponentRequest) Sanitize()

Sanitize sanitizes the CreateComponentRequest by trimming whitespace

func (*CreateComponentRequest) Validate

func (req *CreateComponentRequest) Validate() error

Validate validates the CreateComponentRequest

type CreateDataPlaneRequest

type CreateDataPlaneRequest struct {
	Name                    string `json:"name"`
	DisplayName             string `json:"displayName,omitempty"`
	Description             string `json:"description,omitempty"`
	RegistryPrefix          string `json:"registryPrefix"`
	RegistrySecretRef       string `json:"registrySecretRef,omitempty"`
	KubernetesClusterName   string `json:"kubernetesClusterName"`
	APIServerURL            string `json:"apiServerURL"`
	CACert                  string `json:"caCert"`
	ClientCert              string `json:"clientCert"`
	ClientKey               string `json:"clientKey"`
	PublicVirtualHost       string `json:"publicVirtualHost"`
	OrganizationVirtualHost string `json:"organizationVirtualHost"`
	ObserverURL             string `json:"observerURL,omitempty"`
	ObserverUsername        string `json:"observerUsername,omitempty"`
	ObserverPassword        string `json:"observerPassword,omitempty"`
}

CreateDataPlaneRequest represents the request to create a new dataplane

func (*CreateDataPlaneRequest) Sanitize

func (req *CreateDataPlaneRequest) Sanitize()

Sanitize sanitizes the CreateDataPlaneRequest by trimming whitespace

func (*CreateDataPlaneRequest) Validate

func (req *CreateDataPlaneRequest) Validate() error

Validate validates the CreateDataPlaneRequest

type CreateEnvironmentRequest

type CreateEnvironmentRequest struct {
	Name         string `json:"name"`
	DisplayName  string `json:"displayName,omitempty"`
	Description  string `json:"description,omitempty"`
	DataPlaneRef string `json:"dataPlaneRef,omitempty"`
	IsProduction bool   `json:"isProduction"`
	DNSPrefix    string `json:"dnsPrefix,omitempty"`
}

CreateEnvironmentRequest represents the request to create a new environment

func (*CreateEnvironmentRequest) Sanitize

func (req *CreateEnvironmentRequest) Sanitize()

Sanitize sanitizes the CreateEnvironmentRequest by trimming whitespace

func (*CreateEnvironmentRequest) Validate

func (req *CreateEnvironmentRequest) Validate() error

Validate validates the CreateEnvironmentRequest

type CreateProjectRequest

type CreateProjectRequest struct {
	Name               string `json:"name"`
	DisplayName        string `json:"displayName,omitempty"`
	Description        string `json:"description,omitempty"`
	DeploymentPipeline string `json:"deploymentPipeline,omitempty"`
}

CreateProjectRequest represents the request to create a new project

func (*CreateProjectRequest) Sanitize

func (req *CreateProjectRequest) Sanitize()

Sanitize sanitizes the CreateProjectRequest by trimming whitespace

func (*CreateProjectRequest) Validate

func (req *CreateProjectRequest) Validate() error

Validate validates the CreateProjectRequest

type DataPlaneResponse

type DataPlaneResponse struct {
	Name                    string    `json:"name"`
	Namespace               string    `json:"namespace"`
	DisplayName             string    `json:"displayName,omitempty"`
	Description             string    `json:"description,omitempty"`
	RegistryPrefix          string    `json:"registryPrefix"`
	RegistrySecretRef       string    `json:"registrySecretRef,omitempty"`
	KubernetesClusterName   string    `json:"kubernetesClusterName"`
	APIServerURL            string    `json:"apiServerURL"`
	PublicVirtualHost       string    `json:"publicVirtualHost"`
	OrganizationVirtualHost string    `json:"organizationVirtualHost"`
	ObserverURL             string    `json:"observerURL,omitempty"`
	ObserverUsername        string    `json:"observerUsername,omitempty"`
	CreatedAt               time.Time `json:"createdAt"`
	Status                  string    `json:"status,omitempty"`
}

DataPlaneResponse represents a dataplane in API responses

type DeploymentPipelineResponse

type DeploymentPipelineResponse struct {
	Name           string          `json:"name"`
	DisplayName    string          `json:"displayName,omitempty"`
	Description    string          `json:"description,omitempty"`
	OrgName        string          `json:"orgName"`
	CreatedAt      time.Time       `json:"createdAt"`
	Status         string          `json:"status,omitempty"`
	PromotionPaths []PromotionPath `json:"promotionPaths,omitempty"`
}

DeploymentPipelineResponse represents a deployment pipeline in API responses

type EndpointStatus

type EndpointStatus struct {
	Name         string           `json:"name"`
	Type         string           `json:"type"`
	Project      *ExposedEndpoint `json:"project,omitempty"`
	Organization *ExposedEndpoint `json:"organization,omitempty"`
	Public       *ExposedEndpoint `json:"public,omitempty"`
}

type EnvironmentResponse

type EnvironmentResponse struct {
	Name         string    `json:"name"`
	Namespace    string    `json:"namespace"`
	DisplayName  string    `json:"displayName,omitempty"`
	Description  string    `json:"description,omitempty"`
	DataPlaneRef string    `json:"dataPlaneRef,omitempty"`
	IsProduction bool      `json:"isProduction"`
	DNSPrefix    string    `json:"dnsPrefix,omitempty"`
	CreatedAt    time.Time `json:"createdAt"`
	Status       string    `json:"status,omitempty"`
}

EnvironmentResponse represents an environment in API responses

type ExposedEndpoint

type ExposedEndpoint struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Scheme   string `json:"scheme,omitempty"`   // gRPC, HTTP, etc.
	BasePath string `json:"basePath,omitempty"` // For HTTP-based endpoints
	URI      string `json:"uri,omitempty"`
}

type ListResponse

type ListResponse[T any] struct {
	Items      []T `json:"items"`
	TotalCount int `json:"totalCount"`
	Page       int `json:"page"`
	PageSize   int `json:"pageSize"`
}

ListResponse represents a paginated list response

type OrganizationResponse

type OrganizationResponse struct {
	Name        string    `json:"name"`
	DisplayName string    `json:"displayName,omitempty"`
	Description string    `json:"description,omitempty"`
	Namespace   string    `json:"namespace,omitempty"`
	CreatedAt   time.Time `json:"createdAt"`
	Status      string    `json:"status,omitempty"`
}

OrganizationResponse represents an organization in API responses

type ProjectResponse

type ProjectResponse struct {
	Name               string    `json:"name"`
	OrgName            string    `json:"orgName"`
	DisplayName        string    `json:"displayName,omitempty"`
	Description        string    `json:"description,omitempty"`
	DeploymentPipeline string    `json:"deploymentPipeline,omitempty"`
	CreatedAt          time.Time `json:"createdAt"`
	Status             string    `json:"status,omitempty"`
}

ProjectResponse represents a project in API responses

type PromoteComponentRequest

type PromoteComponentRequest struct {
	SourceEnvironment string `json:"sourceEnv"`
	TargetEnvironment string `json:"targetEnv"`
}

PromoteComponentRequest Promote from one environment to another

func (*PromoteComponentRequest) Sanitize

func (req *PromoteComponentRequest) Sanitize()

Sanitize sanitizes the PromoteComponentRequest by trimming whitespace

func (*PromoteComponentRequest) Validate

func (req *PromoteComponentRequest) Validate() error

Validate validates the PromoteComponentRequest

type PromotionPath

type PromotionPath struct {
	SourceEnvironmentRef  string                 `json:"sourceEnvironmentRef"`
	TargetEnvironmentRefs []TargetEnvironmentRef `json:"targetEnvironmentRefs"`
}

PromotionPath represents a promotion path in the deployment pipeline

type ScheduledTaskBinding

type ScheduledTaskBinding struct {
	Image        string `json:"image,omitempty"`
	ReleaseState string `json:"releaseState,omitempty"`
}

type ServiceBinding

type ServiceBinding struct {
	Endpoints    []EndpointStatus `json:"endpoints"`
	Image        string           `json:"image,omitempty"`
	ReleaseState string           `json:"releaseState,omitempty"`
}

type TargetEnvironmentRef

type TargetEnvironmentRef struct {
	Name                     string `json:"name"`
	RequiresApproval         bool   `json:"requiresApproval,omitempty"`
	IsManualApprovalRequired bool   `json:"isManualApprovalRequired,omitempty"`
}

TargetEnvironmentRef represents a target environment reference with approval settings

type TemplateParameter

type TemplateParameter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type UpdateBindingRequest

type UpdateBindingRequest struct {
	// ReleaseState controls the state of the Release created by this binding.
	// Valid values: Active, Suspend, Undeploy
	ReleaseState BindingReleaseState `json:"releaseState"`
}

UpdateBindingRequest represents the request to update a component binding Only includes fields that can be updated via PATCH

func (*UpdateBindingRequest) Validate

func (req *UpdateBindingRequest) Validate() error

Validate validates the UpdateBindingRequest

type WebApplicationBinding

type WebApplicationBinding struct {
	Endpoints    []EndpointStatus `json:"endpoints"`
	Image        string           `json:"image,omitempty"`
	ReleaseState string           `json:"releaseState,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL