Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
remove deprecated ioutil lib for os and io
Browse files Browse the repository at this point in the history
  • Loading branch information
petervolvowinz committed Feb 26, 2024
1 parent bb55ae9 commit aa72e75
Show file tree
Hide file tree
Showing 21 changed files with 248 additions and 253 deletions.
4 changes: 2 additions & 2 deletions client/client-1.0/compress_client/compress_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"crypto/x509"
"encoding/json"
"flag"
"io/ioutil"
//"io/ioutil"
// "net/http"
"net/url"
"os"
Expand Down Expand Up @@ -82,7 +82,7 @@ func retrieveRequest(jsonRequest map[string]interface{}) string {
}

func createListFromFile(fname string) int {
data, err := ioutil.ReadFile(fname)
data, err := os.ReadFile(fname)
if err != nil {
fmt.Printf("Error reading file=%s", fname)
return 0
Expand Down
5 changes: 2 additions & 3 deletions client/client-1.0/compress_client/transportSec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"os"
)

Expand All @@ -34,7 +33,7 @@ type SecConfig struct {
var secConfig SecConfig

func readTransportSecConfig() {
data, err := ioutil.ReadFile(trSecConfigPath + "transportSec.json")
data, err := os.ReadFile(trSecConfigPath + "transportSec.json")
if err != nil {
fmt.Printf("ReadTransportSecConfig():%stransportSec.json error=%s", trSecConfigPath, err)
secConfig.TransportSec = "no"
Expand All @@ -59,7 +58,7 @@ func prepareTransportSecConfig() *x509.CertPool {
fmt.Printf("Error creating x509 keypair from client cert file %s and client key file %s\n", clientCertFile, clientKeyFile)
os.Exit(1)
}
caCert, err := ioutil.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
caCert, err := os.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
if err != nil {
fmt.Printf("Error opening cert file %s, Error: %s", trSecConfigPath+secConfig.CaSecPath+"Root.CA.crt", err)
os.Exit(1)
Expand Down
14 changes: 5 additions & 9 deletions client/client-1.0/csv_client/csv_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ import (
"crypto/x509"
"encoding/json"
"flag"
"io/ioutil"
// "net/http"
"fmt"
"github.com/akamensky/argparse"
"github.com/gorilla/websocket"
"github.com/w3c/automotive-viss2/utils"
"net/url"
"os"
"strconv"
"strings"

"fmt"
"time"

"github.com/akamensky/argparse"
"github.com/gorilla/websocket"
"github.com/w3c/automotive-viss2/utils"
)

var commandNumber string
Expand Down Expand Up @@ -82,7 +78,7 @@ func retrieveRequest(jsonRequest map[string]interface{}) string {
}

func createListFromFile(fname string) int {
data, err := ioutil.ReadFile(fname)
data, err := os.ReadFile(fname)
if err != nil {
fmt.Printf("Error reading file=%s", fname)
return 0
Expand Down
5 changes: 2 additions & 3 deletions client/client-1.0/csv_client/transportSec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"os"
)

Expand All @@ -34,7 +33,7 @@ type SecConfig struct {
var secConfig SecConfig

func readTransportSecConfig() {
data, err := ioutil.ReadFile(trSecConfigPath + "transportSec.json")
data, err := os.ReadFile(trSecConfigPath + "transportSec.json")
if err != nil {
fmt.Printf("ReadTransportSecConfig():%stransportSec.json error=%s", trSecConfigPath, err)
secConfig.TransportSec = "no"
Expand All @@ -59,7 +58,7 @@ func prepareTransportSecConfig() *x509.CertPool {
fmt.Printf("Error creating x509 keypair from client cert file %s and client key file %s\n", clientCertFile, clientKeyFile)
os.Exit(1)
}
caCert, err := ioutil.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
caCert, err := os.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
if err != nil {
fmt.Printf("Error opening cert file %s, Error: %s", trSecConfigPath+secConfig.CaSecPath+"Root.CA.crt", err)
os.Exit(1)
Expand Down
5 changes: 2 additions & 3 deletions client/client-1.0/grpc_client/grpc_map_client/transportSec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"os"
)

Expand All @@ -37,7 +36,7 @@ var secConfig SecConfig
func readTransportSecConfig() {
path, err := os.Getwd()

data, err := ioutil.ReadFile(path + "/" + trSecConfigPath + "transportSec.json")
data, err := os.ReadFile(path + "/" + trSecConfigPath + "transportSec.json")
if err != nil {
fmt.Printf("ReadTransportSecConfig():%stransportSec.json error=%s", trSecConfigPath, err)
secConfig.TransportSec = "no"
Expand All @@ -62,7 +61,7 @@ func prepareTransportSecConfig() *x509.CertPool {
fmt.Printf("Error creating x509 keypair from client cert file %s and client key file %s\n", clientCertFile, clientKeyFile)
os.Exit(1)
}
caCert, err := ioutil.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
caCert, err := os.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
if err != nil {
fmt.Printf("Error opening cert file %s, Error: %s", trSecConfigPath+secConfig.CaSecPath+"Root.CA.crt", err)
os.Exit(1)
Expand Down
6 changes: 3 additions & 3 deletions client/client-1.0/grpc_client/transportSec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
//"io/ioutil"
"os"
)

Expand All @@ -37,7 +37,7 @@ var secConfig SecConfig
func readTransportSecConfig() {
path, err := os.Getwd()

data, err := ioutil.ReadFile(path + "/" + trSecConfigPath + "transportSec.json")
data, err := os.ReadFile(path + "/" + trSecConfigPath + "transportSec.json")
if err != nil {
fmt.Printf("ReadTransportSecConfig():%stransportSec.json error=%s", trSecConfigPath, err)
secConfig.TransportSec = "no"
Expand All @@ -62,7 +62,7 @@ func prepareTransportSecConfig() *x509.CertPool {
fmt.Printf("Error creating x509 keypair from client cert file %s and client key file %s\n", clientCertFile, clientKeyFile)
os.Exit(1)
}
caCert, err := ioutil.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
caCert, err := os.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
if err != nil {
fmt.Printf("Error opening cert file %s, Error: %s", trSecConfigPath+secConfig.CaSecPath+"Root.CA.crt", err)
os.Exit(1)
Expand Down
4 changes: 2 additions & 2 deletions client/client-1.0/simple_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"crypto/x509"
"encoding/json"
"flag"
"io/ioutil"
//"io/ioutil"
// "net/http"
"net/url"
"os"
Expand Down Expand Up @@ -82,7 +82,7 @@ func retrieveRequest(jsonRequest map[string]interface{}) string {
}

func createListFromFile(fname string) int {
data, err := ioutil.ReadFile(fname)
data, err := os.ReadFile(fname)
if err != nil {
fmt.Printf("Error reading file=%s", fname)
return 0
Expand Down
6 changes: 3 additions & 3 deletions client/client-1.0/transportSec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
//"io/ioutil"
"os"
)

Expand All @@ -34,7 +34,7 @@ type SecConfig struct {
var secConfig SecConfig

func readTransportSecConfig() {
data, err := ioutil.ReadFile(trSecConfigPath + "transportSec.json")
data, err := os.ReadFile(trSecConfigPath + "transportSec.json")
if err != nil {
fmt.Printf("ReadTransportSecConfig():%stransportSec.json error=%s", trSecConfigPath, err)
secConfig.TransportSec = "no"
Expand All @@ -59,7 +59,7 @@ func prepareTransportSecConfig() *x509.CertPool {
fmt.Printf("Error creating x509 keypair from client cert file %s and client key file %s\n", clientCertFile, clientKeyFile)
os.Exit(1)
}
caCert, err := ioutil.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
caCert, err := os.ReadFile(trSecConfigPath + secConfig.CaSecPath + "Root.CA.crt")
if err != nil {
fmt.Printf("Error opening cert file %s, Error: %s", trSecConfigPath+secConfig.CaSecPath+"Root.CA.crt", err)
os.Exit(1)
Expand Down
5 changes: 4 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ Placing the dockerfile which is used to build the image in the root is done for
practical reasons. See: https://www.baeldung.com/ops/docker-include-files-outside-build-context


To build and run the docker example see below:
To build and run the docker example see below, please note that the docker-compose-rl.yml file is located in
the: _viss-docker-rl_ folder



```bash
$ docker compose -f docker-compose-rl.yml build
Expand Down
Loading

0 comments on commit aa72e75

Please sign in to comment.