github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/sdk/names.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  	names "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/names"
    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  // Names provides an interface to the command line chifra names through the SDK.
    21  func Names(rCtx *output.RenderCtx, w io.Writer, values url.Values) error {
    22  	names.ResetOptions(sdkTestMode)
    23  	opts := names.NamesFinishParseInternal(w, values)
    24  	// EXISTING_CODE
    25  	var err1 error
    26  	if err1 = opts.LoadCrudDataIfNeeded(nil); err1 != nil {
    27  		return err1
    28  	}
    29  	// EXISTING_CODE
    30  	outputHelpers.InitJsonWriterApi("names", w, &opts.Globals)
    31  	err := opts.NamesInternal(rCtx)
    32  	outputHelpers.CloseJsonWriterIfNeededApi("names", err, &opts.Globals)
    33  
    34  	return err
    35  }
    36  
    37  // EXISTING_CODE
    38  // EXISTING_CODE