99designs / 99designs/gqlgen

Reorganisation of `transport` package

Đang mở
#3,459 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
SSE websocket
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

Currently, the `transport` package holds all the different transport options web socket, HTTP and SSE. This has several issues for consumers of this library. Since go only does dependency pruning based on packages, all transitive libraries of all transports are "forwarded" to the consumer - even if he is never using the transport in the first place. Currently this only applies to the web socket library, but this might extend to others in the future.

My proposal would be to split up the transports into individual packages `websocket`, `http`, `sse` as sub packages within `transport`. This way, any eventual third-party dependencies only belonging to one particular transport are only forwarded to the consumer if he actually is using the transport. Plus, the `transport` package namespace is not "polluted" with different structs belonging to different things.

Is this something that you might be interested in? I have a demo implementation where I extracted the web socket one (https://github.com/oxisto/gqlgen/tree/reorg-transport) and could provide a PR if wanted.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.