julianfrank / cskv

Comma Separated Key Value

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoDoc Coverage Status Build Status Go Report Card Gitter

Comma Separate Key Value

package for Quick Key-Value Array Sharing and usage in Text based messages

Usage

Just import this package

import "github.com/julianfrank/cskv"

New(string)

New(string) => KV Object

mystr := "one:onevalue,two:twovalue"

mykv:=cskv.New(mystr)

// Output : KV Object

KV.String()

log.Print(mykv.String())
// Output : one:onevalue,two:twovalue

Same Output for log.Print(mykv.Str)

Use

Use(map[string]string) => string in :,: format

mymap:=make(map[string]string)
mymap["one"]="onevalue"
mymap["two"]="twovalue"

mystr := cskv.Use(mymap).String()
[or]
mystr := cskv.Use(mymap).Str

// Output : "one:onevalue,two:twovalue"

To Be Done

  • Get/Set per key on KV Object
  • JSON Export

License

MIT

About

Comma Separated Key Value

License:MIT License


Languages

Language:Go 100.0%