Skip to content

qclaogui/kv

Repository files navigation

kv

License

This project is under development, do not use in production!

Usage

package main

import (
	"fmt"
	"time"

	"github.com/qclaogui/kv"
)

var prefix = "/app"

var keys = []string{
	"/upstream/host1",
	"/upstream/host2",
}

func main() {
	defer kv.Watch(prefix, keys).Stop()
	time.Sleep(time.Second)
    
	v, err := kv.GetV("/app/upstream/host1")
	if err != nil {
		fmt.Printf("Get error %v \n\n", err)
	}
	
	fmt.Printf("Get %v \n\n", v)

	vs, err := kv.GetVs("/app/upstream/*")
	if err != nil {
		fmt.Printf("GetMany error %v \n\n", err)
	}

	fmt.Printf("%v \n\n", vs)
}

深度参考 confd 的实现。

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages