Skip to content

Instantly share code, notes, and snippets.

View collinvandyck's full-sized avatar
🏠
Working from home

Collin Van Dyck collinvandyck

🏠
Working from home
View GitHub Profile
type Config struct {
Db struct {
Name string
User string
Password string
}
}
{
"Db": {
"Name": "authdb",
"User": "postgres",
"Password": "postgres"
}
}
database:
driverClass: org.postgresql.Driver
user: postgres
password: postgres
url: jdbc:postgresql://localhost/authdb
database:
driverClass: org.postgresql.Driver
user: postgres
password: postgres
url: jdbc:postgresql://localhost/authdb
database:
driverClass: org.postgresql.Driver
user: postgres
password: postgres
url: jdbc:postgresql://localhost/authdb
@Path("authenticate")
@Produces(MediaType.APPLICATION_JSON)
public class AuthResource {
private final UserDAO userDAO;
public AuthResource(UserDAO userDAO) {
this.userDAO = userDAO;
}
@GET
public class AuthConfiguration extends Configuration {
@Valid
@NotNull
@JsonProperty
private DatabaseConfiguration database = new DatabaseConfiguration();
public DatabaseConfiguration getDatabaseConfiguration() {
return database;
}
database:
driverClass: org.postgresql.Driver
user: postgres
password: postgres
url: jdbc:postgresql://localhost/authdb
properties:
charSet: UTF-8
http:
requestLog:
console:
{
"Db": {
"Name": "authdb",
"User": "postgres",
"Password": "postgres"
}
}
type Config struct {
Db struct {
Name string
User string
Password string
}
}
func ReadConfig() Config {
if len(os.Args) != 2 {