12345678910111213141516171819202122232425262728293031323334 |
- package client
- import "strings"
- type KeyValue struct {
- columns []string
- values []string
- }
- func NewKeyValue() *KeyValue {
- return &KeyValue{
- columns: make([]string, 0),
- values: make([]string, 0),
- }
- }
- func (keyValue *KeyValue) Add(column string, value string) *KeyValue {
- if strings.Trim(column, " ") == "" || strings.Trim(value, " ") == "" {
- return keyValue
- }
- keyValue.columns = append(keyValue.columns, column)
- keyValue.values = append(keyValue.values, value)
- return keyValue
- }
- func (keyValue *KeyValue) Columns() []string {
- return keyValue.columns
- }
- func (keyValue *KeyValue) Values() []string {
- return keyValue.values
- }
|