postgres

package
v0.0.0-...-18f6e75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SortFilterPostgresInstance = sortfilter.New[*PostgresInstance, PostgresInstanceOrderField, struct{}]()

Functions

func AddSearchZalandoPostgres

func AddSearchZalandoPostgres(client search.Client, watcher *watcher.Watcher[*PostgresInstance])

func CountForTeam

func CountForTeam(ctx context.Context, teamSlug slug.Slug) int

func GetAuditLogConfig

func GetAuditLogConfig(ctx context.Context) (projectID, location string)

GetAuditLogConfig returns the audit log configuration from context

func GetAuditURL

func GetAuditURL(ctx context.Context, audit *PostgresInstanceAudit) (*string, error)

func GrantZalandoPostgresAccess

func GrantZalandoPostgresAccess(ctx context.Context, input GrantPostgresAccessInput) error

func NewLoaderContext

func NewLoaderContext(
	ctx context.Context,
	zalandoPostgresWatcher *watcher.Watcher[*PostgresInstance],
	auditLogProjectID string,
	auditLogLocation string,
) context.Context

func NewZalandoPostgresWatcher

func NewZalandoPostgresWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*PostgresInstance]

func WorkloadsForInstance

func WorkloadsForInstance(ctx context.Context, teamSlug slug.Slug, environmentName, clusterName string) []workload.Workload

Types

type GrantPostgresAccessInput

type GrantPostgresAccessInput struct {
	ClusterName     string    `json:"clusterName"`
	TeamSlug        slug.Slug `json:"teamSlug"`
	EnvironmentName string    `json:"environmentName"`
	Grantee         string    `json:"grantee"`
	Duration        string    `json:"duration"`
}

func (*GrantPostgresAccessInput) Validate

func (i *GrantPostgresAccessInput) Validate(ctx context.Context) error

func (*GrantPostgresAccessInput) ValidationErrors

type GrantPostgresAccessPayload

type GrantPostgresAccessPayload struct {
	Error *string `json:"error,omitempty"`
}

type PostgresGrantAccessActivityLogEntry

type PostgresGrantAccessActivityLogEntry struct {
	activitylog.GenericActivityLogEntry

	Data *PostgresGrantAccessActivityLogEntryData `json:"data"`
}

type PostgresGrantAccessActivityLogEntryData

type PostgresGrantAccessActivityLogEntryData struct {
	Grantee string    `json:"grantee,string"`
	Until   time.Time `json:"until"`
}

type PostgresInstance

type PostgresInstance struct {
	Name              string                             `json:"name"`
	EnvironmentName   string                             `json:"-"`
	WorkloadReference *workload.Reference                `json:"-"`
	TeamSlug          slug.Slug                          `json:"-"`
	Resources         *PostgresInstanceResources         `json:"resources"`
	MajorVersion      string                             `json:"majorVersion"`
	Audit             PostgresInstanceAudit              `json:"audit"`
	MaintenanceWindow *PostgresInstanceMaintenanceWindow `json:"maintenanceWindow,omitempty"`
	HighAvailability  bool                               `json:"highAvailability"`
	State             PostgresInstanceState              `json:"state"`
}

func GetForWorkload

func GetForWorkload(ctx context.Context, teamSlug slug.Slug, environmentName, clusterName string) (*PostgresInstance, error)

func GetZalandoPostgres

func GetZalandoPostgres(ctx context.Context, teamSlug slug.Slug, environmentName string, clusterName string) (*PostgresInstance, error)

func GetZalandoPostgresByIdent

func GetZalandoPostgresByIdent(ctx context.Context, id ident.Ident) (*PostgresInstance, error)

func ListAllForTeam

func ListAllForTeam(ctx context.Context, teamSlug slug.Slug) []*PostgresInstance

func (*PostgresInstance) DeepCopyObject

func (p *PostgresInstance) DeepCopyObject() runtime.Object

func (*PostgresInstance) GetLabels

func (p *PostgresInstance) GetLabels() map[string]string

func (*PostgresInstance) GetName

func (p *PostgresInstance) GetName() string

func (*PostgresInstance) GetNamespace

func (p *PostgresInstance) GetNamespace() string

func (*PostgresInstance) GetObjectKind

func (p *PostgresInstance) GetObjectKind() schema.ObjectKind

func (*PostgresInstance) ID

func (p *PostgresInstance) ID() ident.Ident

func (PostgresInstance) IsNode

func (PostgresInstance) IsNode()

func (PostgresInstance) IsPersistence

func (PostgresInstance) IsPersistence()

func (PostgresInstance) IsSearchNode

func (PostgresInstance) IsSearchNode()

type PostgresInstanceAudit

type PostgresInstanceAudit struct {
	Enabled          bool      `json:"enabled"`
	StatementClasses []string  `json:"statementClasses,omitempty"`
	TeamSlug         slug.Slug `json:"-"`
	EnvironmentName  string    `json:"-"`
	InstanceName     string    `json:"-"`
}

type PostgresInstanceConnection

type PostgresInstanceConnection = pagination.Connection[*PostgresInstance]

type PostgresInstanceEdge

type PostgresInstanceEdge = pagination.Edge[*PostgresInstance]

type PostgresInstanceMaintenanceWindow

type PostgresInstanceMaintenanceWindow struct {
	Day  int `json:"day"`
	Hour int `json:"hour"`
}

type PostgresInstanceOrder

type PostgresInstanceOrder struct {
	Field     PostgresInstanceOrderField `json:"field"`
	Direction model.OrderDirection       `json:"direction"`
}

type PostgresInstanceOrderField

type PostgresInstanceOrderField string
const (
	PostgresInstanceOrderFieldName        PostgresInstanceOrderField = "NAME"
	PostgresInstanceOrderFieldEnvironment PostgresInstanceOrderField = "ENVIRONMENT"
)

func (PostgresInstanceOrderField) IsValid

func (e PostgresInstanceOrderField) IsValid() bool

func (PostgresInstanceOrderField) MarshalGQL

func (e PostgresInstanceOrderField) MarshalGQL(w io.Writer)

func (PostgresInstanceOrderField) MarshalJSON

func (e PostgresInstanceOrderField) MarshalJSON() ([]byte, error)

func (PostgresInstanceOrderField) String

func (*PostgresInstanceOrderField) UnmarshalGQL

func (e *PostgresInstanceOrderField) UnmarshalGQL(v any) error

func (*PostgresInstanceOrderField) UnmarshalJSON

func (e *PostgresInstanceOrderField) UnmarshalJSON(b []byte) error

type PostgresInstanceResources

type PostgresInstanceResources struct {
	CPU      string `json:"cpu"`
	Memory   string `json:"memory"`
	DiskSize string `json:"diskSize"`
}

type PostgresInstanceState

type PostgresInstanceState string
const (
	PostgresInstanceStateAvailable   PostgresInstanceState = "AVAILABLE"
	PostgresInstanceStateProgressing PostgresInstanceState = "PROGRESSING"
	PostgresInstanceStateDegraded    PostgresInstanceState = "DEGRADED"
)

func (PostgresInstanceState) IsValid

func (e PostgresInstanceState) IsValid() bool

func (PostgresInstanceState) MarshalGQL

func (e PostgresInstanceState) MarshalGQL(w io.Writer)

func (PostgresInstanceState) MarshalJSON

func (e PostgresInstanceState) MarshalJSON() ([]byte, error)

func (PostgresInstanceState) String

func (e PostgresInstanceState) String() string

func (*PostgresInstanceState) UnmarshalGQL

func (e *PostgresInstanceState) UnmarshalGQL(v any) error

func (*PostgresInstanceState) UnmarshalJSON

func (e *PostgresInstanceState) UnmarshalJSON(b []byte) error

type TeamInventoryCountPostgresInstances

type TeamInventoryCountPostgresInstances struct {
	Total int `json:"total"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL