mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-14 04:38:28 +10:00
refactor: Extract services form router
This commit is contained in:
@@ -93,7 +93,18 @@ func New(ctx context.Context, options option.CacheFileOptions) *CacheFile {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CacheFile) start() error {
|
||||
func (c *CacheFile) Name() string {
|
||||
return "cache-file"
|
||||
}
|
||||
|
||||
func (c *CacheFile) Dependencies() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *CacheFile) Start(stage adapter.StartStage) error {
|
||||
if stage != adapter.StartStateInitialize {
|
||||
return nil
|
||||
}
|
||||
const fileMode = 0o666
|
||||
options := bbolt.Options{Timeout: time.Second}
|
||||
var (
|
||||
@@ -151,14 +162,6 @@ func (c *CacheFile) start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *CacheFile) PreStart() error {
|
||||
return c.start()
|
||||
}
|
||||
|
||||
func (c *CacheFile) Start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *CacheFile) Close() error {
|
||||
if c.DB == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user