Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UploadServer ¶
UploadServer is a structure that holds the upload server.
func NewServer ¶
func NewServer(logger *logrus.Logger) *UploadServer
NewServer configures and creates a grpc.Server instance with the upload service health check service. Configure using environment variables. `HEALTH_CHECK_INTERVAL`: Interval to update serving state of the health check server. `S3_ACCESS_KEY`: S3 accress key to connect with s3 backend. `S3_SECRET_KEY`: S3 secret key to connect with s3 backend. `S3_ENDPOINT`: S3 endpoint of s3 backend to connect to. `S3_TOKEN`: S3 token of s3 backend to connect to. `S3_REGION`: S3 ergion of s3 backend to connect to. `S3_SSL`: Enable or Disable SSL on S3 connection. `TCP_PORT`: TCP port on which the grpc server would serve on.
func (*UploadServer) GetHandler ¶
func (s *UploadServer) GetHandler() *object.Handler
GetHandler returns a copy of the underlying upload handler.
func (UploadServer) Serve ¶
func (s UploadServer) Serve(lis net.Listener)
Serve accepts incoming connections on the listener `lis`, creating a new ServerTransport and service goroutine for each. The service goroutines read gRPC requests and then call the registered handlers to reply to them. Serve returns when `lis.Accept` fails with fatal errors. `lis` will be closed when this method returns. If `lis` is nil then Serve creates a `net.Listener` with "tcp" network listening on the configured `TCP_PORT`, which defaults to "8080". Serve will return a non-nil error unless Stop or GracefulStop is called.