mirror of
https://github.com/minio/minio.git
synced 2025-11-10 22:10:12 -05:00
Remove unusued params and functions (#8399)
This commit is contained in:
@@ -39,7 +39,7 @@ var ErrNoEntriesFound = errors.New("No entries found for this key")
|
||||
const etcdPathSeparator = "/"
|
||||
|
||||
// create a new coredns service record for the bucket.
|
||||
func newCoreDNSMsg(bucket, ip string, port int, ttl uint32) ([]byte, error) {
|
||||
func newCoreDNSMsg(ip string, port int, ttl uint32) ([]byte, error) {
|
||||
return json.Marshal(&SrvRecord{
|
||||
Host: ip,
|
||||
Port: port,
|
||||
@@ -156,7 +156,7 @@ func (c *coreDNS) list(key string) ([]SrvRecord, error) {
|
||||
// Adds DNS entries into etcd endpoint in CoreDNS etcd message format.
|
||||
func (c *coreDNS) Put(bucket string) error {
|
||||
for ip := range c.domainIPs {
|
||||
bucketMsg, err := newCoreDNSMsg(bucket, ip, c.domainPort, defaultTTL)
|
||||
bucketMsg, err := newCoreDNSMsg(ip, c.domainPort, defaultTTL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func (store *QueueStore) Open() error {
|
||||
}
|
||||
|
||||
// write - writes event to the directory.
|
||||
func (store *QueueStore) write(directory string, key string, e event.Event) error {
|
||||
func (store *QueueStore) write(key string, e event.Event) error {
|
||||
|
||||
// Marshalls the event.
|
||||
eventData, err := json.Marshal(e)
|
||||
@@ -117,7 +117,7 @@ func (store *QueueStore) Put(e event.Event) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return store.write(store.directory, key, e)
|
||||
return store.write(key, e)
|
||||
}
|
||||
|
||||
// Get - gets a event from the store.
|
||||
|
||||
@@ -19,7 +19,6 @@ package madmin
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -29,14 +28,12 @@ import (
|
||||
|
||||
// ServiceRestart - restarts the MinIO cluster
|
||||
func (adm *AdminClient) ServiceRestart() error {
|
||||
_, err := adm.serviceCallAction(ServiceActionRestart)
|
||||
return err
|
||||
return adm.serviceCallAction(ServiceActionRestart)
|
||||
}
|
||||
|
||||
// ServiceStop - stops the MinIO cluster
|
||||
func (adm *AdminClient) ServiceStop() error {
|
||||
_, err := adm.serviceCallAction(ServiceActionStop)
|
||||
return err
|
||||
return adm.serviceCallAction(ServiceActionStop)
|
||||
}
|
||||
|
||||
// ServiceAction - type to restrict service-action values
|
||||
@@ -50,7 +47,7 @@ const (
|
||||
)
|
||||
|
||||
// serviceCallAction - call service restart/update/stop API.
|
||||
func (adm *AdminClient) serviceCallAction(action ServiceAction) ([]byte, error) {
|
||||
func (adm *AdminClient) serviceCallAction(action ServiceAction) error {
|
||||
queryValues := url.Values{}
|
||||
queryValues.Set("action", string(action))
|
||||
|
||||
@@ -61,14 +58,14 @@ func (adm *AdminClient) serviceCallAction(action ServiceAction) ([]byte, error)
|
||||
})
|
||||
defer closeResponse(resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, httpRespToErrorResponse(resp)
|
||||
return httpRespToErrorResponse(resp)
|
||||
}
|
||||
|
||||
return ioutil.ReadAll(resp.Body)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ServiceTraceInfo holds http trace
|
||||
|
||||
@@ -119,7 +119,6 @@ func ParseHost(s string) (*Host, error) {
|
||||
return nil, err
|
||||
}
|
||||
host = s
|
||||
portStr = ""
|
||||
} else {
|
||||
if port, err = ParsePort(portStr); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -150,7 +150,7 @@ const csvSplitSize = 128 << 10
|
||||
// startReaders will read the header if needed and spin up a parser
|
||||
// and a number of workers based on GOMAXPROCS.
|
||||
// If an error is returned no goroutines have been started and r.err will have been set.
|
||||
func (r *Reader) startReaders(in io.Reader, newReader func(io.Reader) *csv.Reader) error {
|
||||
func (r *Reader) startReaders(newReader func(io.Reader) *csv.Reader) error {
|
||||
if r.args.FileHeaderInfo != none {
|
||||
// Read column names
|
||||
// Get one line.
|
||||
@@ -304,5 +304,5 @@ func NewReader(readCloser io.ReadCloser, args *ReaderArgs) (*Reader, error) {
|
||||
return ret
|
||||
}
|
||||
|
||||
return r, r.startReaders(csvIn, newCsvReader)
|
||||
return r, r.startReaders(newCsvReader)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user