本文整理匯總了Golang中github.com/coreos/go-etcd/etcd.Client.RawWatch方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.RawWatch方法的具體用法?Golang Client.RawWatch怎麽用?Golang Client.RawWatch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/coreos/go-etcd/etcd.Client
的用法示例。
在下文中一共展示了Client.RawWatch方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: protectedRawWatch
// protectedRawWatch wraps watch in a panic recovery to work around https://github.com/coreos/go-etcd/pull/212
func protectedRawWatch(client *etcd.Client, path string, index uint64, recursive bool, receiver chan *etcd.RawResponse, stop chan bool) (resp *etcd.RawResponse, err error) {
defer func() {
if rerr := recover(); rerr != nil {
perr, ok := rerr.(error)
if ok {
err = &panicerror{perr}
} else {
err = fmt.Errorf("unknown recover error: %v", rerr)
}
}
}()
return client.RawWatch(path, index, recursive, receiver, stop)
}