init

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: CC0-1.0 Imports: 5 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInitCmd

func NewInitCmd(cfg *Config) *cobra.Command

NewInitCmd returns the command that should be run in order to properly initialize Juno

Types

type Config

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

Config contains the configuration data for the init command

func NewConfig

func NewConfig() *Config

NewConfig allows to build a new Config instance

func (*Config) GetConfigCreator

func (c *Config) GetConfigCreator() ConfigCreator

GetConfigCreator return the function that should be run to create a configuration from a set of flags specified by the user with the "init" command

func (*Config) WithConfigCreator

func (c *Config) WithConfigCreator(creator ConfigCreator) *Config

WithConfigCreator sets the given setup function as the configuration creator

type ConfigCreator

type ConfigCreator = func(cmd *cobra.Command) WritableConfig

ConfigCreator represents a function that builds a Config instance from the flags that have been specified by the user inside the given command.

type WritableConfig added in v3.1.0

type WritableConfig interface {
	// GetBytes returns the bytes to be written to the config file when initializing it
	GetBytes() ([]byte, error)
}

WritableConfig represents a configuration that can be written to a file

func DefaultConfigCreator

func DefaultConfigCreator(_ *cobra.Command) WritableConfig

DefaultConfigCreator represents the default configuration creator that builds a Config instance using the values specified using the default flags.

Jump to

Keyboard shortcuts

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