scaffolder

package
v0.0.0-...-9032b55 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: 46 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flutter

func Flutter(path string) error

Flutter scaffolds a Flutter app for a chain.

func Init

func Init(tracer *placeholder.Tracer, root, name, addressPrefix string, noDefaultModule bool) (path string, err error)

Init initializes a new app with name and given options.

func Vue

func Vue(path string) error

Vue scaffolds a Vue.js app for a chain.

Types

type AddTypeKind

type AddTypeKind func(*addTypeOptions)

AddTypeKind configures the type kind option for AddType.

func DryType

func DryType() AddTypeKind

DryType only creates a type with a basic definition.

func ListType

func ListType() AddTypeKind

ListType makes the type stored in a list convention in the storage.

func MapType

func MapType(indexes ...string) AddTypeKind

MapType makes the type stored in a key-value convention in the storage with a custom index option.

func SingletonType

func SingletonType() AddTypeKind

SingletonType makes the type stored in a fixed place as a single entry in the storage.

type AddTypeOption

type AddTypeOption func(*addTypeOptions)

AddTypeOption configures options for AddType.

func TypeWithFields

func TypeWithFields(fields ...string) AddTypeOption

TypeWithFields adds fields to the type to be scaffolded.

func TypeWithModule

func TypeWithModule(name string) AddTypeOption

TypeWithModule module to scaffold type into.

func TypeWithSigner

func TypeWithSigner(signer string) AddTypeOption

TypeWithSigner provides a custom signer name for the message

func TypeWithoutMessage

func TypeWithoutMessage() AddTypeOption

TypeWithoutMessage disables generating sdk compatible messages and tx related APIs.

func TypeWithoutSimulation

func TypeWithoutSimulation() AddTypeOption

TypeWithoutSimulation disables generating messages simulation.

type MessageOption

type MessageOption func(*messageOptions)

MessageOption configures the message scaffolding

func WithDescription

func WithDescription(desc string) MessageOption

WithDescription provides a custom description for the message CLI command

func WithSigner

func WithSigner(signer string) MessageOption

WithSigner provides a custom signer name for the message

func WithoutSimulation

func WithoutSimulation() MessageOption

WithoutSimulation disables generating messages simulation

type ModuleCreationOption

type ModuleCreationOption func(*moduleCreationOptions)

ModuleCreationOption configures Chain.

func WithDependencies

func WithDependencies(dependencies []modulecreate.Dependency) ModuleCreationOption

WithDependencies specifies the name of the modules that the module depends on

func WithIBC

func WithIBC() ModuleCreationOption

WithIBC scaffolds a module with IBC enabled

func WithIBCChannelOrdering

func WithIBCChannelOrdering(ordering string) ModuleCreationOption

WithIBCChannelOrdering configures channel ordering of the IBC module

func WithParams

func WithParams(params []string) ModuleCreationOption

WithParams scaffolds a module with params

type OracleOption

type OracleOption func(*oracleOptions)

OracleOption configures options for AddOracle.

func OracleWithSigner

func OracleWithSigner(signer string) OracleOption

OracleWithSigner provides a custom signer name for the message

type PacketOption

type PacketOption func(*packetOptions)

PacketOption configures the packet scaffolding

func PacketWithSigner

func PacketWithSigner(signer string) PacketOption

PacketWithSigner provides a custom signer name for the packet

func PacketWithoutMessage

func PacketWithoutMessage() PacketOption

PacketWithoutMessage disables generating sdk compatible messages and tx related APIs.

type Scaffolder

type Scaffolder struct {

	// Version of the chain
	Version cosmosver.Version
	// contains filtered or unexported fields
}

Scaffolder is Ignite CLI app scaffolder.

func App

func App(path string) (Scaffolder, error)

App creates a new scaffolder for an existent app.

func (Scaffolder) AddMessage

func (s Scaffolder) AddMessage(
	ctx context.Context,
	tracer *placeholder.Tracer,
	moduleName,
	msgName string,
	fields,
	resFields []string,
	options ...MessageOption,
) (sm xgenny.SourceModification, err error)

AddMessage adds a new message to scaffolded app

func (*Scaffolder) AddOracle

func (s *Scaffolder) AddOracle(
	tracer *placeholder.Tracer,
	moduleName,
	queryName string,
	options ...OracleOption,
) (sm xgenny.SourceModification, err error)

AddOracle adds a new BandChain oracle envtest.

func (Scaffolder) AddPacket

func (s Scaffolder) AddPacket(
	ctx context.Context,
	tracer *placeholder.Tracer,
	moduleName,
	packetName string,
	packetFields,
	ackFields []string,
	options ...PacketOption,
) (sm xgenny.SourceModification, err error)

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

func (Scaffolder) AddQuery

func (s Scaffolder) AddQuery(
	ctx context.Context,
	tracer *placeholder.Tracer,
	moduleName,
	queryName,
	description string,
	reqFields,
	resFields []string,
	paginated bool,
) (sm xgenny.SourceModification, err error)

AddQuery adds a new query to scaffolded app

func (Scaffolder) AddType

func (s Scaffolder) AddType(
	ctx context.Context,
	typeName string,
	tracer *placeholder.Tracer,
	kind AddTypeKind,
	options ...AddTypeOption,
) (sm xgenny.SourceModification, err error)

AddType adds a new type to a scaffolded app. if non of the list, map or singleton given, a dry type without anything extra (like a storage layer, models, CLI etc.) will be scaffolded. if no module is given, the type will be scaffolded inside the app's default module.

func (Scaffolder) CreateModule

func (s Scaffolder) CreateModule(
	tracer *placeholder.Tracer,
	moduleName string,
	options ...ModuleCreationOption,
) (sm xgenny.SourceModification, err error)

CreateModule creates a new empty module in the scaffolded app

func (Scaffolder) ImportModule

func (s Scaffolder) ImportModule(tracer *placeholder.Tracer, name string) (sm xgenny.SourceModification, err error)

ImportModule imports specified module with name to the scaffolded app.

Jump to

Keyboard shortcuts

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