repositorypackage
1.0.0
Repository: https://github.com/cocoon-break/csync.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# README
strategy sync sdk
sync the strategy content from center by http request
install
go get github.com/Cocoon-break/csync
usage
notifyCh := make(chan NotifyData)
cs, err := New(
WithComponent("component"),
WithBasicAuth("user", "password"),
WithTargetUrl("http://example.com"),
WithTagFunc(func() string { return "tag" }),
WithNotifyCh(notifyCh),
)
if err != nil {
fmt.Printf("unexpected error: %v", err)
return
}
cs.Start()
go func() {
for notifyData := range notifyCh {
if notifyData.Err != nil {
continue
}
// Add assertions for the received notify data
}
}()
// application exit stop chan
defer cs.Stop()