From ca72af6cf3a01892238f96374f0f33218b4550d1 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Tue, 16 Jun 2015 19:51:19 -0400 Subject: [PATCH] seaprate values into their own files --- config/boolean.go | 9 +++++++++ config/config.go | 40 ---------------------------------------- config/float.go | 9 +++++++++ config/integer.go | 9 +++++++++ config/null.go | 9 +++++++++ config/string.go | 9 +++++++++ 6 files changed, 45 insertions(+), 40 deletions(-) create mode 100644 config/boolean.go create mode 100644 config/float.go create mode 100644 config/integer.go create mode 100644 config/null.go create mode 100644 config/string.go diff --git a/config/boolean.go b/config/boolean.go new file mode 100644 index 0000000..35882c1 --- /dev/null +++ b/config/boolean.go @@ -0,0 +1,9 @@ +package config + +type BooleanValue struct { + Name string + Value bool +} + +func (this BooleanValue) GetType() ConfigType { return BOOLEAN } +func (this BooleanValue) GetValue() interface{} { return this.Value } diff --git a/config/config.go b/config/config.go index e3e5d83..e5fdc3e 100644 --- a/config/config.go +++ b/config/config.go @@ -37,43 +37,3 @@ type ConfigValue interface { GetType() ConfigType GetValue() interface{} } - -type BooleanValue struct { - Name string - Value bool -} - -func (this BooleanValue) GetType() ConfigType { return BOOLEAN } -func (this BooleanValue) GetValue() interface{} { return this.Value } - -type NullValue struct { - Name string - Value interface{} -} - -func (this NullValue) GetType() ConfigType { return NULL } -func (this NullValue) GetValue() interface{} { return nil } - -type IntegerValue struct { - Name string - Value int64 -} - -func (this IntegerValue) GetType() ConfigType { return INTEGER } -func (this IntegerValue) GetValue() interface{} { return this.Value } - -type FloatValue struct { - Name string - Value float64 -} - -func (this FloatValue) GetType() ConfigType { return INTEGER } -func (this FloatValue) GetValue() interface{} { return this.Value } - -type StringValue struct { - Name string - Value string -} - -func (this StringValue) GetType() ConfigType { return STRING } -func (this StringValue) GetValue() interface{} { return this.Value } diff --git a/config/float.go b/config/float.go new file mode 100644 index 0000000..df29db5 --- /dev/null +++ b/config/float.go @@ -0,0 +1,9 @@ +package config + +type FloatValue struct { + Name string + Value float64 +} + +func (this FloatValue) GetType() ConfigType { return INTEGER } +func (this FloatValue) GetValue() interface{} { return this.Value } diff --git a/config/integer.go b/config/integer.go new file mode 100644 index 0000000..f39f8ee --- /dev/null +++ b/config/integer.go @@ -0,0 +1,9 @@ +package configTypes + +type IntegerValue struct { + Name string + Value int64 +} + +func (this IntegerValue) GetType() ConfigType { return INTEGER } +func (this IntegerValue) GetValue() interface{} { return this.Value } diff --git a/config/null.go b/config/null.go new file mode 100644 index 0000000..72dc7dc --- /dev/null +++ b/config/null.go @@ -0,0 +1,9 @@ +package configTypes + +type NullValue struct { + Name string + Value interface{} +} + +func (this NullValue) GetType() ConfigType { return NULL } +func (this NullValue) GetValue() interface{} { return nil } diff --git a/config/string.go b/config/string.go new file mode 100644 index 0000000..db0bcaa --- /dev/null +++ b/config/string.go @@ -0,0 +1,9 @@ +package configTypes + +type StringValue struct { + Name string + Value string +} + +func (this StringValue) GetType() ConfigType { return STRING } +func (this StringValue) GetValue() interface{} { return this.Value }