Documentation ¶
Index ¶
- Constants
- func AddFileToTar(tw *tar.Writer, name string, content []byte) error
- func CheckPipelineHealth(ctx context.Context, c client.Client, URL string, HealthCheckEndpoint string) error
- func CreateNamespace(ctx context.Context, client client.Client, namespaceName string) (namespaceExists, creationFailed error)
- func CreateObject(ctx context.Context, c client.Client, newObj client.Object, kind string) (objectExists, creationFailed error)
- func DeleteNamespace(ctx context.Context, client client.Client, namespaceName string) (namespaceNotFound, deletionFailed error)
- func DeleteObject(ctx context.Context, c client.Client, kind, namespace, name string) (objectNotFound, deletionFailed error)
- func ForObject(kind string) client.Object
- func ForObjectList(kind string) client.ObjectList
- func GetDataset(ctx context.Context, c client.Client, namespace string, name string) (*windtunnelv1alpha1.DataSet, error)
- func GetIndexByName(schemas []windtunnelv1alpha1.SchemaSelector, schemaName string) (int, bool)
- func GetObject(ctx context.Context, c client.Client, kind, namespace, name string) (client.Object, error)
- func GetObjectList(ctx context.Context, c client.Client, kind, namespace string) (client.ObjectList, error)
- func GetSampleDataset(ctx context.Context, c client.Client, namespace string, datasetName string) (string, *bytes.Buffer, error)
- func GetSchema(ctx context.Context, c client.Client, namespace string, name string) (*windtunnelv1alpha1.Schema, error)
- func ListNamespaces(ctx context.Context, client client.Client) (*corev1.NamespaceList, error)
- func SampleValueToFloatPointer(v model.SampleValue) *float64
- func UpdateObject(ctx context.Context, c client.Client, updated client.Object, kind string) (notFound, updationFailed error)
- type CustomResourceMeta
- type CustomResourceWrapper
- type ExportResourcesInfo
- type HealthCheckMeta
- type LabelSelector
- type NamespaceInfo
- type QueryAgent
- func (c *QueryAgent) QueryBiChann(ctx context.Context, req *QueryRequest) (*QueryResult, error)
- func (c *QueryAgent) QueryBiChannProm(ctx context.Context, req *QueryRequest) (*QueryResult, error)
- func (c *QueryAgent) QueryBiChannRedis(ctx context.Context, req *QueryRequest) (*QueryResult, error)
- func (c *QueryAgent) QueryTriChann(ctx context.Context, req *QueryRequest) (*QueryResult, error)
- func (c *QueryAgent) QueryTriChannProm(ctx context.Context, req *QueryRequest) (*QueryResult, error)
- func (c *QueryAgent) QueryTriChannRedis(ctx context.Context, req *QueryRequest) (*QueryResult, error)
- type QueryClient
- type QueryParam
- type QueryRequest
- type QueryResult
- type ResultPoint
- type UnixTimestamp
Constants ¶
const ( SchemaPlural string = "schemas" DatasetPlural string = "datasets" LoadPatternPlural string = "loadpatterns" PipelinePlural string = "pipelines" ExperimentPlural string = "experiments" PlantDCorePlural string = "plantdcores" CostExporterPlural string = "costexporters" )
Constants defining the plural names of various resources.
const ( DATA_SOURCE_PROM = "prometheus" DATA_SOURCE_REDIS = "redis" )
Variables ¶
This section is empty.
Functions ¶
func AddFileToTar ¶
AddFileToTar adds a file with the given content to a tar.Writer.
func CheckPipelineHealth ¶
func CheckPipelineHealth(ctx context.Context, c client.Client, URL string, HealthCheckEndpoint string) error
CheckPipelineHealth checks the health of a pipeline.
func CreateNamespace ¶
func CreateNamespace(ctx context.Context, client client.Client, namespaceName string) (namespaceExists, creationFailed error)
CreateNamespace creates a new namespace with the provided name.
func CreateObject ¶
func CreateObject(ctx context.Context, c client.Client, newObj client.Object, kind string) (objectExists, creationFailed error)
CreateObject creates a new object of the provided kind.
func DeleteNamespace ¶
func DeleteNamespace(ctx context.Context, client client.Client, namespaceName string) (namespaceNotFound, deletionFailed error)
DeleteNamespace deletes the namespace with the provided name.
func DeleteObject ¶
func DeleteObject(ctx context.Context, c client.Client, kind, namespace, name string) (objectNotFound, deletionFailed error)
DeleteObject deletes an existing object of the provided kind, namespace, and name.
func ForObjectList ¶
func ForObjectList(kind string) client.ObjectList
ForObjectList returns a client.ObjectList instance based on the provided kind.
func GetDataset ¶
func GetDataset(ctx context.Context, c client.Client, namespace string, name string) (*windtunnelv1alpha1.DataSet, error)
GetDataset retrieves a DataSet object by namespace and name.
func GetIndexByName ¶
func GetIndexByName(schemas []windtunnelv1alpha1.SchemaSelector, schemaName string) (int, bool)
GetIndexByName retrieves the index of a schema by name from a list of schema selectors.
func GetObject ¶
func GetObject(ctx context.Context, c client.Client, kind, namespace, name string) (client.Object, error)
GetObject retrieves an object of the provided kind, namespace, and name.
func GetObjectList ¶
func GetObjectList(ctx context.Context, c client.Client, kind, namespace string) (client.ObjectList, error)
GetObjectList retrieves a list of objects of the provided kind and namespace.
func GetSampleDataset ¶
func GetSampleDataset(ctx context.Context, c client.Client, namespace string, datasetName string) (string, *bytes.Buffer, error)
GetSampleDataset generates a sample dataset based on the provided dataset name.
func GetSchema ¶
func GetSchema(ctx context.Context, c client.Client, namespace string, name string) (*windtunnelv1alpha1.Schema, error)
GetSchema retrieves a Schema object by namespace and name.
func ListNamespaces ¶
ListNamespaces retrieves a list of all namespaces.
func SampleValueToFloatPointer ¶
func SampleValueToFloatPointer(v model.SampleValue) *float64
Types ¶
type CustomResourceMeta ¶
type CustomResourceMeta struct { Namespace string `json:"namespace,omitempty"` Name string `json:"name,omitempty"` Kind string `json:"kind,omitempty"` }
CustomResourceMeta represents metadata information for a custom resource.
type CustomResourceWrapper ¶
CustomResourceWrapper is a wrapper for a custom resource that implements the client.Object interface.
type ExportResourcesInfo ¶
type ExportResourcesInfo struct {
Metadata []CustomResourceMeta `json:"metadata,omitempty"`
}
ExportResourcesInfo represents information about custom resources to be exported.
type HealthCheckMeta ¶
type HealthCheckMeta struct { URL string `json:"url,omitempty"` HealthCheckEndpoint string `json:"healthCheckEndpoint,omitempty"` }
HealthCheckMeta represents metadata for health check information.
type LabelSelector ¶
type LabelSelector struct {
TargetLabels []string
}
func NewLabelSelector ¶
func NewLabelSelector(labels []string) *LabelSelector
func (*LabelSelector) GetSeriesFromMetric ¶
func (s *LabelSelector) GetSeriesFromMetric(labelSet model.Metric) string
type NamespaceInfo ¶
type NamespaceInfo struct { Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` }
NamespaceInfo represents information about a namespace.
type QueryAgent ¶
func NewQueryAgent ¶
func NewQueryAgent(url string) (*QueryAgent, error)
func (*QueryAgent) QueryBiChann ¶
func (c *QueryAgent) QueryBiChann(ctx context.Context, req *QueryRequest) (*QueryResult, error)
func (*QueryAgent) QueryBiChannProm ¶
func (c *QueryAgent) QueryBiChannProm(ctx context.Context, req *QueryRequest) (*QueryResult, error)
func (*QueryAgent) QueryBiChannRedis ¶
func (c *QueryAgent) QueryBiChannRedis(ctx context.Context, req *QueryRequest) (*QueryResult, error)
func (*QueryAgent) QueryTriChann ¶
func (c *QueryAgent) QueryTriChann(ctx context.Context, req *QueryRequest) (*QueryResult, error)
func (*QueryAgent) QueryTriChannProm ¶
func (c *QueryAgent) QueryTriChannProm(ctx context.Context, req *QueryRequest) (*QueryResult, error)
func (*QueryAgent) QueryTriChannRedis ¶
func (c *QueryAgent) QueryTriChannRedis(ctx context.Context, req *QueryRequest) (*QueryResult, error)
type QueryClient ¶
type QueryClient interface { QueryBiChann(ctx context.Context, req *QueryRequest) (*QueryResult, error) QueryTriChann(ctx context.Context, req *QueryRequest) (*QueryResult, error) }
type QueryParam ¶
type QueryParam struct { Query string `json:"query,omitempty"` StartTimestamp UnixTimestamp `json:"start,omitempty"` EndTimestamp UnixTimestamp `json:"end,omitempty"` Step int64 `json:"step,omitempty"` LabelSelector []string `json:"labelSelector,omitempty"` Keys []string `json:"keys,omitempty"` }
type QueryRequest ¶
type QueryRequest struct { Source string `json:"source"` Param QueryParam `json:"params"` }
type QueryResult ¶
type QueryResult struct {
Result []ResultPoint `json:"result"`
}
type ResultPoint ¶
type UnixTimestamp ¶
func (*UnixTimestamp) UnmarshalJSON ¶
func (ts *UnixTimestamp) UnmarshalJSON(b []byte) (err error)