Documentation
¶
Overview ¶
Package portal provides a client for the KubeRocketCI Portal tRPC API.
Index ¶
Constants ¶
const ( QualityGateTypeAutotests = "autotests" QualityGateTypeManual = "manual" )
Quality gate type constants.
Variables ¶
var ( ErrNotFound = errors.New("resource not found") ErrHTTPSRequired = errors.New("portal URL must use HTTPS") )
Sentinel errors for portal API failures.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.3.0
type Client struct {
// contains filtered or unexported fields
}
Client provides authenticated access to the KubeRocketCI Portal tRPC API.
type Config ¶
type Config struct {
ClusterName string `json:"clusterName"`
DefaultNamespace string `json:"defaultNamespace"`
OIDCIssuerURL string `json:"oidcIssuerUrl"`
}
Config holds public configuration returned by the Portal.
func FetchConfig ¶
FetchConfig calls the Portal public config.get endpoint (no auth required) and returns the cluster configuration. The portal URL must use HTTPS.
type Deployment ¶ added in v0.3.0
type Deployment struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Applications []string `json:"applications"`
StageNames []string `json:"stages"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
}
Deployment represents a KubeRocketCI CDPipeline resource.
type DeploymentDetail ¶ added in v0.3.0
type DeploymentDetail struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Applications []string `json:"applications"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
Stages []Stage `json:"stages"`
}
DeploymentDetail represents a CDPipeline with its associated Stages.
type DeploymentService ¶ added in v0.3.0
type DeploymentService struct {
// contains filtered or unexported fields
}
DeploymentService provides access to CDPipeline and Stage resources via the portal API.
func NewDeploymentService ¶ added in v0.3.0
func NewDeploymentService(client *Client, clusterName, namespace string) *DeploymentService
NewDeploymentService creates a DeploymentService for the given cluster and namespace.
func (*DeploymentService) Get ¶ added in v0.3.0
func (s *DeploymentService) Get(ctx context.Context, name string) (*DeploymentDetail, error)
Get returns a single CDPipeline with its Stages sorted by order.
func (*DeploymentService) List ¶ added in v0.3.0
func (s *DeploymentService) List(ctx context.Context) ([]Deployment, error)
List returns all CDPipelines with their stage names ordered by spec.order.
type Project ¶ added in v0.3.0
type Project struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Type string `json:"type"`
Language string `json:"language"`
BuildTool string `json:"buildTool"`
Framework string `json:"framework,omitempty"`
GitServer string `json:"gitServer"`
GitURL string `json:"gitUrl,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
}
Project represents a KubeRocketCI Codebase resource.
type ProjectService ¶ added in v0.3.0
type ProjectService struct {
// contains filtered or unexported fields
}
ProjectService provides access to Codebase resources via the portal API.
func NewProjectService ¶ added in v0.3.0
func NewProjectService(client *Client, clusterName, namespace string) *ProjectService
NewProjectService creates a ProjectService for the given cluster and namespace.
type QualityGate ¶ added in v0.3.0
QualityGate represents a quality gate step within a Stage.
type Stage ¶ added in v0.3.0
type Stage struct {
Name string `json:"name"`
Order int64 `json:"order"`
TriggerType string `json:"triggerType"`
QualityGates []QualityGate `json:"qualityGates"`
Namespace string `json:"namespace"`
ClusterName string `json:"clusterName,omitempty"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Available bool `json:"available"`
}
Stage represents a KubeRocketCI Stage resource belonging to a CDPipeline.