Fixed spelling mistake in project name, restructuring. Correction of Golang convention error.

This commit is contained in:
Jérémi N ‘EndMove’ 2022-03-05 17:21:46 +01:00
parent c379c15932
commit 27789be202
Signed by: EndMove
GPG Key ID: 65C4A02E1F5371A4
12 changed files with 33 additions and 27 deletions

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<module version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

9
.idea/StoreBackEnd.iml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,30 +1,30 @@
package main
import (
"StorBackEnd/pkg/config"
"StorBackEnd/pkg/network"
"StorBackEnd/pkg/protocol/managers"
"StorBackEnd/pkg/protocol/repository"
"StorBackEnd/pkg/protocol/rules/readers"
"StorBackEnd/pkg/protocol/rules/writers"
"StoreBackEnd/pkg/config"
"StoreBackEnd/pkg/network"
"StoreBackEnd/pkg/protocol/managers"
"StoreBackEnd/pkg/protocol/repository"
"StoreBackEnd/pkg/protocol/rules/readers"
"StoreBackEnd/pkg/protocol/rules/writers"
"time"
)
const (
FILE_PATH = "resources/AppConfig.json"
FilePath = "resources/AppConfig.json"
)
func main() {
println("StorBackEnd started !")
println("StoreBackEnd started !")
// Loading App config
appConfig, err := config.Read(FILE_PATH)
appConfig, err := config.Read(FilePath)
if err != nil {
println("Impossible de charger la configuration du server : " + err.Error())
return
}
println("Adresse multicast : " + appConfig.MulticastAddress)
println("Address multicast : " + appConfig.MulticastAddress)
protocolRepository := repository.CreateProtocolRepository()
@ -43,5 +43,4 @@ func main() {
server := network.ServerUnicast{Network: "tcp", Port: appConfig.UnicastPort, ReqManager: &requestManager}
server.Run()
}

2
go.mod
View File

@ -1 +1 @@
module StorBackEnd
module StoreBackEnd

View File

@ -8,7 +8,7 @@ type AppConfig struct {
// multicastSecond Contient le nombre de seconde entre chaque annonce
MulticastSecond int `json:"multicastSecond"`
// domain Domain du StorBackEnd
// domain Domain du StoreBackEnd
Domain string `json:"domain"`
// unicastPort Contient le port unicast auquel le FileFrontEnd se connecte

View File

@ -1,8 +1,8 @@
package network
import (
"StorBackEnd/pkg/protocol/repository"
"StorBackEnd/pkg/protocol/rules/writers"
"StoreBackEnd/pkg/protocol/repository"
"StoreBackEnd/pkg/protocol/rules/writers"
"fmt"
"net"
"time"
@ -25,7 +25,7 @@ type ClientMulticast struct {
// address Adresse de multicast
address string
// address Domain de du StorBackEnd
// address Domain de du StoreBackEnd
domain string
// port Port de connexion en unicast
@ -57,7 +57,7 @@ func (cMult ClientMulticast) Run() {
}
for {
con.Write([]byte(cmd))
_, _ = con.Write([]byte(cmd))
time.Sleep(time.Second * cMult.second)
}
@ -71,7 +71,6 @@ func (cMult ClientMulticast) ResolveAddr() (*net.UDPAddr, bool) {
println(errResUdp.Error())
return nil, true
}
return addr, false
}

View File

@ -1,7 +1,7 @@
package network
import (
"StorBackEnd/pkg/protocol/managers"
"StoreBackEnd/pkg/protocol/managers"
"bufio"
"fmt"
"net"
@ -36,7 +36,7 @@ func (server ServerUnicast) Run() {
}
result := server.ReqManager.Execute(line)
con.Write(append([]byte(result), '\n')) // TODO : ATTENTION laisser les \n
_, _ = con.Write(append([]byte(result), '\n')) // TODO : ATTENTION laisser les \n
}
}

View File

@ -1,6 +1,6 @@
package managers
import "StorBackEnd/pkg/protocol/repository"
import "StoreBackEnd/pkg/protocol/repository"
type RequestManager struct {
Repository *repository.ProtocolRepository

View File

@ -1,6 +1,6 @@
package repository
import "StorBackEnd/pkg/protocol"
import "StoreBackEnd/pkg/protocol"
func CreateProtocolRepository() *ProtocolRepository {
return &ProtocolRepository{

View File

@ -1,6 +1,6 @@
package readers
import "StorBackEnd/pkg/protocol"
import "StoreBackEnd/pkg/protocol"
// EraseFileRuleName Identifiant de cette règle
const EraseFileRuleName = "ffe_erasefile"

View File

@ -1,6 +1,6 @@
package writers
import "StorBackEnd/pkg/protocol"
import "StoreBackEnd/pkg/protocol"
const HelloRuleName = "sbe_hello"

View File

@ -1,6 +1,6 @@
{
"multicastAddress" : "226.66.66.1:42500",
"multicastSecond" : 10,
"domain" : "benjamin",
"domain" : "lightcontainer.storebacked-01",
"unicastPort" : 58000
}