Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/go sdk 2 #3524

Merged
merged 23 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
go 1.22

use ./src/apps/chifra

use ./src/examples/usesSDK
37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/abis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

abis "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/abis"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Abis provides an interface to the command line chifra abis through the SDK.
func Abis(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

abis.ResetOptions(false)
opts := abis.AbisFinishParseInternal(w, values)
outputHelpers.EnableCommand("abis", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("abis", w, &opts.Globals)
err := opts.AbisInternal()
outputHelpers.CloseJsonWriterIfNeededApi("abis", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/blocks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

blocks "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/blocks"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Blocks provides an interface to the command line chifra blocks through the SDK.
func Blocks(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

blocks.ResetOptions(false)
opts := blocks.BlocksFinishParseInternal(w, values)
outputHelpers.EnableCommand("blocks", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("blocks", w, &opts.Globals)
err := opts.BlocksInternal()
outputHelpers.CloseJsonWriterIfNeededApi("blocks", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/chunks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

chunks "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/chunks"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Chunks provides an interface to the command line chifra chunks through the SDK.
func Chunks(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

chunks.ResetOptions(false)
opts := chunks.ChunksFinishParseInternal(w, values)
outputHelpers.EnableCommand("chunks", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("chunks", w, &opts.Globals)
err := opts.ChunksInternal()
outputHelpers.CloseJsonWriterIfNeededApi("chunks", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

config "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/config"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Config provides an interface to the command line chifra config through the SDK.
func Config(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

config.ResetOptions(false)
opts := config.ConfigFinishParseInternal(w, values)
outputHelpers.EnableCommand("config", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("config", w, &opts.Globals)
err := opts.ConfigInternal()
outputHelpers.CloseJsonWriterIfNeededApi("config", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/daemon.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

daemon "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/daemon"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Daemon provides an interface to the command line chifra daemon through the SDK.
func Daemon(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

daemon.ResetOptions(false)
opts := daemon.DaemonFinishParseInternal(w, values)
outputHelpers.EnableCommand("daemon", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("daemon", w, &opts.Globals)
err := opts.DaemonInternal()
outputHelpers.CloseJsonWriterIfNeededApi("daemon", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/explore.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

explore "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/explore"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Explore provides an interface to the command line chifra explore through the SDK.
func Explore(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

explore.ResetOptions(false)
opts := explore.ExploreFinishParseInternal(w, values)
outputHelpers.EnableCommand("explore", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("explore", w, &opts.Globals)
err := opts.ExploreInternal()
outputHelpers.CloseJsonWriterIfNeededApi("explore", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/export.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

export "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/export"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Export provides an interface to the command line chifra export through the SDK.
func Export(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

export.ResetOptions(false)
opts := export.ExportFinishParseInternal(w, values)
outputHelpers.EnableCommand("export", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("export", w, &opts.Globals)
err := opts.ExportInternal()
outputHelpers.CloseJsonWriterIfNeededApi("export", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

initPkg "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/init"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Init provides an interface to the command line chifra init through the SDK.
func Init(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

initPkg.ResetOptions(false)
opts := initPkg.InitFinishParseInternal(w, values)
outputHelpers.EnableCommand("init", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("init", w, &opts.Globals)
err := opts.InitInternal()
outputHelpers.CloseJsonWriterIfNeededApi("init", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

list "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/list"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// List provides an interface to the command line chifra list through the SDK.
func List(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

list.ResetOptions(false)
opts := list.ListFinishParseInternal(w, values)
outputHelpers.EnableCommand("list", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("list", w, &opts.Globals)
err := opts.ListInternal()
outputHelpers.CloseJsonWriterIfNeededApi("list", err, &opts.Globals)

return err
}

37 changes: 37 additions & 0 deletions src/apps/chifra/sdk/logs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2024 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.
/*
* Parts of this file were generated with makeClass --run. Edit only those parts of
* the code inside of 'EXISTING_CODE' tags.
*/

package sdk

import (
"io"
"net/url"

logs "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/internal/logs"
outputHelpers "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output/helpers"
)

// Logs provides an interface to the command line chifra logs through the SDK.
func Logs(w io.Writer, options map[string]string) error {
values := make(url.Values)
for key, val := range options {
values.Set(key, val)
}

logs.ResetOptions(false)
opts := logs.LogsFinishParseInternal(w, values)
outputHelpers.EnableCommand("logs", true)
// EXISTING_CODE
// EXISTING_CODE
outputHelpers.InitJsonWriterApi("logs", w, &opts.Globals)
err := opts.LogsInternal()
outputHelpers.CloseJsonWriterIfNeededApi("logs", err, &opts.Globals)

return err
}

Loading
Loading