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

CurrenciesなどのAPI毎の構造体を、public_apiなどの上位モジュールで開き直しているのは良くないと思う #34

Open
yajamon opened this issue Jan 29, 2018 · 1 comment
Assignees
Labels

Comments

@yajamon
Copy link
Owner

yajamon commented Jan 29, 2018

v0.3.0の生成ドキュメントを見てもらうと、API・Builer・Responseが冗長に並んでいる。

https://docs.rs/zaif-api/0.3.0/zaif_api/public_api/index.html

いざドキュメントを書いたとして、これでは読み手がたらい回しになる気がしている。
currenciesひとつとっても、どの構造体のドキュメントを見に行けばBuilderの組み立て、実行、結果の使用方法が分かるのか悩んでしまうと考えている。

内部的にはAPIひとつにつきモジュールがひとつ切ってあるのだから、zaif_api::public_api::currencies::{Caller, Builder, Response}のように整理してしまっても良いのではなかろうか。

zaif_api::public_apiの配下には、各Builderへのショートカットになるfunctionがあればいいと思う。

あるいはファクトリを用意するか。毎回AccessToken.clone()するのも面倒だし、UserAgentだって共有して楽したい場面もあるだろうし。

@yajamon
Copy link
Owner Author

yajamon commented Mar 13, 2018

Trade
TradeBuilder
TradeHistory
TradeHistoryBuilder
TradeHistoryResponse
TradeResponse

https://docs.rs/zaif-api/0.5.0/zaif_api/trade_api/index.html

この並び方はもうアウトですね。

@yajamon yajamon self-assigned this Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant