scaffolder

package
v0.14.1-0...-8b31b97 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package scaffolder initializes Starport apps and modifies existing ones to add more features in a later time.

Index

Constants

View Source
const (
	TypeString = "string"
	TypeBool   = "bool"
	TypeInt32  = "int32"
)

Variables

This section is empty.

Functions

func ModuleExists

func ModuleExists(appPath string, moduleName string) (bool, error)

Types

type Option

type Option func(*scaffoldingOptions)

Option configures scaffolding.

func AddressPrefix

func AddressPrefix(prefix string) Option

AddressPrefix configures address prefix for the app.

func SdkVersion

func SdkVersion(v cosmosver.MajorVersion) Option

SdkVersion specifies Cosmos-SDK version.

type Scaffolder

type Scaffolder struct {
	// contains filtered or unexported fields
}

Scaffolder is Starport app scaffolder.

func New

func New(path string, options ...Option) *Scaffolder

New initializes a new Scaffolder for app at path.

func (*Scaffolder) AddType

func (s *Scaffolder) AddType(moduleName string, stype string, fields ...string) error

AddType adds a new type stype to scaffolded app by using optional type fields.

func (*Scaffolder) CreateModule

func (s *Scaffolder) CreateModule(moduleName string) error

CreateModule creates a new empty module in the scaffolded app

func (*Scaffolder) ImportModule

func (s *Scaffolder) ImportModule(name string) error

ImportModule imports specified module with name to the scaffolded app.

func (*Scaffolder) Init

func (s *Scaffolder) Init(name string) (path string, err error)

Init initializes a new app with name and given options. path is the relative path to the scaffoled app.

Jump to

Keyboard shortcuts

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