diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dded2f4 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +swagger: + swag init -g ./pkg/handler/handler.go -o docs +release: + go run cmd/release/main.go \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1115588 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# esforum + +## Overview +esforum is a simple forum application built in Go. It allows users to create and manage posts in a forum-like environment. + +## Project Structure +``` +esforum +├── cmd +│ └── main.go # Entry point of the application +├── pkg +│ └── esforum +│ └── esforum.go # Main logic for the esforum package +├── go.mod # Module definition file +└── README.md # Project documentation +``` + +## Setup Instructions +1. Clone the repository: + ``` + git clone https://github.com/yourusername/esforum.git + ``` +2. Navigate to the project directory: + ``` + cd esforum + ``` +3. Install dependencies: + ``` + go mod tidy + ``` + +## Usage +To run the application, execute the following command: +``` +go run cmd/main.go +``` + +## API Endpoints +- **POST /posts**: Create a new post. +- **GET /posts**: Retrieve all posts. + +## Contributing +Feel free to submit issues or pull requests for improvements and bug fixes. \ No newline at end of file diff --git a/authorized.go b/authorized.go new file mode 100644 index 0000000..8ce193c --- /dev/null +++ b/authorized.go @@ -0,0 +1,14 @@ +package esforum + +type AuthorizedUser struct { + Id int64 `json:"id" gorm:"unique;primaryKey;autoIncrement"` + Username string `json:"username"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + PictureURL string `json:"picture_url"` + Email string `json:"email"` + Access string `json:"access"` + + TelegramId string `json:"telegram_id"` + GoogleId string `json:"google_id"` +}