reqsimport

package
v0.0.0-...-6801f60 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opts

type Opts struct {
	ReqsvcURL string
}

Opts contains the options available for the primary package type ReqsImport.

type ReqsImport

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

ReqsImport represents a reusable http.Client and related options.

func Init

func Init() *ReqsImport

Init is a convenience wrapper for New.

func New

func New(opts Opts) (*ReqsImport, error)

New forms a pointer to a default ReqsImport instance.

func (*ReqsImport) Changeset

func (ri *ReqsImport) Changeset(data []byte, lang string) ([]*mono_models.CommitChangeEditable, error)

Changeset posts requirements data to a backend service and returns a Changeset that can be committed to a project.

type TranslationLineError

type TranslationLineError struct {
	ErrMsg string `json:"errorText,omitempty"`
	PkgTxt string `json:"packageText,omitempty"`
}

TranslationLineError represents an error reported by the requirements translation service regarding a single line processed from the request.

func (*TranslationLineError) Error

func (e *TranslationLineError) Error() string

Error implements the error interface.

type TranslationReqMsg

type TranslationReqMsg struct {
	Data        string `json:"requirements"`
	Language    string `json:"language"`
	Unformatted bool   `json:"unformatted"`
}

TranslationReqMsg represents the message sent to the requirements translation service.

type TranslationRespMsg

type TranslationRespMsg struct {
	Changeset []*mono_models.CommitChangeEditable `json:"changeset,omitempty"`
	LineErrs  []TranslationLineError              `json:"errors,omitempty"`
}

TranslationRespMsg represents the message returned by the requirements translation service.

type TranslationResponseError

type TranslationResponseError struct {
	LineErrs []TranslationLineError
}

TranslationResponseError contains multiple error messages and allows them to be handled as a common error.

func (*TranslationResponseError) Error

func (e *TranslationResponseError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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