Documentation ¶
Overview ¶
Package scaffolder initializes Ignite CLI apps and modifies existing ones to add more features in a later time.
Index ¶
- func Init(ctx context.Context, runner *xgenny.Runner, ...) (string, string, error)
- func PostScaffold(ctx context.Context, cacheStorage cache.Storage, ...) error
- type AddTypeKind
- type AddTypeOption
- type MessageOption
- type ModuleCreationOption
- func WithDependencies(dependencies []modulecreate.Dependency) ModuleCreationOption
- func WithIBC() ModuleCreationOption
- func WithIBCChannelOrdering(ordering string) ModuleCreationOption
- func WithModuleConfigs(moduleConfigs []string) ModuleCreationOption
- func WithParams(params []string) ModuleCreationOption
- type PacketOption
- type Scaffolder
- func (s Scaffolder) AddMessage(ctx context.Context, moduleName, msgName string, fields, resFields []string, ...) error
- func (s Scaffolder) AddPacket(ctx context.Context, moduleName, packetName string, ...) error
- func (s Scaffolder) AddQuery(ctx context.Context, moduleName, queryName, description string, ...) error
- func (s Scaffolder) AddType(ctx context.Context, typeName string, kind AddTypeKind, ...) error
- func (s Scaffolder) ApplyModifications() (xgenny.SourceModification, error)
- func (s Scaffolder) CreateConfigs(moduleName string, configs ...string) error
- func (s Scaffolder) CreateModule(moduleName string, options ...ModuleCreationOption) error
- func (s Scaffolder) CreateParams(moduleName string, params ...string) error
- func (s Scaffolder) PostScaffold(ctx context.Context, cacheStorage cache.Storage, skipProto bool) error
- func (s Scaffolder) Run(gens ...*genny.Generator) error
- func (s Scaffolder) Tracer() *placeholder.Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddTypeKind ¶
type AddTypeKind func(*addTypeOptions)
AddTypeKind configures the type kind option for AddType.
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 WithIBCChannelOrdering ¶
func WithIBCChannelOrdering(ordering string) ModuleCreationOption
WithIBCChannelOrdering configures channel ordering of the IBC module.
func WithModuleConfigs ¶
func WithModuleConfigs(moduleConfigs []string) ModuleCreationOption
WithModuleConfigs scaffolds a module with module configs.
func WithParams ¶
func WithParams(params []string) ModuleCreationOption
WithParams scaffolds a module with params.
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 ¶
func New(context context.Context, appPath, protoDir string) (Scaffolder, error)
New creates a new scaffold app.
func (Scaffolder) AddMessage ¶
func (s Scaffolder) AddMessage( ctx context.Context, moduleName, msgName string, fields, resFields []string, options ...MessageOption, ) error
AddMessage adds a new message to scaffolded app.
func (Scaffolder) AddPacket ¶
func (s Scaffolder) AddPacket( ctx context.Context, moduleName, packetName string, packetFields, ackFields []string, options ...PacketOption, ) 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, moduleName, queryName, description string, reqFields, resFields []string, paginated bool, ) error
AddQuery adds a new query to scaffolded app.
func (Scaffolder) AddType ¶
func (s Scaffolder) AddType( ctx context.Context, typeName string, kind AddTypeKind, options ...AddTypeOption, ) 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) ApplyModifications ¶
func (s Scaffolder) ApplyModifications() (xgenny.SourceModification, error)
func (Scaffolder) CreateConfigs ¶
func (s Scaffolder) CreateConfigs( moduleName string, configs ...string, ) error
CreateConfigs creates a new configs in the scaffolded module.
func (Scaffolder) CreateModule ¶
func (s Scaffolder) CreateModule( moduleName string, options ...ModuleCreationOption, ) error
CreateModule creates a new empty module in the scaffolded app.
func (Scaffolder) CreateParams ¶
func (s Scaffolder) CreateParams( moduleName string, params ...string, ) error
CreateParams creates a new params in the scaffolded module.
func (Scaffolder) PostScaffold ¶
func (Scaffolder) Run ¶
func (s Scaffolder) Run(gens ...*genny.Generator) error
func (Scaffolder) Tracer ¶
func (s Scaffolder) Tracer() *placeholder.Tracer