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