nlpenginerequestor

package
v0.0.0-...-d123b64 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPNLPEngineClient

func NewHTTPNLPEngineClient(httpNLPEngineClientConfig HTTPNLPEngineClientConfig) interfaces.NLPEngine

NewHTTPNLPEngineClient creates a new instance of HTTPNLPEngineClient, which implements the NLPEngine interface.

Types

type Factory

type Factory struct{}

Factory is a struct for creating different implementations of the NLPEngine interface.

func (*Factory) Instantiate

func (f *Factory) Instantiate(config HTTPNLPEngineClientConfig) (interfaces.NLPEngine, error)

Instantiate creates an implementation of the NLPEngine interface.

type HTTPNLPEngineClient

type HTTPNLPEngineClient struct {
	// contains filtered or unexported fields
}

HTTPNLPEngineClient is a struct that implements the NLPEngine interface and makes HTTP calls to the dragondrop API.

func (*HTTPNLPEngineClient) PostNLPEngine

func (c *HTTPNLPEngineClient) PostNLPEngine(ctx context.Context) error

PostNLPEngine posts a correctly formatted request to the NLP engine endpoint, receiving and then saving out data on the mapping of new resources to state files.

type HTTPNLPEngineClientConfig

type HTTPNLPEngineClientConfig struct {
	// VCSRepo is the full path of the repo containing a customer's infrastructure specification.
	// At the moment, must be a valid GitHub repository URL.
	VCSRepo string `required:"true"`

	// NLPEndpoint is the endpoint for the NLP service.
	NLPEndpoint string

	// WorkspaceDirectories is a slice of directories that contains terraform workspaces within the user repo.
	WorkspaceDirectories terraformWorkspace.WorkspaceDirectoriesDecoder `required:"true"`
}

HTTPNLPEngineClientConfig is configuration for the HTTPNLPEngineClient struct that conforms to envconfig's format expectations.

type NLPEnginePostBody

type NLPEnginePostBody struct {
	NewResourceToDoc string `json:"new_resource_docs"`
	WorkspaceToDoc   string `json:"workspace_docs"`
}

Jump to

Keyboard shortcuts

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