explainer

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

One or two sentence synopsis of the package...

Overview

One or two paragraph overview of the package... (This page describes the nature of the individual package.)

More information at https://github.com/senzing-garage/explain

Another Header

Details of the package... Lorem ipsum dolor sit amet, consectetur adipiscing elit...

Examples

The examples given here should be specific to the package.

Examples of use can be seen in the examplepackage_test.go files.

package main
import (
	fmt

	"github.com/senzing-garage/explain/examplepackage"
)

func main() {
	ctx := context.TODO()
	testObject := &ExamplePackageImpl{
		Something: "I'm here",
	}
	err := testObject.SaySomething(ctx)
	if err != nil {
		fmt.Println("whoops")
	}
}

Index

Examples

Constants

This section is empty.

Variables

View Source
var ComponentId2WebPage = map[int]string{
	6001: page("sz-sdk-go-core"),
	6002: page("sz-sdk-go-core"),
	6003: page("sz-sdk-go-core"),
	6004: page("sz-sdk-go-core"),
	6005: page("sz-sdk-go-core"),
	6006: page("sz-sdk-go-core"),
	6007: page("sz-sdk-go-core"),
	6008: page("sz-sdk-go-core"),
	6009: page("sz-sdk-go-core"),
	6011: page("serve-grpc"),
	6012: page("serve-grpc"),
	6013: page("serve-grpc"),
	6014: page("serve-grpc"),
	6015: page("serve-grpc"),
	6016: page("serve-grpc"),
	6017: page("serve-grpc"),
	6021: page("sz-sdk-go-grpc"),
	6022: page("sz-sdk-go-grpc"),
	6023: page("sz-sdk-go-grpc"),
	6024: page("sz-sdk-go-grpc"),
	6025: page("sz-sdk-go-grpc"),
	6026: page("sz-sdk-go-grpc"),
	6027: page("sz-sdk-go-grpc"),
	6031: page("sz-sdk-go-mock"),
	6032: page("sz-sdk-go-mock"),
	6033: page("sz-sdk-go-mock"),
	6034: page("sz-sdk-go-mock"),
	6035: page("sz-sdk-go-mock"),
	6036: page("sz-sdk-go-mock"),
	6037: page("sz-sdk-go-mock"),
	6038: page("sz-sdk-go-mock"),
	6039: page("sz-sdk-go-mock"),
	6041: page("go-sdk-abstract-factory"),
	6100: page("senzing-tools"),
	6201: page("load"),
	6202: page("move"),
	6203: page("validate"),
	6204: page("serve-grpc"),
	6205: page("init-database"),
	6206: page("shuffle"),
	6207: page("observe"),
	6401: page("go-helpers"),
	6402: page("go-helpers"),
	6403: page("go-helpers"),
	6404: page("go-helpers"),
	6421: page("go-databasing"),
	6422: page("go-databasing"),
	6423: page("go-databasing"),
	6441: page("go-logging"),
	6461: page("go-observing"),
	6462: page("go-observing"),
	6463: page("go-observing"),
	6464: page("go-observing"),
	6481: page("go-queuing"),
	6501: page("init-database"),
	6502: page("init-database"),
	6503: page("init-database"),
	6601: page("load"),
	6602: page("move"),
	6620: page("serve-chat"),
}

Functions

func ParseErrorMessage

func ParseErrorMessage(errorMessage string) (int, int, error)

Types

type Explainer

type Explainer interface {
	Explain(ctx context.Context) error
}

The Explainer interface is used as a "Command Pattern". See https://en.wikipedia.org/wiki/Command_pattern

type ExplainerError

type ExplainerError struct {
	ErrorId string
	TtyOnly bool
}

ExplainError is an example type-struct.

Example
package main

import (
	"context"

	"github.com/senzing-garage/explain/explainer"
)

func main() {
	// For more information, visit https://github.com/senzing-garage/explain/blob/main/explainer/explainer_error_test.go
	ctx := context.TODO()
	explainer := &explainer.ExplainerError{
		ErrorId: "senzing-60010000",
		TtyOnly: true,
	}
	err := explainer.Explain(ctx)
	if err != nil {
		panic(err)
	}
}
Output:

For information on that error, visit https://hub.senzing.com/sz-sdk-go-core/errors#senzing-60010000

func (*ExplainerError) Explain

func (explainer *ExplainerError) Explain(ctx context.Context) error

The Explain method...

Input

  • ctx: A context to control lifecycle.

Output

  • Nothing is returned, except for an error. However, something is printed. See the example output.

type ExplainerNull

type ExplainerNull struct {
}

ExplainError is an example type-struct.

Example
package main

import (
	"context"

	"github.com/senzing-garage/explain/explainer"
)

func main() {
	// For more information, visit https://github.com/senzing-garage/explain/blob/main/explainer/explainer_error_test.go
	ctx := context.TODO()
	explainer := &explainer.ExplainerError{
		ErrorId: "senzing-60010000",
		TtyOnly: true,
	}
	err := explainer.Explain(ctx)
	if err != nil {
		panic(err)
	}
}
Output:

For information on that error, visit https://hub.senzing.com/sz-sdk-go-core/errors#senzing-60010000

func (*ExplainerNull) Explain

func (explainer *ExplainerNull) Explain(ctx context.Context) error

The Explain method simply returns an error to drive the "Usage" output by the caller.

Input

  • ctx: A context to control lifecycle.

Jump to

Keyboard shortcuts

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