Documentation
¶
Index ¶
- Constants
- func BadRequest(w http.ResponseWriter, message string)
- func Decode[T any](r *http.Request) (T, error)
- func ErrorResponse(w http.ResponseWriter, status int, message string)
- func Health(w http.ResponseWriter, r *http.Request)
- func InternalServerErrorResponse(w http.ResponseWriter, err error)
- func JSON[T any](w http.ResponseWriter, status int, v T)
- func NewAuthMiddleware(config *Configuration) func(next http.HandlerFunc) http.HandlerFunc
- func Unauthorized(w http.ResponseWriter, message string)
- type ApiError
- type BackupSchedule
- type BackupScheduleRuntimeClient
- type Configuration
- type DoguConfig
- type ExportResponse
- type FilterOption
- type GlobalConfig
- type KeyValue
- type RuntimeClient
Constants ¶
View Source
const ( NamespaceEnv = "NAMESPACE" ApiKeyEnv = "API_KEY" CronJobVerboseEnv = "EXPORT_CRON_VERBOSE" CronJobEnv = "EXPORT_CRON" )
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, message string)
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, status int, message string)
func InternalServerErrorResponse ¶ added in v0.0.2
func InternalServerErrorResponse(w http.ResponseWriter, err error)
func NewAuthMiddleware ¶
func NewAuthMiddleware(config *Configuration) func(next http.HandlerFunc) http.HandlerFunc
func Unauthorized ¶
func Unauthorized(w http.ResponseWriter, message string)
Types ¶
type BackupSchedule ¶ added in v0.0.2
type BackupScheduleRuntimeClient ¶ added in v0.0.2
type BackupScheduleRuntimeClient struct {
// contains filtered or unexported fields
}
BackupScheduleRuntimeClient contains the RuntimeClient to query custom resources and is used to query the backup schedule custom resource
func NewBackupScheduleRuntimeClient ¶ added in v0.0.2
func NewBackupScheduleRuntimeClient(rclient RuntimeClient, namespace string) *BackupScheduleRuntimeClient
NewBackupScheduleRuntimeClient creates a new NewBackupScheduleRuntimeClient instance
func (*BackupScheduleRuntimeClient) ListBackupSchedules ¶ added in v0.0.2
func (b *BackupScheduleRuntimeClient) ListBackupSchedules(ctx context.Context) (*bup.BackupScheduleList, error)
ListBackupSchedules returns a list of all backup schedule custom resources
type Configuration ¶
type Configuration struct {
// LogLevel controls the granularity and amount of issued log output. Valid values are (always in
// uppercase) `ERROR`, `WARN`, `INFO`, `DEBUG`. Defaults to `ERROR` if left empty.
LogLevel string
// BasePath is the context path of the application, usually "/ces-exporter"
BasePath string
// ApiKey is the api key which is required to access the api
ApiKey string
// Namespace is the namespace in the cluster where the application runs in (only used in multinode ces)
Namespace string
// CronExp is the cron expression for the interval to enable the export mode (only used in multinode ces)
CronExp string
// VerboseCron defines whether the export mode cronjob should log verbose (only used in multinode ces)
VerboseCron bool
// IsClassic defines if the application should start with classic ces configuration or multinode ces configuration
IsClassic bool
// Exporter Port in classic mode
ClassicExportPort int
// VolumesBasePath defines the base directory path for storing volume-related data.
VolumesBasePath string
}
Configuration holds all possible configurations of the exporter app
func ReadConfigFromEnv ¶
func ReadConfigFromEnv() (Configuration, error)
type DoguConfig ¶ added in v0.0.2
type ExportResponse ¶ added in v0.0.2
type ExportResponse struct {
GlobalConfig GlobalConfig `json:"global"`
DoguConfigs []DoguConfig `json:"dogus"`
BackupSchedules []BackupSchedule `json:"backupSchedules"`
}
type FilterOption ¶ added in v0.0.2
type GlobalConfig ¶ added in v0.0.2
type GlobalConfig []KeyValue
type RuntimeClient ¶ added in v0.0.2
RuntimeClient wraps sigs.k8s.io/controller-runtime/pkg/client and is used to query custom resources
Click to show internal directories.
Click to hide internal directories.