github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/sdk/init.go (about)

     1  // Copyright 2016, 2024 The TrueBlocks Authors. All rights reserved.
     2  // Use of this source code is governed by a license that can
     3  // be found in the LICENSE file.
     4  /*
     5   * Parts of this file were auto generated. Edit only those parts of
     6   * the code inside of 'EXISTING_CODE' tags.
     7   */
     8  
     9  package sdk
    10  
    11  import (
    12  	"io"
    13  	"net/url"
    14  
    15  	initPkg "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/init"
    16  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output"
    17  	outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
    18  )
    19  
    20  // Init provides an interface to the command line chifra init through the SDK.
    21  func Init(rCtx *output.RenderCtx, w io.Writer, values url.Values) error {
    22  	initPkg.ResetOptions(sdkTestMode)
    23  	opts := initPkg.InitFinishParseInternal(w, values)
    24  	// EXISTING_CODE
    25  	// EXISTING_CODE
    26  	outputHelpers.InitJsonWriterApi("init", w, &opts.Globals)
    27  	err := opts.InitInternal(rCtx)
    28  	outputHelpers.CloseJsonWriterIfNeededApi("init", err, &opts.Globals)
    29  
    30  	return err
    31  }
    32  
    33  // EXISTING_CODE
    34  // EXISTING_CODE