-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e36697
commit 7174234
Showing
35 changed files
with
491 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DS_Store | ||
.idea/* | ||
build/* | ||
.local | ||
config/local/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
run the syncer instance: | ||
```shell | ||
./build/blob-syncer --config-type local --config-path config/config.json | ||
```` | ||
|
||
run the server instance | ||
|
||
```shell | ||
./build/blob-syncer-server --config-path config/config.json --port 8080 | ||
``` | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cache | ||
|
||
import lru "github.com/hashicorp/golang-lru" | ||
|
||
type Cache interface { | ||
Get(key string) (interface{}, bool) | ||
Set(key string, value interface{}) | ||
} | ||
|
||
const DefaultCacheSize = 1024 | ||
|
||
type LocalCache struct { | ||
*lru.Cache | ||
} | ||
|
||
func NewLocalCache(size uint64) (Cache, error) { | ||
cache, err := lru.New(int(size)) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &LocalCache{ | ||
cache, | ||
}, nil | ||
} | ||
|
||
func (c *LocalCache) Get(key string) (interface{}, bool) { | ||
return c.Cache.Get(key) | ||
} | ||
|
||
func (c *LocalCache) Set(key string, value interface{}) { | ||
c.Cache.Add(key, value) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package syncer | ||
package external | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package syncer | ||
package external | ||
|
||
import ( | ||
"context" | ||
|
Oops, something went wrong.