/
postgresql.go
48 lines (37 loc) · 928 Bytes
/
postgresql.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package postgresql
import (
"github.com/icinga/icinga-testing/services"
)
type Creator interface {
CreatePostgresqlDatabase() services.PostgresqlDatabaseBase
Cleanup()
}
// info serves as a base for implementing the PostgresqlDatabaseBase interface. Another struct can embed it and
// initialize it with values to implement all interface functions except Cleanup.
type info struct {
host string
port string
username string
password string
database string
}
func (p *info) Host() string {
return p.host
}
func (p *info) Port() string {
return p.port
}
func (p *info) Username() string {
return p.username
}
func (p *info) Password() string {
return p.password
}
func (p *info) Database() string {
return p.database
}
type postgresqlDatabaseNopCleanup struct {
info
}
func (_ *postgresqlDatabaseNopCleanup) Cleanup() {}
var _ services.PostgresqlDatabaseBase = (*postgresqlDatabaseNopCleanup)(nil)