Tidy
This commit is contained in:
parent
cd2686a5b2
commit
fec542ee62
|
@ -23,11 +23,6 @@ type uploadResult struct {
|
||||||
size int64
|
size int64
|
||||||
}
|
}
|
||||||
|
|
||||||
type readResult struct {
|
|
||||||
n int
|
|
||||||
err error
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
targetPartSizeBytes = 5 * 1024 * 1024 // 5MB
|
targetPartSizeBytes = 5 * 1024 * 1024 // 5MB
|
||||||
readBufferSizeBytes = 32_768 // 32Kb
|
readBufferSizeBytes = 32_768 // 32Kb
|
||||||
|
|
|
@ -27,7 +27,7 @@ func init() {
|
||||||
const (
|
const (
|
||||||
// ts-proto generates code that automatically retries for a subset of gRPC
|
// ts-proto generates code that automatically retries for a subset of gRPC
|
||||||
// response codes. To avoid invoking this behaviour, default to returning a
|
// response codes. To avoid invoking this behaviour, default to returning a
|
||||||
// Cancelled code. Later,
|
// Cancelled code for now.
|
||||||
// See https://github.com/stephenh/ts-proto/blob/459b94f5b2988d58d186461332e888c3e511603a/src/generate-grpc-web.ts#L293
|
// See https://github.com/stephenh/ts-proto/blob/459b94f5b2988d58d186461332e888c3e511603a/src/generate-grpc-web.ts#L293
|
||||||
// and https://github.com/stephenh/ts-proto/pull/131.
|
// and https://github.com/stephenh/ts-proto/pull/131.
|
||||||
defaultResponseCode = codes.Canceled
|
defaultResponseCode = codes.Canceled
|
||||||
|
@ -146,7 +146,7 @@ func Start(options Options) error {
|
||||||
|
|
||||||
pbMediaSet.RegisterMediaSetServiceServer(grpcServer, &mediaSetServiceController{mediaSetService: fetchMediaSetService})
|
pbMediaSet.RegisterMediaSetServiceServer(grpcServer, &mediaSetServiceController{mediaSetService: fetchMediaSetService})
|
||||||
|
|
||||||
// TODO: proper CORS support
|
// TODO: configure CORS
|
||||||
grpcWebServer := grpcweb.WrapServer(grpcServer, grpcweb.WithOriginFunc(func(string) bool { return true }))
|
grpcWebServer := grpcweb.WrapServer(grpcServer, grpcweb.WithOriginFunc(func(string) bool { return true }))
|
||||||
handler := func(w http.ResponseWriter, r *http.Request) {
|
handler := func(w http.ResponseWriter, r *http.Request) {
|
||||||
grpcWebServer.ServeHTTP(w, r)
|
grpcWebServer.ServeHTTP(w, r)
|
||||||
|
|
Loading…
Reference in New Issue