hyperledger / fabric-admin-sdk

Fabric SDK for Admin Capability services
Apache License 2.0
31 stars 19 forks source link

change package structure #84

Closed SamYuan1990 closed 1 year ago

SamYuan1990 commented 1 year ago

adjust package structure, if those packages are internal, hence we don't want they are expose .... as https://pkg.go.dev/github.com/hyperledger/fabric-admin-sdk@v0.0.0-20230128060135-ea99b189b606/pkg/internal/gateway

and refactor for package tools, moving function for test usage only to test package.

Signed-off-by: Sam Yuan yy19902439@126.com

SamYuan1990 commented 1 year ago

convert to draft now, as #79 is high priority

SamYuan1990 commented 1 year ago

The files you are moving are already internal and not part of the public API. Is there a particular reason you want all internals under a top-level internal package rather than closer to the code that uses them?

From the naming as internal, I suppose we don't want to expose those packages. and I found those package appears at https://pkg.go.dev/github.com/hyperledger/fabric-admin-sdk@v0.0.0-20230128060135-ea99b189b606/pkg/internal/gateway ... wait should I move from internal package to package internal package? https://pkg.go.dev/github.com/hyperledger/fabric-admin-sdk#section-directories

in my point of view, a fix should be applied to avoid internal package appears in go doc. I will further refine this pr by go doc command.

bestbeforetoday commented 1 year ago

I am not sure why that site is including internal packages or if there is anything we can do to stop that. Code appearing anywhere under a package named internal is not accessible to code outside if the package that contains the internal package. By moving things up to a higher level internal package, their scope of visibility is actually being broadened.

https://go.dev/doc/go1.4#internalpackages

SamYuan1990 commented 1 year ago

I am not sure why that site is including internal packages or if there is anything we can do to stop that. Code appearing anywhere under a package named internal is not accessible to code outside if the package that contains the internal package. By moving things up to a higher level internal package, their scope of visibility is actually being broadened.

https://go.dev/doc/go1.4#internalpackages

ok, then I will move all pkg/a/internal packages to internal package to keep same with fabric

bestbeforetoday commented 1 year ago

Fabric also has core/ledger/internal and common/metrics/internal packages. Not everything is in a top-level internal package.

SamYuan1990 commented 1 year ago

close this PR for now.