Documentation ¶
Index ¶
- Constants
- func AddFileToTar(tw *tar.Writer, name string, content []byte) error
- func AddFileToZip(zw *zip.Writer, name string, content []byte) error
- func CreateNamespace(ctx context.Context, client client.Client, namespaceName string) error
- func CreateObject(ctx context.Context, c client.Client, kind, namespace, name string, ...) error
- func DeleteNamespace(ctx context.Context, client client.Client, namespaceName string) error
- func DeleteObject(ctx context.Context, c client.Client, kind, namespace, name string) error
- func ExportResources(ctx context.Context, c client.Client, resInfoList []ResourceInfo) (*bytes.Buffer, error)
- func ForObject(kind string) (client.Object, error)
- func GetDataSet(ctx context.Context, c client.Client, namespace string, name string) (*windtunnelv1alpha1.DataSet, error)
- func GetObject(ctx context.Context, c client.Client, kind, namespace, name string) (client.Object, error)
- func GetObjectList(ctx context.Context, c client.Client, kind 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, kind, namespace, name string, ...) error
- type CustomResourceMeta
- type CustomResourceWrapper
- type ExportResourcesInfo
- type HealthCheckMeta
- type ImportResourcesStatistics
- 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 ResourceInfo
- type ResultPoint
- type UnixTimestamp
Constants ¶
const ( DATA_SOURCE_PROM = "prometheus" DATA_SOURCE_REDIS = "redis" )
const ( SchemaKind string = "Schema" DatasetKind string = "DataSet" LoadPatternKind string = "LoadPattern" PipelineKind string = "Pipeline" ExperimentKind string = "Experiment" PlantDCoreKind string = "PlantDCore" CostExporterKind string = "CostExporter" )
Constants defining the possible Kind names that can be used in the schema.GroupVersionKind struct.
Variables ¶
This section is empty.
Functions ¶
func AddFileToTar ¶
AddFileToTar adds a file with the given content to a tar.Writer.
func AddFileToZip ¶ added in v1.1.0
AddFileToZip adds a file with the given content to a zip.Writer.
func CreateNamespace ¶
CreateNamespace creates a new namespace with the provided name.
func CreateObject ¶
func CreateObject(ctx context.Context, c client.Client, kind, namespace, name string, obj client.Object) error
CreateObject creates a new object of the provided kind, namespace, name. Only the spec field of the obj parameter will be used.
func DeleteNamespace ¶
DeleteNamespace deletes the namespace with the provided name.
func DeleteObject ¶
DeleteObject deletes an existing object of the provided kind, namespace, name.
func ExportResources ¶ added in v1.1.0
func GetDataSet ¶ added in v1.1.0
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 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, name.
func GetObjectList ¶
GetObjectList retrieves a list of objects of the provided kind.
func GetSampleDataSet ¶ added in v1.1.0
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 ImportResourcesStatistics ¶ added in v1.1.0
type ImportResourcesStatistics struct { NumSucceeded int `json:"numSucceeded"` NumFailed int `json:"numFailed"` ErrorMessages []string `json:"errors"` }
func ImportResources ¶ added in v1.1.0
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 ¶
type QueryAgent struct {
PromAPI prometheusv1.API
}
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 ResourceInfo ¶ added in v1.1.0
type ResourceInfo struct { Kind string types.NamespacedName }
type ResultPoint ¶
type UnixTimestamp ¶
func (*UnixTimestamp) UnmarshalJSON ¶
func (ts *UnixTimestamp) UnmarshalJSON(b []byte) (err error)