Initial commit of Ocean's local development
This commit is contained in:
1 parent
9944a9e1df
commit
86451938ec
116 files changed
+3320
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package Robots
|
||||
|
||||
import "fmt"
|
||||
import "net/http"
|
||||
import "github.com/SommerEngineering/Ocean/Shutdown"
|
||||
import "github.com/SommerEngineering/Ocean/Log"
|
||||
import LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
||||
|
||||
func HandlerRobots(response http.ResponseWriter, request *http.Request) {
|
||||
if Shutdown.IsDown() {
|
||||
http.NotFound(response, request)
|
||||
return
|
||||
}
|
||||
|
||||
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameNETWORK, `The robots.txt was requested.`, request.RemoteAddr)
|
||||
fmt.Fprintf(response, `%s`, robotsContent)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package Robots
|
||||
|
||||
import "github.com/SommerEngineering/Ocean/ConfigurationDB"
|
||||
import "github.com/SommerEngineering/Ocean/Log"
|
||||
import LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
||||
|
||||
func init() {
|
||||
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `Init the robots component.`)
|
||||
robotsContent = ConfigurationDB.Read(`robots.txt`)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package Robots
|
||||
|
||||
import LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
||||
|
||||
var (
|
||||
senderName LM.Sender = `System::Robots`
|
||||
robotsContent string = `User-agent: *
|
||||
Disallow: /`
|
||||
)
|
||||
Reference in new issue
Block a user