From 6d26a5a628489f50a77bbe5bee4422406bfc6479 Mon Sep 17 00:00:00 2001 From: perp Date: Wed, 9 Oct 2024 13:18:31 +0100 Subject: [PATCH] Added server config --- cmd/twister/config.toml | 2 ++ cmd/twister/main.go | 2 +- config/config.go | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/twister/config.toml b/cmd/twister/config.toml index e69de29..881bbe6 100644 --- a/cmd/twister/config.toml +++ b/cmd/twister/config.toml @@ -0,0 +1,2 @@ +[server] +address = "127.0.0.1:8000" diff --git a/cmd/twister/main.go b/cmd/twister/main.go index 307b118..021c70e 100644 --- a/cmd/twister/main.go +++ b/cmd/twister/main.go @@ -11,7 +11,7 @@ var ( //go:embed config.toml content []byte - version = "0.1.0" + version = "0.1.1" ) func main() { diff --git a/config/config.go b/config/config.go index 75e4f02..af4db26 100644 --- a/config/config.go +++ b/config/config.go @@ -1,6 +1,12 @@ package config -// Config is a configuration +// Configuration type Config struct { Version string + *Server `toml:"server"` +} + +// Server config +type Server struct { + Address string }