response

package
v0.0.0-...-59dad38 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrorResponse

func IsErrorResponse(errorType string) bool

func ProcessBuildError

func ProcessBuildError(build *BuildResponse, fallbackMessage string) error

func ProcessCommitError

func ProcessCommitError(commit *Commit, fallbackMessage string) error

func ProcessMergedCommitError

func ProcessMergedCommitError(mcErr *MergedCommit, fallbackMessage string) error

func ProcessProjectCreatedError

func ProcessProjectCreatedError(pcErr *ProjectCreated, fallbackMessage string) error

func ProcessProjectError

func ProcessProjectError(project *ProjectResponse, fallbackMessage string) error

func ProcessRevertCommitError

func ProcessRevertCommitError(rcErr *RevertedCommit, fallbackMessage string) error

Types

type ArtifactResponse

type ArtifactResponse struct {
	NodeID      strfmt.UUID `json:"nodeId"`
	Errors      []string    `json:"errors"`
	Status      string      `json:"status"`
	DisplayName string      `json:"displayName"`
	LogURL      string      `json:"logURL"`
}

type BuildExprError

type BuildExprError struct {
	Type    string `json:"__typename"`
	Message string `json:"message"`
	*TargetNotFoundError
	*GenericSolveError
}

BuildExprError represents a location in the build script where an error occurred.

type BuildPlannerError

type BuildPlannerError struct {
	Err              error
	ValidationErrors []string
	IsTransient      bool
}

func (*BuildPlannerError) Error

func (e *BuildPlannerError) Error() string

func (*BuildPlannerError) InputError

func (e *BuildPlannerError) InputError() bool

InputError returns true as we want to treat all build planner errors as input errors and not report them to Rollbar. We defer the responsibility of logging these errors to the maintainers of the build planner.

func (*BuildPlannerError) LocaleError

func (e *BuildPlannerError) LocaleError() string

LocaleError returns the error message to be displayed to the user. This function is added so that BuildPlannerErrors will be displayed to the user

func (*BuildPlannerError) Unwrap

func (e *BuildPlannerError) Unwrap() error

type BuildResponse

type BuildResponse struct {
	Type       string             `json:"__typename"`
	Artifacts  []ArtifactResponse `json:"artifacts"`
	Status     string             `json:"status"`
	RawMessage json.RawMessage    `json:"rawMessage"`
	*Error
	*ErrorWithSubErrors
}

func (*BuildResponse) MarshalJSON

func (b *BuildResponse) MarshalJSON() ([]byte, error)

func (*BuildResponse) UnmarshalJSON

func (b *BuildResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON lets us record both the raw json message as well as unmarshal the parts we care about because without this function only the RawMessage itself would be set, the rest of the field would be empty. This is effectively working around a silly json library limitation.

type Commit

type Commit struct {
	Type       string          `json:"__typename"`
	AtTime     strfmt.DateTime `json:"atTime"`
	Expression json.RawMessage `json:"expr"`
	CommitID   strfmt.UUID     `json:"commitId"`
	ParentID   strfmt.UUID     `json:"parentId"`
	Build      *BuildResponse  `json:"build"`
	*Error
	*ErrorWithSubErrors
}

Commit contains the build and any errors.

type CommitError

type CommitError struct {
	Type                   string
	Message                string
	*locale.LocalizedError // for legacy, non-user-facing error usages
}

type Error

type Error struct {
	Message string `json:"message"`
}

Error contains an error message.

type ErrorWithSubErrors

type ErrorWithSubErrors struct {
	SubErrors []*BuildExprError `json:"subErrors"`
}

type GenericSolveError

type GenericSolveError struct {
	IsTransient      bool                          `json:"isTransient"`
	ValidationErrors []*SolverErrorValidationError `json:"validationErrors"`
}

type MergedCommit

type MergedCommit struct {
	Type   string  `json:"__typename"`
	Commit *Commit `json:"commit"`
	*Error
	*ErrorWithSubErrors
}

MergedCommit is the result of a merge commit mutation. The resulting commit is only pushed to the platform automatically if the target ref was a named branch and the merge strategy was FastForward.

type MergedCommitError

type MergedCommitError struct {
	Type    string
	Message string
}

func (*MergedCommitError) Error

func (m *MergedCommitError) Error() string

type ProjectCreated

type ProjectCreated struct {
	Type   string  `json:"__typename"`
	Commit *Commit `json:"commit"`
	*Error
}

type ProjectCreatedError

type ProjectCreatedError struct {
	Type    string
	Message string
}

func (*ProjectCreatedError) Error

func (p *ProjectCreatedError) Error() string

type ProjectResponse

type ProjectResponse struct {
	Type   string  `json:"__typename"`
	Commit *Commit `json:"commit"`
	*Error
}

ProjectResponse contains the commit and any errors.

func (*ProjectResponse) PostProcess

func (pr *ProjectResponse) PostProcess() error

PostProcess must satisfy gqlclient.PostProcessor interface

type RevertCommitError

type RevertCommitError struct {
	Type    string
	Message string
}

func (*RevertCommitError) Error

func (m *RevertCommitError) Error() string

type RevertedCommit

type RevertedCommit struct {
	Type           string      `json:"__typename"`
	Commit         *Commit     `json:"commit"`
	CommonAncestor strfmt.UUID `json:"commonAncestorID"`
	ConflictPaths  []string    `json:"conflictPaths"`
	*Error
	*ErrorWithSubErrors
}

type SolverErrorValidationError

type SolverErrorValidationError struct {
	JSONPath string `json:"jsonPath"`
	Error    string `json:"error"`
}

SolverErrorValidationError represents a validation error that occurred during planning.

type TargetNotFoundError

type TargetNotFoundError struct {
	Message         string
	RequestedTarget string
	PossibleTargets []string
}

func (*TargetNotFoundError) Error

func (e *TargetNotFoundError) Error() string

func (*TargetNotFoundError) InputError

func (e *TargetNotFoundError) InputError() bool

Jump to

Keyboard shortcuts

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