forked from neflyte/fdwctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.go
27 lines (25 loc) · 1.28 KB
/
server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package model
// ForeignServer represents a Postgres foreign server including related user mappings and remote schemas
type ForeignServer struct {
// Name is the display name of the foreign server
Name string `yaml:"name" json:"name"`
// Host is the hostname of the foreign server
Host string `yaml:"host" json:"host"`
// Port is the port number of the foreign server
Port int `yaml:"port" json:"port"`
// DB is the name of the database on the foreign server
DB string `yaml:"db" json:"db"`
// Wrapper is the name of the foreign data wrapper to use with this foreign server
Wrapper string `yaml:"wrapper,omitempty" json:"wrapper,omitempty"`
// Owner is the owner of the foreign server
Owner string `yaml:"-" json:"-"`
// UserMaps is the list of user mappings to create using this foreign server
UserMaps []UserMap `yaml:"UserMap,omitempty" json:"UserMap,omitempty"`
// Schemas is the list of remote schemas to import from this foreign server
Schemas []Schema `yaml:"Schemas,omitempty" json:"Schemas,omitempty"`
}
// Equals determines if this object is equal to the supplied object
func (fs *ForeignServer) Equals(fserver ForeignServer) bool {
return fs.Name == fserver.Name && fs.Host == fserver.Host && fs.Port == fserver.Port &&
fs.DB == fserver.DB && fs.Wrapper == fserver.Wrapper
}