Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCosmosSDKModulePkg ¶
IsCosmosSDKModulePkg check if a Go import path is a Cosmos SDK package module. These type of package have the "cosmossdk.io/x" prefix.
func IsRootPath ¶
IsRootPath checks if a Go import path is a custom app module. Custom app modules are defined inside the "x" directory.
func RootGoImportPath ¶
RootGoImportPath returns a Go import path with the version suffix removed.
Types ¶
type DiscoverOption ¶
type DiscoverOption func(*discoverOptions)
DiscoverOption configures calls to Discovery function.
func WithProtoDir ¶
func WithProtoDir(path string) DiscoverOption
WithProtoDir sets the relative proto directory path.
func WithSDKDir ¶
func WithSDKDir(path string) DiscoverOption
WithSDKDir sets the absolute directory path to the Cosmos SDK Go package.
type HTTPQuery ¶
type HTTPQuery struct { // Name of the RPC func. Name string `json:"name,omitempty"` // FullName of the query with service name and rpc func name. FullName string `json:"full_name,omitempty"` // Rules keeps info about configured HTTP rules of RPC functions. Rules []protoanalysis.HTTPRule `json:"rules,omitempty"` // Paginated indicates that the query is using pagination. Paginated bool `json:"paginated,omitempty"` }
HTTPQuery is an sdk Query.
type Module ¶
type Module struct { // Name of the module. Name string `json:"name,omitempty"` // GoModulePath of the app where the module is defined. GoModulePath string `json:"go_module_path,omitempty"` // Pkg holds the proto package info. Pkg protoanalysis.Package `json:"package,omitempty"` // Msgs is a list of sdk.Msg implementation of the module. Msgs []Msg `json:"messages,omitempty"` // HTTPQueries is a list of module queries. HTTPQueries []HTTPQuery `json:"http_queries,omitempty"` // Types is a list of proto types that might be used by module. Types []Type `json:"types,omitempty"` }
Module keeps metadata about a Cosmos SDK module.
func Discover ¶
func Discover(ctx context.Context, chainRoot, sourcePath string, options ...DiscoverOption) ([]Module, error)
Discover discovers and returns modules and their types that are registered in the app chainRoot is the root path of the chain sourcePath is the root path of the go module which the proto dir is from
Discovery algorithm make use of registered modules and proto definitions to find relevant registered modules. It does so by: 1. Getting all the registered Go modules from the app. 2. Parsing the proto files to find services and messages. 3. Check if the proto services are implemented in any of the registered modules.
type Msg ¶
type Msg struct { // Name of the type. Name string `json:"name,omitempty"` // URI of the type. URI string `json:"uri,omitempty"` // FilePath is the path of the proto file where message is defined. FilePath string `json:"file_path,omitempty"` }
Msg keeps metadata about an sdk.Msg implementation.