Documentation ¶
Index ¶
- Constants
- func NewDexReverseProxy(target string) func(c *gin.Context)
- func NewHandler(ctx context.Context, dexObj *DexObject, ...) (*handler, error)
- func NewNoAuthHandler(dexObj *DexObject, localUsersAuthObject *LocalUsersAuthObject) (*noAuthHandler, error)
- type ActiveStatus
- type ClusterSummaryResponse
- type ContainerDetails
- type DexObject
- type DexRewriteURLRoundTripper
- type Dimension
- type Dimensions
- type DiscoveryResponse
- type Filter
- type HandlerOption
- type HealthChecker
- type HealthResponse
- type ISBService
- type ISBServices
- type IsbServiceSummary
- type K8sEventsResponse
- type LocalUsersAuthObject
- func (l *LocalUsersAuthObject) Authenticate(c *gin.Context) (*authn.UserInfo, error)
- func (l *LocalUsersAuthObject) GenerateToken(c *gin.Context, username string) (string, error)
- func (l *LocalUsersAuthObject) ParseToken(c *gin.Context, tokenString string) (jwt.MapClaims, error)
- func (l *LocalUsersAuthObject) VerifyUser(c *gin.Context, username string, password string) error
- type LoginInput
- type LoginResponse
- type Metric
- type MetricsDiscoveryResponse
- type MetricsRequestBody
- type MonoVertexInfo
- type MonoVertexSummary
- type MonoVertices
- type NamespaceSummary
- type NumaflowAPIResponse
- type Params
- type Pattern
- type PipelineInfo
- type PipelineSummary
- type Pipelines
- type PodDetails
- type PromQl
- type PromQlService
- func (b *PromQlService) BuildQuery(requestBody MetricsRequestBody) (string, error)
- func (b *PromQlService) DisableMetricsChart() bool
- func (b *PromQlService) GetConfigData() *PrometheusConfig
- func (b *PromQlService) PopulateReqMap(requestBody MetricsRequestBody) map[string]string
- func (b *PromQlService) QueryPrometheus(ctx context.Context, promql string, start, end time.Time) (model.Value, error)
- type Prometheus
- type PrometheusAPI
- type PrometheusClient
- type PrometheusConfig
Constants ¶
const ( ValidTypeCreate = "valid-create" ValidTypeUpdate = "valid-update" )
Constants for the validation of the pipeline
const ( ISBServiceStatusHealthy = "healthy" ISBServiceStatusCritical = "critical" ISBServiceStatusWarning = "warning" ISBServiceStatusInactive = "inactive" )
Variables ¶
This section is empty.
Functions ¶
func NewDexReverseProxy ¶ added in v1.0.0
NewDexReverseProxy sends the dex request to the dex server.
func NewHandler ¶
func NewHandler(ctx context.Context, dexObj *DexObject, localUsersAuthObject *LocalUsersAuthObject, promQlServiceObj PromQl, opts ...HandlerOption) (*handler, error)
NewHandler is used to provide a new instance of the handler type
func NewNoAuthHandler ¶ added in v1.0.0
func NewNoAuthHandler(dexObj *DexObject, localUsersAuthObject *LocalUsersAuthObject) (*noAuthHandler, error)
NewNoAuthHandler is used to provide a new instance of the handler type
Types ¶
type ActiveStatus ¶ added in v0.11.0
type ActiveStatus struct { Healthy int `json:"Healthy"` Warning int `json:"Warning"` Critical int `json:"Critical"` }
ActiveStatus contains the number of objects in healthy, warning, and critical status.
type ClusterSummaryResponse ¶ added in v0.11.0
type ClusterSummaryResponse []NamespaceSummary
ClusterSummaryResponse is a list of NamespaceSummary of all the namespaces in a cluster wrapped in a list.
type ContainerDetails ¶ added in v1.4.0
type ContainerDetails struct { Name string `json:"name"` ID string `json:"id"` State string `json:"state"` LastStartedAt string `json:"lastStartedAt"` RestartCount int32 `json:"restartCount"` LastTerminationReason string `json:"lastTerminationReason"` LastTerminationMessage string `json:"lastTerminationMessage"` WaitingReason string `json:"waitingReason"` WaitingMessage string `json:"waitingMessage"` TotalCPU string `json:"totalCPU"` TotalMemory string `json:"totalMemory"` RequestedCPU string `json:"requestedCPU"` RequestedMemory string `json:"requestedMemory"` LimitCPU string `json:"limitCPU"` LimitMemory string `json:"limitMemory"` }
type DexObject ¶ added in v1.0.0
type DexObject struct {
// contains filtered or unexported fields
}
DexObject is a struct that holds details for dex handlers.
func NewDexObject ¶ added in v1.0.0
NewDexObject returns a new DexObject.
type DexRewriteURLRoundTripper ¶ added in v1.0.0
type DexRewriteURLRoundTripper struct { DexURL *url.URL T http.RoundTripper }
DexRewriteURLRoundTripper is an HTTP RoundTripper to rewrite HTTP requests to the specified dex server address. This is used when reverse proxying Dex to avoid the API server from unnecessarily communicating to the numaflow server through its externally facing load balancer, which is not always permitted in firewalled/air-gapped networks.
func NewDexRewriteURLRoundTripper ¶ added in v1.0.0
func NewDexRewriteURLRoundTripper(dexServerAddr string, T http.RoundTripper) DexRewriteURLRoundTripper
NewDexRewriteURLRoundTripper creates a new DexRewriteURLRoundTripper
type Dimensions ¶ added in v1.4.0
type DiscoveryResponse ¶ added in v1.4.0
type DiscoveryResponse struct { MetricName string `json:"metric_name"` Dimensions []Dimensions `json:"dimensions"` }
func NewDiscoveryResponse ¶ added in v1.4.0
func NewDiscoveryResponse(metricName string, dimensions []Dimensions) DiscoveryResponse
NewDiscoveryResponse creates a new DiscoveryResponse object for each metric.
type HandlerOption ¶ added in v1.3.0
type HandlerOption func(*handlerOptions)
func WithDaemonClientProtocol ¶ added in v1.3.0
func WithDaemonClientProtocol(protocol string) HandlerOption
WithDaemonClientProtocol sets the protocol of the daemon client.
func WithReadOnlyMode ¶ added in v1.3.0
func WithReadOnlyMode() HandlerOption
WithReadOnlyMode sets the server to read-only mode.
type HealthChecker ¶ added in v1.2.0
type HealthChecker struct {
// contains filtered or unexported fields
}
HealthChecker is the struct to hold the resource status cache for the pipeline and Mono Vertex
func NewHealthChecker ¶ added in v1.2.0
func NewHealthChecker(ctx context.Context) *HealthChecker
NewHealthChecker is used to create a new health checker
type HealthResponse ¶ added in v1.2.0
type HealthResponse struct { ResourceHealthStatus string `json:"resourceHealthStatus"` DataHealthStatus string `json:"dataHealthStatus"` ResourceHealthMessage string `json:"resourceHealthMessage"` DataHealthMessage string `json:"dataHealthMessage"` ResourceHealthCode string `json:"resourceHealthCode"` DataHealthCode string `json:"dataHealthCode"` }
HealthResponse is the response payload for health API. It contains the health status of the vertex and data. We include the Status, Message and Code for both resources and data.
func NewHealthResponse ¶ added in v1.2.0
func NewHealthResponse(resourceHealthStatus string, dataHealthStatus string, resourceHealthMessage string, dataHealthMessage string, resourceHealthCode string, dataHealthCode string) HealthResponse
NewHealthResponse returns a HealthResponse object for the given status, message and code.
type ISBService ¶ added in v0.11.0
type ISBService struct { Name string `json:"name"` Status string `json:"status"` ISBService v1alpha1.InterStepBufferService `json:"isbService"` }
ISBService gives the summarized information of an InterStepBufferService
func NewISBService ¶ added in v0.11.0
func NewISBService(status string, isb *v1alpha1.InterStepBufferService) ISBService
NewISBService creates a new ISBService object with the given specifications
type ISBServices ¶ added in v0.11.0
type ISBServices []ISBService
ISBServices is a list of InterStepBufferServices
type IsbServiceSummary ¶ added in v0.11.0
type IsbServiceSummary struct { Active ActiveStatus `json:"active"` Inactive int `json:"inactive"` }
IsbServiceSummary summarizes the number of active and inactive ISB Service.
type K8sEventsResponse ¶ added in v0.11.0
type K8sEventsResponse struct { TimeStamp int64 `json:"timestamp"` Type string `json:"type"` // Object is in the format of "kind/name", e.g. "Pipeline/simple-pipeline" Object string `json:"object"` Reason string `json:"reason"` Message string `json:"message"` }
func NewK8sEventsResponse ¶ added in v0.11.0
func NewK8sEventsResponse(timestamp int64, eventType, objectKind, objectName, reason, message string) K8sEventsResponse
NewK8sEventsResponse creates a new K8sEventsResponse object with the given inputs.
type LocalUsersAuthObject ¶ added in v1.1.0
type LocalUsersAuthObject struct {
// contains filtered or unexported fields
}
func NewLocalUsersAuthObject ¶ added in v1.1.0
func NewLocalUsersAuthObject(ctx context.Context, authDisabled bool) (*LocalUsersAuthObject, error)
NewLocalUsersAuthObject is used to provide a new LocalUsersAuthObject
func (*LocalUsersAuthObject) Authenticate ¶ added in v1.1.0
func (*LocalUsersAuthObject) GenerateToken ¶ added in v1.1.0
GenerateToken generates a jwt token for the given username
func (*LocalUsersAuthObject) ParseToken ¶ added in v1.1.0
func (l *LocalUsersAuthObject) ParseToken(c *gin.Context, tokenString string) (jwt.MapClaims, error)
ParseToken parses a jwt token and returns the claims
func (*LocalUsersAuthObject) VerifyUser ¶ added in v1.1.0
type LoginInput ¶ added in v1.1.0
type LoginResponse ¶ added in v1.0.0
type LoginResponse struct {
AuthCodeURL string `json:"AuthCodeURL"`
}
LoginResponse is the response payload for login API.
func NewLoginResponse ¶ added in v1.0.0
func NewLoginResponse(url string) LoginResponse
NewLoginResponse returns a LoginResponse object for the given url.
type MetricsDiscoveryResponse ¶ added in v1.4.0
type MetricsDiscoveryResponse []DiscoveryResponse
MetricsDiscoveryResponse is a list of DiscoveryResponse
type MetricsRequestBody ¶ added in v1.4.0
type MonoVertexInfo ¶ added in v1.3.0
type MonoVertexInfo struct { Name string `json:"name"` // Status shows whether the mono vertex is healthy, warning, critical or inactive. Status string `json:"status"` // MonoVertex contains the detailed mono vertex spec. MonoVertex v1alpha1.MonoVertex `json:"monoVertex"` }
func NewMonoVertexInfo ¶ added in v1.3.0
func NewMonoVertexInfo(status string, mvt *v1alpha1.MonoVertex) MonoVertexInfo
NewMonoVertexInfo creates a new MonoVertexInfo object with the given status and lag
type MonoVertexSummary ¶ added in v1.3.0
type MonoVertexSummary struct { Active ActiveStatus `json:"active"` Inactive int `json:"inactive"` }
MonoVertexSummary summarizes the number of active and inactive mono vertices.
type MonoVertices ¶ added in v1.3.0
type MonoVertices []MonoVertexInfo
MonoVertices is a list of mono vertices
type NamespaceSummary ¶ added in v1.0.0
type NamespaceSummary struct { // IsEmpty indicates whether there are numaflow resources in the namespace. // resources include pipelines and ISB services. IsEmpty bool `json:"isEmpty"` // Namespace is the name of the namespace. Namespace string `json:"namespace"` PipelineSummary PipelineSummary `json:"pipelineSummary"` IsbServiceSummary IsbServiceSummary `json:"isbServiceSummary"` MonoVertexSummary MonoVertexSummary `json:"monoVertexSummary"` }
NamespaceSummary summarizes information for a given namespace.
func NewNamespaceSummary ¶ added in v1.0.0
func NewNamespaceSummary( namespace string, pipelineSummary PipelineSummary, isbSummary IsbServiceSummary, monoVertexSummary MonoVertexSummary) NamespaceSummary
NewNamespaceSummary creates a new NamespaceSummary object with the given specifications.
type NumaflowAPIResponse ¶ added in v0.11.0
type NumaflowAPIResponse struct { // ErrMsg provides more detailed error information. If API call succeeds, the ErrMsg is nil. ErrMsg *string `json:"errMsg,omitempty"` // Data is the response body. Data any `json:"data"` }
func NewNumaflowAPIResponse ¶ added in v0.11.0
func NewNumaflowAPIResponse(errMsg *string, data any) NumaflowAPIResponse
NewNumaflowAPIResponse creates a new NumaflowAPIResponse.
func (NumaflowAPIResponse) MarshalJSON ¶ added in v1.3.0
func (r NumaflowAPIResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will marshal the response into a JSON object without having nested "value" field in the JSON for google.protobuf.* types.
type PipelineInfo ¶ added in v0.11.0
type PipelineInfo struct { Name string `json:"name"` // Status shows whether the pipeline is healthy, warning, critical or inactive. Status string `json:"status"` // Lag shows the pipeline lag. Lag *int64 `json:"lag,omitempty"` // Pipeline contains the detailed pipeline spec. Pipeline v1alpha1.Pipeline `json:"pipeline"` }
func NewPipelineInfo ¶ added in v0.11.0
func NewPipelineInfo(status string, lag *int64, pl *v1alpha1.Pipeline) PipelineInfo
NewPipelineInfo creates a new PipelineInfo object with the given status and lag
type PipelineSummary ¶ added in v0.11.0
type PipelineSummary struct { Active ActiveStatus `json:"active"` Inactive int `json:"inactive"` }
PipelineSummary summarizes the number of active and inactive pipelines.
type PodDetails ¶ added in v1.4.0
type PromQl ¶ added in v1.4.0
type PromQl interface { QueryPrometheus(context.Context, string, time.Time, time.Time) (model.Value, error) BuildQuery(MetricsRequestBody) (string, error) PopulateReqMap(MetricsRequestBody) map[string]string GetConfigData() *PrometheusConfig DisableMetricsChart() bool }
func NewPromQlServiceObject ¶ added in v1.4.0
NewPromQlServiceObject creates a new PromQlService instance
type PromQlService ¶ added in v1.4.0
type PromQlService struct { PrometheusClient *Prometheus PlaceHolders map[string]map[string][]string Expression map[string]map[string]string ConfigData *PrometheusConfig }
func (*PromQlService) BuildQuery ¶ added in v1.4.0
func (b *PromQlService) BuildQuery(requestBody MetricsRequestBody) (string, error)
BuildQuery build constructs the PromQL query string
func (*PromQlService) DisableMetricsChart ¶ added in v1.4.0
func (b *PromQlService) DisableMetricsChart() bool
func (*PromQlService) GetConfigData ¶ added in v1.4.0
func (b *PromQlService) GetConfigData() *PrometheusConfig
GetConfigData returns the PrometheusConfig
func (*PromQlService) PopulateReqMap ¶ added in v1.4.0
func (b *PromQlService) PopulateReqMap(requestBody MetricsRequestBody) map[string]string
PopulateReqMap populate map based on req fields
type Prometheus ¶ added in v1.4.0
type Prometheus struct { Client PrometheusClient Api PrometheusAPI }
Prometheus struct holds the client and API
type PrometheusAPI ¶ added in v1.4.0
type PrometheusAPI interface {
QueryRange(ctx context.Context, query string, r v1.Range, opts ...v1.Option) (model.Value, v1.Warnings, error)
}
PrometheusAPI interface for the Prometheus API
type PrometheusClient ¶ added in v1.4.0
type PrometheusClient interface { // Do implement client methods here Do(context.Context, *http.Request) (*http.Response, []byte, error) }
PrometheusClient interface for the Prometheus HTTP client
type PrometheusConfig ¶ added in v1.4.0
Source Files ¶
- dexauthn.go
- handler.go
- health.go
- local_user_authn.go
- noauthhandler.go
- promql_service.go
- response.go
- response_cluster_summary.go
- response_health.go
- response_isb_services.go
- response_k8s_events.go
- response_login.go
- response_metrics.go
- response_metrics_discovery.go
- response_mono_vertex.go
- response_pipeline.go
- response_pod.go
- test_utils.go