Documentation
¶
Overview ¶
Package model contains application data structures and small struct methods
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DesiredState ¶
type DesiredState struct {
// Extensions is a list of Postgres extensions (e.g. postgres_fdw)
Extensions []Extension `yaml:"Extensions,omitempty" json:"Extensions,omitempty"`
// Servers is a list of foreign servers
Servers []ForeignServer `yaml:"Servers,omitempty" json:"Servers,omitempty"`
}
DesiredState is the data structure that describes the desired state to apply to the FDW database
func (DesiredState) String ¶
func (d DesiredState) String() string
type Extension ¶
Extension represents a Postgres extension
type ForeignServer ¶
type ForeignServer struct {
Name string `yaml:"name" json:"name"`
Host string `yaml:"host" json:"host"`
DB string `yaml:"db" json:"db"`
Wrapper string `yaml:"wrapper,omitempty" json:"wrapper,omitempty"`
Owner string `yaml:"-" json:"-"`
UserMaps []UserMap `yaml:"UserMap,omitempty" json:"UserMap,omitempty"`
Schemas []Schema `yaml:"Schemas,omitempty" json:"Schemas,omitempty"`
Port int `yaml:"port" json:"port"`
}
ForeignServer represents a Postgres foreign server including related user mappings and remote schemas
func (*ForeignServer) Equals ¶
func (fs *ForeignServer) Equals(fserver ForeignServer) bool
Equals determines if this object is equal to the supplied object
func (*ForeignServer) String ¶
func (fs *ForeignServer) String() string
type Grants ¶
type Grants struct {
// Users is the list of users to apply the permissions to
Users []string `yaml:"users" json:"users"`
}
Grants represents a permission configuration for an imported remote schema
type Schema ¶
type Schema struct {
ENUMSecret Secret `yaml:"enumsecret,omitempty" json:"enumsecret,omitempty"`
ServerName string `yaml:"-" json:"-"`
LocalSchema string `yaml:"localschema" json:"localschema"`
RemoteSchema string `yaml:"remoteschema" json:"remoteschema"`
ENUMConnection string `yaml:"enumconnection,omitempty" json:"enumconnection,omitempty"`
SchemaGrants Grants `yaml:"grants,omitempty" json:"grants,omitempty"`
ImportENUMs bool `yaml:"importenums" json:"importenums"`
}
Schema represents a foreign schema configuration
type SchemaEnum ¶
func (*SchemaEnum) String ¶
func (se *SchemaEnum) String() string
type Secret ¶
type Secret struct {
// Value represents an explicit credential value to be used verbatim
Value string `yaml:"value,omitempty" json:"value,omitempty"`
// FromEnv represents an environment variable to read the credential from
FromEnv string `yaml:"fromEnv,omitempty" json:"fromEnv,omitempty"`
// FromFile represents a path and filename to read the credential from
FromFile string `yaml:"fromFile,omitempty" json:"fromFile,omitempty"`
// FromK8sSecret represents a Kubernetes secret to read the credential from
FromK8sSecret SecretK8s `yaml:"fromK8s,omitempty" json:"fromK8s,omitempty"`
}
Secret defines where to retrieve a credential from
type SecretK8s ¶
type SecretK8s struct {
// Namespace is the Kubernetes namespace that contains the secret
Namespace string `yaml:"namespace" json:"namespace"`
// SecretName is the name of the Kubernetes secret object
SecretName string `yaml:"secretName" json:"secretName"`
// SecretKey is the name of the key underneath .data which contains the credential
SecretKey string `yaml:"secretKey" json:"secretKey"`
}
SecretK8s represents the location of a base64-encoded credential in a Kubernetes secret
type UserMap ¶
type UserMap struct {
// ServerName is the name of the foreign server
ServerName string `yaml:"-" json:"-"`
// LocalUser is the name of the local database user to map
LocalUser string `yaml:"localuser" json:"localuser"`
// RemoteUser is the name of the remote database user to connect as
RemoteUser string `yaml:"remoteuser" json:"remoteuser"`
// RemoteSecret configures how to retrieve the optional credential for the RemoteUser user
RemoteSecret Secret `yaml:"remotesecret" json:"remotesecret"`
}
UserMap represents a Postgres user mapping