Gleam-inspired typed configuration language (POC)
0

Configure Feed

Select the types of activity you want to include in your feed.

1// Fuller example: nested records, variants, Option, List. 2 3type LogLevel { 4 Debug 5 Info 6 Warn 7 Error 8} 9 10type Database { 11 Database( 12 host: String, 13 port: Int, 14 name: String, 15 ssl: Bool, 16 password: Option(String), 17 ) 18} 19 20type Server { 21 Server( 22 host: String, 23 port: Int, 24 workers: Int, 25 ) 26} 27 28type Config { 29 Config( 30 name: String, 31 log_level: LogLevel, 32 server: Server, 33 database: Database, 34 cors_origins: List(String), 35 ) 36} 37 38let database = Database( 39 host: "localhost", 40 port: 5432, 41 name: "myapp", 42 ssl: True, 43 password: None, 44) 45 46let server = Server( 47 host: "0.0.0.0", 48 port: 8080, 49 workers: 4, 50) 51 52pub let config = Config( 53 name: "my-service", 54 log_level: Info, 55 server: server, 56 database: database, 57 cors_origins: [ 58 "https://example.com", 59 "http://localhost:3000", 60 ], 61)