A sync server implemented in go to communicate with Brave sync clients using components/sync/protocol/sync.proto. Current Chromium version for sync protocol buffer files used in this repo is Chromium 116.0.5845.183.
This server supports endpoints as bellow.
POST /v2/command/
endpoint handles Commit and GetUpdates requests from sync clients and return corresponding responses both in protobuf format. Detailed of requests and their corresponding responses are defined in schema/protobuf/sync_pb/sync.proto
. Sync clients are responsible for generating valid access tokens and present them to the server in the Authorization header of requests.Currently we use dynamoDB as the datastore, the schema could be found in schema/dynamodb/table.json
.
make protobuf
.make
make docker
make docker-up
--sync-url="http://localhost:8295/v2"
make docker-test
.proto
files from components/sync/protocol
in chromium
to schema/protobuf/sync_pb
in go-sync
..proto
files from components/sync/protocol
in brave-core
to schema/protobuf/sync_pb
in go-sync
.make repath-proto
to set correct import paths in .proto
files.make proto-go-module
to add the go_module
option to .proto
files.make protobuf
to generate the Go code from .proto
definitions.The instrumented datastore and redis interfaces are generated, providing integration with Prometheus. The following will re-generate the instrumented code, required when updating protocl definitions:
make instrumented
Changes to datastore/datastore.go
or cache/cache.go
should be followed with the above command.