mirror of
https://github.com/minio/minio
synced 2026-08-29 14:36:37 -04:00
Add PutBucket and ListBuckets service
This commit is contained in:
parent
e22ae2475a
commit
5b67da7d96
6 changed files with 197 additions and 25 deletions
|
|
@ -19,6 +19,7 @@ package httpserver
|
|||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Start(handler http.Handler, address string) (chan<- string, <-chan error) {
|
||||
|
|
@ -30,7 +31,15 @@ func Start(handler http.Handler, address string) (chan<- string, <-chan error) {
|
|||
|
||||
func start(ctrlChannel <-chan string, errorChannel chan<- error, router http.Handler, address string) {
|
||||
log.Println("Starting HTTP Server on " + address)
|
||||
err := http.ListenAndServe(address, router)
|
||||
// Minio server config
|
||||
server := &http.Server{
|
||||
Addr: address,
|
||||
Handler: router,
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
MaxHeaderBytes: 1 << 20,
|
||||
}
|
||||
err := server.ListenAndServe()
|
||||
errorChannel <- err
|
||||
close(errorChannel)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue