module

package
v0.0.0-...-7149754 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPQuery

type HTTPQuery struct {
	// Name of the RPC func.
	Name string

	// FullName of the query with service name and rpc func name.
	FullName string

	// HTTPAnnotations keeps info about http annotations of query.
	Rules []protoanalysis.HTTPRule
}

HTTPQuery is an sdk Query.

type Module

type Module struct {
	// Name of the module.
	Name string

	// GoModulePath of the app where the module is defined.
	GoModulePath string

	// Pkg holds the proto package info.
	Pkg protoanalysis.Package

	// Msg is a list of sdk.Msg implementation of the module.
	Msgs []Msg

	// HTTPQueries is a list of module queries.
	HTTPQueries []HTTPQuery

	// Types is a list of proto types that might be used by module.
	Types []Type
}

Module keeps metadata about a Cosmos SDK module.

func Discover

func Discover(ctx context.Context, chainRoot, sourcePath, protoDir string) ([]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

	// URI of the type.
	URI string

	// FilePath is the path of the .proto file where message is defined at.
	FilePath string
}

Msg keeps metadata about an sdk.Msg implementation.

type Msgs

type Msgs map[string][]string

Msgs is a module import path-sdk msgs pair.

type Type

type Type struct {
	Name string

	// FilePath is the path of the .proto file where message is defined at.
	FilePath string
}

Type is a proto type that might be used by module.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL