Git Product home page Git Product logo

Comments (6)

zlyuancn avatar zlyuancn commented on June 12, 2024

或者提供一个选项由用户传入io.Writer

from agollo.

shima-park avatar shima-park commented on June 12, 2024

我搜了下,看这里说blog
windows有个nul相当于linux下的/dev/null

from agollo.

zlyuancn avatar zlyuancn commented on June 12, 2024

我去我从来不知道win下面居然有这个, 试了一下果然丢弃了. 不过, 要是能拦截下backup由用户自由储存就好了, 这个需求只是个建议, 我没考虑实用性.

from agollo.

shima-park avatar shima-park commented on June 12, 2024

是的, 可以配置备份的io.Writer会更好
这块改动比较多,因为不止有备份写入,还有备份读取
实际需要提供一个ReadWriter配置项

from agollo.

zlyuancn avatar zlyuancn commented on June 12, 2024

是的, 这个优先级不高, 目前想不出什么使用场景, 因为我从不可能把备份存redis或别的第三方服务, 这本末倒置了.

但是我如果想关闭备份就要对win和linux提供不同的参数, 我是用win开发然后部署在linux

from agollo.

zlyuancn avatar zlyuancn commented on June 12, 2024

我目前是这样解决的

if conf.BackupFile != "" {
    opts = append(opts, agollo.BackupFile(conf.BackupFile))
}else if runtime.GOOS == "windows"{
    opts = append(opts, agollo.BackupFile("/nul"))
}else{
    opts = append(opts, agollo.BackupFile("/dev/null"))
}

from agollo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.