Initial commit

This commit is contained in:
NortPerm
2023-10-30 15:21:12 +03:00
committed by GitHub
commit 13e2575b4e
149 changed files with 3961 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package app
import (
"context"
)
type App struct { // TODO
}
type Logger interface { // TODO
}
type Storage interface { // TODO
}
func New(logger Logger, storage Storage) *App {
return &App{}
}
func (a *App) CreateEvent(ctx context.Context, id, title string) error {
// TODO
return nil
// return a.storage.CreateEvent(storage.Event{ID: id, Title: title})
}
// TODO

View File

@@ -0,0 +1,20 @@
package logger
import "fmt"
type Logger struct { // TODO
}
func New(level string) *Logger {
return &Logger{}
}
func (l Logger) Info(msg string) {
fmt.Println(msg)
}
func (l Logger) Error(msg string) {
// TODO
}
// TODO

View File

@@ -0,0 +1,7 @@
package logger
import "testing"
func TestLogger(t *testing.T) {
// TODO
}

View File

@@ -0,0 +1,11 @@
package internalhttp
import (
"net/http"
)
func loggingMiddleware(next http.Handler) http.Handler { //nolint:unused
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// TODO
})
}

View File

@@ -0,0 +1,31 @@
package internalhttp
import (
"context"
)
type Server struct { // TODO
}
type Logger interface { // TODO
}
type Application interface { // TODO
}
func NewServer(logger Logger, app Application) *Server {
return &Server{}
}
func (s *Server) Start(ctx context.Context) error {
// TODO
<-ctx.Done()
return nil
}
func (s *Server) Stop(ctx context.Context) error {
// TODO
return nil
}
// TODO

View File

@@ -0,0 +1,7 @@
package storage
type Event struct {
ID string
Title string
// TODO
}

View File

@@ -0,0 +1,14 @@
package memorystorage
import "sync"
type Storage struct {
// TODO
mu sync.RWMutex //nolint:unused
}
func New() *Storage {
return &Storage{}
}
// TODO

View File

@@ -0,0 +1,7 @@
package memorystorage
import "testing"
func TestStorage(t *testing.T) {
// TODO
}

View File

@@ -0,0 +1,20 @@
package sqlstorage
import "context"
type Storage struct { // TODO
}
func New() *Storage {
return &Storage{}
}
func (s *Storage) Connect(ctx context.Context) error {
// TODO
return nil
}
func (s *Storage) Close(ctx context.Context) error {
// TODO
return nil
}