cosmosgen

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: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, appPath, protoDir string, options ...Option) error

Generate generates code from protoDir of an SDK app residing at appPath with given options. protoDir must be relative to the projectPath.

func InstallDependencies

func InstallDependencies(ctx context.Context, appPath string) error

InstallDependencies installs protoc dependencies needed by Cosmos ecosystem.

Types

type ModulePathFunc

type ModulePathFunc func(module.Module) string

ModulePathFunc defines a function type that returns a path based on a Cosmos SDK module.

func VuexStoreModulePath

func VuexStoreModulePath(rootPath string) ModulePathFunc

VuexStoreModulePath generates Vuex store module paths for Cosmos SDK modules. The root path is used as prefix for the generated paths.

type Option

type Option func(*generateOptions)

Option configures code generation.

func IncludeDirs

func IncludeDirs(dirs []string) Option

IncludeDirs configures the third party proto dirs that used by app's proto. relative to the projectPath.

func WithDartGeneration

func WithDartGeneration(includeThirdPartyModules bool, out ModulePathFunc, rootPath string) Option

func WithGoGeneration

func WithGoGeneration(gomodPath string) Option

WithGoGeneration adds Go code generation.

func WithJSGeneration

func WithJSGeneration(includeThirdPartyModules bool, out ModulePathFunc) Option

WithJSGeneration adds JS code generation. out hook is called for each module to retrieve the path that should be used to place generated js code inside for a given module. if includeThirdPartyModules set to true, code generation will be made for the 3rd party modules used by the app -including the SDK- as well.

func WithOpenAPIGeneration

func WithOpenAPIGeneration(out string) Option

WithOpenAPIGeneration adds OpenAPI spec generation.

func WithVuexGeneration

func WithVuexGeneration(includeThirdPartyModules bool, out ModulePathFunc, storeRootPath string) Option

WithVuexGeneration adds Vuex code generation. storeRootPath is used to determine the root path of generated Vuex stores. includeThirdPartyModules and out configures the underlying JS lib generation which is documented in WithJSGeneration.

Jump to

Keyboard shortcuts

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