scaffolder

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 61 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 Init

func Init(
	ctx context.Context,
	cacheStorage cache.Storage,
	tracer *placeholder.Tracer,
	root, name, addressPrefix string,
	noDefaultModule, skipGit bool,
) (path string, err error)

Init initializes a new app with name and given options.

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 deprecated

func OracleWithSigner(signer string) OracleOption

OracleWithSigner provides a custom signer name for the message

Deprecated: This function is no longer maintained.

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 New added in v0.26.0

func New(appPath string) (Scaffolder, error)

New creates a new scaffold app.

func (Scaffolder) AddMessage

func (s Scaffolder) AddMessage(
	ctx context.Context,
	cacheStorage cache.Storage,
	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 deprecated

func (s *Scaffolder) AddOracle(
	ctx context.Context,
	cacheStorage cache.Storage,
	tracer *placeholder.Tracer,
	moduleName,
	queryName string,
	options ...OracleOption,
) (sm xgenny.SourceModification, err error)

AddOracle adds a new BandChain oracle envtest.

Deprecated: This function is no longer maintained.

func (Scaffolder) AddPacket

func (s Scaffolder) AddPacket(
	ctx context.Context,
	cacheStorage cache.Storage,
	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,
	cacheStorage cache.Storage,
	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,
	cacheStorage cache.Storage,
	typeName string,
	tracer *placeholder.Tracer,
	kind AddTypeKind,
	options ...AddTypeOption,
) (sm xgenny.SourceModification, err error)

AddType adds a new type to a scaffolded app. if none 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(
	ctx context.Context,
	cacheStorage cache.Storage,
	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(
	ctx context.Context,
	cacheStorage cache.Storage,
	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