Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[design] クラス設計 #19

Open
eito2002 opened this issue May 23, 2024 · 2 comments
Open

[design] クラス設計 #19

eito2002 opened this issue May 23, 2024 · 2 comments
Assignees

Comments

@eito2002
Copy link
Collaborator

eito2002 commented May 23, 2024

必要なクラスを考えていく

@eito2002
Copy link
Collaborator Author

eito2002 commented May 23, 2024

Queue or Vector で Listen と Connectionを格納

Struct Listen

  • 接続を監視している構造体
  • port番号
  • struct epoll_event
  • Class Config Parse

Struct Connection

  • 接続をしている構造体
  • port番号
  • Class HTTP Requset Parse
  • Class HTTP Response Create
  • Class Config Parse
  • Parseしたリクエストを元にconfigから必要な情報を探してレスポンスに返す

Class HTTP Requset Parse

  • HTTPリクエストを受け取って処理する関数を持ったクラス
  • パースしたリクエストメソット(POST etc)
  • ヘッダー
  • ボディ

Class HTTP Response Create

  • HTTPレスポンスを作成する関数を持ったクラス
  • ステータスコード
  • ヘッダー
  • ボディ
  • ステータスコードの判定関数も持たせる

Class Config Parse

  • Configfileをパースする関数を持ったクラス
  • Struct Server(Location)
  • Class CGI
Struct Server(Location)
  • サーバー情報(サーバー名、ポート番号)
  • ルーティング(ルートページ、デフォルトページ、リダイレクト)
  • 許可するメソット

Class CGI

  • CGIの実行関数
  • 実行情報

Class Configをglobal constにして全てからアクセスできるようにしても良い?

@eito2002 eito2002 self-assigned this May 23, 2024
@eito2002
Copy link
Collaborator Author

IMG_1754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant