Documentation ¶
Index ¶
- Variables
- func NewDatabaseWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*SQLDatabase]
- func NewInstanceWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*SQLInstance]
- func NewLoaderContext(ctx context.Context, client *Client, ...) context.Context
- func Search(ctx context.Context, q string) ([]*search.Result, error)
- type Client
- type ClientOption
- type FakeGoogleAPI
- type Metrics
- type MetricsOptions
- type Option
- type RoundTripFunc
- type SQLAdminService
- type SQLDatabase
- func (d *SQLDatabase) DeepCopyObject() runtime.Object
- func (d *SQLDatabase) GetLabels() map[string]string
- func (d *SQLDatabase) GetName() string
- func (d *SQLDatabase) GetNamespace() string
- func (d *SQLDatabase) GetObjectKind() schema.ObjectKind
- func (d SQLDatabase) ID() ident.Ident
- func (SQLDatabase) IsNode()
- func (SQLDatabase) IsPersistence()
- type SQLInstance
- func (i *SQLInstance) DeepCopyObject() runtime.Object
- func (i *SQLInstance) GetLabels() map[string]string
- func (i *SQLInstance) GetName() string
- func (i *SQLInstance) GetNamespace() string
- func (i *SQLInstance) GetObjectKind() schema.ObjectKind
- func (i SQLInstance) ID() ident.Ident
- func (SQLInstance) IsNode()
- func (SQLInstance) IsPersistence()
- func (SQLInstance) IsSearchNode()
- type SQLInstanceBackupConfiguration
- type SQLInstanceCPU
- type SQLInstanceConnection
- type SQLInstanceDisk
- type SQLInstanceEdge
- type SQLInstanceFlag
- type SQLInstanceFlagConnection
- type SQLInstanceFlagEdge
- type SQLInstanceMaintenanceWindow
- type SQLInstanceMemory
- type SQLInstanceMetrics
- type SQLInstanceOrder
- type SQLInstanceOrderField
- type SQLInstanceState
- type SQLInstanceStatus
- type SQLInstanceUser
- type SQLInstanceUserConnection
- type SQLInstanceUserEdge
- type SQLInstanceUserOrder
- type SQLInstanceUserOrderField
- type TeamInventoryCountSQLInstances
- type TeamServiceUtilizationSQLInstances
- type TeamServiceUtilizationSQLInstancesCPU
- type TeamServiceUtilizationSQLInstancesDisk
- type TeamServiceUtilizationSQLInstancesMemory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SortFilterSQLInstance = sortfilter.New[*SQLInstance, SQLInstanceOrderField, struct{}](SQLInstanceOrderFieldName) SortFilterSQLInstanceUser = sortfilter.New[*SQLInstanceUser, SQLInstanceUserOrderField, struct{}](SQLInstanceUserOrderFieldName) )
Functions ¶
func NewDatabaseWatcher ¶
func NewInstanceWatcher ¶
func NewLoaderContext ¶
Types ¶
type Client ¶
type Client struct { Admin *SQLAdminService // contains filtered or unexported fields }
func NewClient ¶
func NewClient(ctx context.Context, log logrus.FieldLogger, opts ...ClientOption) (*Client, error)
type ClientOption ¶
type ClientOption func(*Client)
func WithFakeClients ¶
func WithFakeClients(enabled bool) ClientOption
func WithInstanceWatcher ¶
func WithInstanceWatcher(w *watcher.Watcher[*SQLInstance]) ClientOption
type FakeGoogleAPI ¶
type FakeGoogleAPI struct { ClientGRPCOptions []option.ClientOption ClientHTTPOptions []option.ClientOption monitoringpb.MetricServiceServer // contains filtered or unexported fields }
func (FakeGoogleAPI) Close ¶
func (f FakeGoogleAPI) Close()
func (FakeGoogleAPI) ListTimeSeries ¶
func (f FakeGoogleAPI) ListTimeSeries(_ context.Context, request *monitoringpb.ListTimeSeriesRequest) (*monitoringpb.ListTimeSeriesResponse, error)
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(ctx context.Context, log log.FieldLogger, opts ...option.ClientOption) (*Metrics, error)
type MetricsOptions ¶
type MetricsOptions struct {
// contains filtered or unexported fields
}
type Option ¶
type Option func(*MetricsOptions)
type RoundTripFunc ¶
type SQLAdminService ¶
type SQLAdminService struct {
// contains filtered or unexported fields
}
func NewSQLAdminService ¶
func NewSQLAdminService(ctx context.Context, log logrus.FieldLogger, opts ...option.ClientOption) (*SQLAdminService, error)
func (*SQLAdminService) GetInstance ¶
type SQLDatabase ¶
type SQLDatabase struct { Name string `json:"name"` Charset *string `json:"charset,omitempty"` Collation *string `json:"collation,omitempty"` DeletionPolicy *string `json:"deletionPolicy,omitempty"` Healthy bool `json:"healthy"` SQLInstanceName string `json:"-"` EnvironmentName string `json:"-"` TeamSlug slug.Slug `json:"-"` }
func GetDatabase ¶
func GetDatabaseByIdent ¶
func (*SQLDatabase) DeepCopyObject ¶
func (d *SQLDatabase) DeepCopyObject() runtime.Object
func (*SQLDatabase) GetLabels ¶
func (d *SQLDatabase) GetLabels() map[string]string
func (*SQLDatabase) GetName ¶
func (d *SQLDatabase) GetName() string
func (*SQLDatabase) GetNamespace ¶
func (d *SQLDatabase) GetNamespace() string
func (*SQLDatabase) GetObjectKind ¶
func (d *SQLDatabase) GetObjectKind() schema.ObjectKind
func (SQLDatabase) ID ¶
func (d SQLDatabase) ID() ident.Ident
func (SQLDatabase) IsNode ¶
func (SQLDatabase) IsNode()
func (SQLDatabase) IsPersistence ¶
func (SQLDatabase) IsPersistence()
type SQLInstance ¶
type SQLInstance struct { Name string `json:"name"` CascadingDelete bool `json:"cascadingDelete"` ConnectionName *string `json:"connectionName,omitempty"` DiskAutoresize *bool `json:"diskAutoresize,omitempty"` DiskAutoresizeLimit *int64 `json:"diskAutoresizeLimit,omitempty"` HighAvailability bool `json:"highAvailability"` Healthy bool `json:"healthy"` MaintenanceVersion *string `json:"maintenanceVersion,omitempty"` MaintenanceWindow *SQLInstanceMaintenanceWindow `json:"maintenanceWindow,omitempty"` BackupConfiguration *SQLInstanceBackupConfiguration `json:"backupConfiguration,omitempty"` ProjectID string `json:"projectID"` Tier string `json:"tier"` Version *string `json:"version,omitempty"` Status *SQLInstanceStatus `json:"status"` Flags []*SQLInstanceFlag `json:"-"` EnvironmentName string `json:"-"` TeamSlug slug.Slug `json:"-"` WorkloadReference *workload.Reference `json:"-"` }
func GetByIdent ¶
func ListAllForTeam ¶
func ListAllForTeam(ctx context.Context, teamSlug slug.Slug) []*SQLInstance
func (*SQLInstance) DeepCopyObject ¶
func (i *SQLInstance) DeepCopyObject() runtime.Object
func (*SQLInstance) GetLabels ¶
func (i *SQLInstance) GetLabels() map[string]string
func (*SQLInstance) GetName ¶
func (i *SQLInstance) GetName() string
func (*SQLInstance) GetNamespace ¶
func (i *SQLInstance) GetNamespace() string
func (*SQLInstance) GetObjectKind ¶
func (i *SQLInstance) GetObjectKind() schema.ObjectKind
func (SQLInstance) ID ¶
func (i SQLInstance) ID() ident.Ident
func (SQLInstance) IsNode ¶
func (SQLInstance) IsNode()
func (SQLInstance) IsPersistence ¶
func (SQLInstance) IsPersistence()
func (SQLInstance) IsSearchNode ¶
func (SQLInstance) IsSearchNode()
type SQLInstanceBackupConfiguration ¶
type SQLInstanceBackupConfiguration struct { Enabled *bool `json:"enabled,omitempty"` StartTime *string `json:"startTime,omitempty"` RetainedBackups *int64 `json:"retainedBackups,omitempty"` PointInTimeRecovery *bool `json:"pointInTimeRecovery,omitempty"` TransactionLogRetentionDays *int64 `json:"transactionLogRetentionDays,omitempty"` }
type SQLInstanceCPU ¶
type SQLInstanceCPU struct { Cores float64 `json:"cores"` Utilization float64 `json:"utilization"` }
func CPUForInstance ¶
func CPUForInstance(ctx context.Context, projectID, instance string) (*SQLInstanceCPU, error)
type SQLInstanceConnection ¶
type SQLInstanceConnection = pagination.Connection[*SQLInstance]
func ListForTeam ¶
func ListForTeam(ctx context.Context, teamSlug slug.Slug, page *pagination.Pagination, orderBy *SQLInstanceOrder) (*SQLInstanceConnection, error)
func ListForWorkload ¶
func ListForWorkload(ctx context.Context, teamSlug slug.Slug, environmentName string, references []nais_io_v1.CloudSqlInstance, orderBy *SQLInstanceOrder) (*SQLInstanceConnection, error)
type SQLInstanceDisk ¶
type SQLInstanceDisk struct { QuotaBytes int `json:"quotaBytes"` Utilization float64 `json:"utilization"` }
func DiskForInstance ¶
func DiskForInstance(ctx context.Context, projectID, instance string) (*SQLInstanceDisk, error)
type SQLInstanceEdge ¶
type SQLInstanceEdge = pagination.Edge[*SQLInstance]
type SQLInstanceFlag ¶
type SQLInstanceFlagConnection ¶
type SQLInstanceFlagConnection = pagination.Connection[*SQLInstanceFlag]
type SQLInstanceFlagEdge ¶
type SQLInstanceFlagEdge = pagination.Edge[*SQLInstanceFlag]
type SQLInstanceMemory ¶
type SQLInstanceMemory struct { QuotaBytes int `json:"quotaBytes"` Utilization float64 `json:"utilization"` }
func MemoryForInstance ¶
func MemoryForInstance(ctx context.Context, projectID, instance string) (*SQLInstanceMemory, error)
type SQLInstanceMetrics ¶
func MetricsFor ¶
func MetricsFor(ctx context.Context, projectID, name string) (*SQLInstanceMetrics, error)
type SQLInstanceOrder ¶
type SQLInstanceOrder struct { Field SQLInstanceOrderField `json:"field"` Direction model.OrderDirection `json:"direction"` }
type SQLInstanceOrderField ¶
type SQLInstanceOrderField string
const ( SQLInstanceOrderFieldName SQLInstanceOrderField = "NAME" SQLInstanceOrderFieldVersion SQLInstanceOrderField = "VERSION" SQLInstanceOrderFieldEnvironment SQLInstanceOrderField = "ENVIRONMENT" SQLInstanceOrderFieldStatus SQLInstanceOrderField = "STATUS" SQLInstanceOrderFieldCost SQLInstanceOrderField = "COST" SQLInstanceOrderFieldCPU SQLInstanceOrderField = "CPU_UTILIZATION" SQLInstanceOrderFieldMemory SQLInstanceOrderField = "MEMORY_UTILIZATION" SQLInstanceOrderFieldDisk SQLInstanceOrderField = "DISK_UTILIZATION" )
func (SQLInstanceOrderField) IsValid ¶
func (e SQLInstanceOrderField) IsValid() bool
func (SQLInstanceOrderField) MarshalGQL ¶
func (e SQLInstanceOrderField) MarshalGQL(w io.Writer)
func (SQLInstanceOrderField) String ¶
func (e SQLInstanceOrderField) String() string
func (*SQLInstanceOrderField) UnmarshalGQL ¶
func (e *SQLInstanceOrderField) UnmarshalGQL(v interface{}) error
type SQLInstanceState ¶
type SQLInstanceState string
const ( SQLInstanceStateUnspecified SQLInstanceState = "UNSPECIFIED" SQLInstanceStateRunnable SQLInstanceState = "RUNNABLE" SQLInstanceStateSuspended SQLInstanceState = "SUSPENDED" SQLInstanceStatePendingDelete SQLInstanceState = "PENDING_DELETE" SQLInstanceStatePendingCreate SQLInstanceState = "PENDING_CREATE" SQLInstanceStateMaintenance SQLInstanceState = "MAINTENANCE" SQLInstanceStateFailed SQLInstanceState = "FAILED" )
func GetState ¶
func GetState(ctx context.Context, project, instance string) (SQLInstanceState, error)
func (SQLInstanceState) String ¶
func (e SQLInstanceState) String() string
type SQLInstanceStatus ¶
type SQLInstanceUser ¶
type SQLInstanceUserConnection ¶
type SQLInstanceUserConnection = pagination.Connection[*SQLInstanceUser]
func ListSQLInstanceUsers ¶
func ListSQLInstanceUsers(ctx context.Context, sqlInstance *SQLInstance, page *pagination.Pagination, orderBy *SQLInstanceUserOrder) (*SQLInstanceUserConnection, error)
type SQLInstanceUserEdge ¶
type SQLInstanceUserEdge = pagination.Edge[*SQLInstanceUser]
type SQLInstanceUserOrder ¶
type SQLInstanceUserOrder struct { Field SQLInstanceUserOrderField `json:"field"` Direction model.OrderDirection `json:"direction"` }
type SQLInstanceUserOrderField ¶
type SQLInstanceUserOrderField string
const ( SQLInstanceUserOrderFieldName SQLInstanceUserOrderField = "NAME" SQLInstanceUserOrderFieldAuthentication SQLInstanceUserOrderField = "AUTHENTICATION" )
func (SQLInstanceUserOrderField) IsValid ¶
func (e SQLInstanceUserOrderField) IsValid() bool
func (SQLInstanceUserOrderField) MarshalGQL ¶
func (e SQLInstanceUserOrderField) MarshalGQL(w io.Writer)
func (SQLInstanceUserOrderField) String ¶
func (e SQLInstanceUserOrderField) String() string
func (*SQLInstanceUserOrderField) UnmarshalGQL ¶
func (e *SQLInstanceUserOrderField) UnmarshalGQL(v interface{}) error
type TeamInventoryCountSQLInstances ¶
type TeamInventoryCountSQLInstances struct {
Total int
}
type TeamServiceUtilizationSQLInstancesCPU ¶
type TeamServiceUtilizationSQLInstancesCPU struct { Used float64 `json:"used"` Requested float64 `json:"requested"` Utilization float64 `json:"utilization"` }
func TeamSummaryCPU ¶
func TeamSummaryCPU(ctx context.Context, projectID string) (*TeamServiceUtilizationSQLInstancesCPU, error)
type TeamServiceUtilizationSQLInstancesDisk ¶
type TeamServiceUtilizationSQLInstancesDisk struct { Used int `json:"used"` Requested int `json:"requested"` Utilization float64 `json:"utilization"` }
func TeamSummaryDisk ¶
func TeamSummaryDisk(ctx context.Context, projectID string) (*TeamServiceUtilizationSQLInstancesDisk, error)
type TeamServiceUtilizationSQLInstancesMemory ¶
type TeamServiceUtilizationSQLInstancesMemory struct { Used int `json:"used"` Requested int `json:"requested"` Utilization float64 `json:"utilization"` }
func TeamSummaryMemory ¶
func TeamSummaryMemory(ctx context.Context, projectID string) (*TeamServiceUtilizationSQLInstancesMemory, error)
Click to show internal directories.
Click to hide internal directories.