|
|
|
@ -23,31 +23,6 @@ import ( |
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|
var ( |
|
|
|
|
<<<<<<< Updated upstream |
|
|
|
|
// ctx = context.Background()
|
|
|
|
|
dsn = "postgres://postgres:Initial1@localhost:15432/anvil?sslmode=disable" |
|
|
|
|
// dsn := "unix://user:pass@dbname/var/run/postgresql/.s.PGSQL.5432"
|
|
|
|
|
) |
|
|
|
|
anvil := new(Anvil) |
|
|
|
|
anvil.AddStriker(Striker{}) |
|
|
|
|
anvil.Strikers[0].SetFQDN("mh-striker01.libre.audio") |
|
|
|
|
anvil.Strikers[0].AddEndpoint(PostgresClient(OpenDB(dsn))) |
|
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", anvil.Strikers[0]) |
|
|
|
|
// Turn these into funcs with error handling, logging, return vals etc.
|
|
|
|
|
// if usererr := anvildb.NewSelect().
|
|
|
|
|
// // Turning *User into an interface &User{}
|
|
|
|
|
// Model(&UserModel{}).
|
|
|
|
|
// OrderExpr("user_uuid ASC").
|
|
|
|
|
// Limit(10).
|
|
|
|
|
// Scan(ctx, &users); usererr != nil {
|
|
|
|
|
// errors.Join(usererr, err)
|
|
|
|
|
// }
|
|
|
|
|
// fmt.Printf("##\n## Users\n###\n\n")
|
|
|
|
|
// for _, val := range users {
|
|
|
|
|
// fmt.Printf("%s\n", val.Username)
|
|
|
|
|
// }
|
|
|
|
|
======= |
|
|
|
|
pgdsn = "postgres://postgres:Initial1@localhost:15432/anvil?sslmode=disable" |
|
|
|
|
) |
|
|
|
|
anvil := new(Anvil) |
|
|
|
@ -58,5 +33,4 @@ func main() { |
|
|
|
|
anvil.Strikers[0].AddEndpoint(e) |
|
|
|
|
fmt.Printf("Strikers[0].Endpoints.PostgresClient = %s.\n", anvil.Strikers[0].Endpoints.PostgresClient) |
|
|
|
|
// fmt.Printf("Strikers[0].FQDN = %s.\n", anvil.Strikers[0].FQDN)
|
|
|
|
|
>>>>>>> Stashed changes |
|
|
|
|
} |
|
|
|
|