remove unused functions

This commit is contained in:
Abhishek Kondur
2022-09-30 22:12:57 +05:30
parent 5dd5b73607
commit acbca2c2d8
3 changed files with 0 additions and 136 deletions

View File

@@ -8,7 +8,6 @@ import (
"io"
"net"
"net/http"
"os"
"strconv"
"sync"
"time"
@@ -20,7 +19,6 @@ import (
"github.com/gravitl/netmaker/netclient/auth"
"github.com/gravitl/netmaker/netclient/config"
"github.com/gravitl/netmaker/netclient/ncutils"
"github.com/gravitl/netmaker/tls"
)
var metricsCache = new(sync.Map)
@@ -261,22 +259,6 @@ func publish(nodeCfg *config.ClientConfig, dest string, msg []byte, qos byte) er
return nil
}
func checkCertExpiry(cfg *config.ClientConfig) error {
cert, err := tls.ReadCertFromFile(ncutils.GetNetclientServerPath(cfg.Server.Server) + ncutils.GetSeparator() + "client.pem")
//if cert doesn't exist or will expire within 10 days
if errors.Is(err, os.ErrNotExist) || cert.NotAfter.Before(time.Now().Add(time.Hour*24*10)) {
key, err := tls.ReadKeyFromFile(ncutils.GetNetclientPath() + ncutils.GetSeparator() + "client.key")
if err != nil {
return err
}
return RegisterWithServer(key, cfg)
}
if err != nil {
return err
}
return nil
}
func checkBroker(broker string, port string) error {
if broker == "" {
return errors.New("error: broker address is blank")