{"modulePath":"github.com/CrunchyData/postgres-operator","version":"v4.5.9+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pgadmin\n\n## Functions\n\n```go\nfunc DeleteUser(qr *queryRunner, username string) error\n```\nDeleteUser deletes the specified user, their servergroups, and servers\n\n```go\nfunc GetPgAdminQueryRunner(clientset kubernetes.Interface, restconfig *rest.Config, cluster *crv1.Pgcluster) (*queryRunner, error)\n```\nGetPgAdminQueryRunner takes cluster information, identifies whether it has a pgAdmin deployment and provides a query runner for executing queries against the pgAdmin database\n\nThe pointer will be nil if there is no pgAdmin deployed for the cluster\n\n```go\nfunc GetUsernames(qr *queryRunner) ([]string, error)\n```\nGetUsernames provides a list of the provisioned pgadmin login users\n\n```go\nfunc HashPassword(qr *queryRunner, pass string) (string, error)\n```\nHashPassword emulates the PBKDF2 password hashing mechanism using a salt randomly generated and stored in the pgadmin database\n\nIt returns a string of the Modular Crypt Format result of the hash, suitable for insertion/replacement of pgadmin login password fields\n\n```go\nfunc NewQueryRunner(clientset kubernetes.Interface, apic *rest.Config, pod v1.Pod) *queryRunner\n```\nNewQueryRunner creates a query runner instance with the configuration necessary to exec into the named pod in the provided namespace\n\n```go\nfunc SetClusterConnection(qr *queryRunner, username string, dbInfo ServerEntry) error\n```\nConfigures a PG connection for the given username in the pgadmin database\n\n```go\nfunc SetLoginPassword(qr *queryRunner, username, pass string) error\n```\nSets the login password for the given username in the pgadmin database Adds the user to the pgadmin database if it does not exist\n\n## Types\n\n```go\ntype Backoff interface {\n\tDuration(round int) time.Duration\n}\n```\nBackoff interface provides increasing length delays for event spacing\n\n```go\ntype ExponentialBackoffPolicy struct {\n\tRatio      float64\n\tBase       time.Duration\n\tMaximum    time.Duration\n\tJitterMode Jitter\n}\n```\nExponentialBackoffPolicy provides an exponential backoff based on: Base \\* (Ratio ^ Iteration)\n\nFor example a base of 10ms, ratio of 2, and no jitter would produce: 10ms, 20ms, 40ms, 80ms, 160ms, 320ms, 640ms, 1.28s, 2.56s...\n\n```go\nfunc (cbp ExponentialBackoffPolicy) Duration(n int) time.Duration\n```\n\n```go\ntype Jitter int\n```\nJitter is an enum representing a distinct jitter mode\n\n```go\nconst (\n\t// JitterNone performs no Jitter, with multiple clients, can be bursty\n\tJitterNone Jitter = iota\n\t// JitterFull represents a jitter range of (0, Duration)\n\tJitterFull\n\t// JitterCenter represents a jitter range of (0.5 Duration, 1.5 Duration)\n\t// That is, full, but centered on the value\n\tJitterCenter\n\t// JitterSmall represents a jitter range of 0.75 Duration, 1.25 Duration)\n\tJitterSmall\n)\n```\n\n```go\nfunc (jm Jitter) Apply(t time.Duration) time.Duration\n```\nApply provides a new time with respect to t based on the jitter mode\n\n```go\ntype ServerEntry struct {\n\tName          string // Typically set to the cluster name\n\tHost          string\n\tPort          int\n\tMaintenanceDB string\n\tSSLMode       string\n\tComment       string\n\tPassword      string\n}\n```\nServerEntry models parts of the pgadmin server table\n\n```go\nfunc ServerEntryFromPgService(service *v1.Service, clustername string) ServerEntry\n```\nServerEntryFromPgService populates the ServerEntry struct based on details of the kubernetes service, it is up to the caller to provide the assumed PgCluster service\n\n```go\ntype SpecificBackoffPolicy struct {\n\tTimes      []time.Duration\n\tJitterMode Jitter\n}\n```\nSpecificBackoffPolicy allows manually specifying retry times\n\n```go\nfunc (sbp SpecificBackoffPolicy) Duration(n int) time.Duration\n```\n\n","path":"github.com/CrunchyData/postgres-operator/internal/pgadmin","name":"pgadmin","synopsis":"","isRedistributable":true}
