types

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSON_NULL = []byte("null")

Functions

This section is empty.

Types

type APIError added in v1.2.0

type APIError interface {
	JSONResponse(http.ResponseWriter)
}

type APIErrorCredentialServiceUnavailable added in v1.2.0

type APIErrorCredentialServiceUnavailable struct {
	Code ErrorCode `json:"code"`
}

func APIErrorCredentialsUnavailableFromAgentError added in v1.2.0

func APIErrorCredentialsUnavailableFromAgentError(aerr AgentError) APIErrorCredentialServiceUnavailable

func (*APIErrorCredentialServiceUnavailable) JSONResponse added in v1.2.0

type APIErrorInvalidTOMLFileDetails added in v1.2.0

type APIErrorInvalidTOMLFileDetails struct {
	Code    ErrorCode              `json:"code"`
	Details InvalidTOMLFileDetails `json:"details"`
}

func APIErrorInvalidTOMLFileFromAgentError added in v1.2.0

func APIErrorInvalidTOMLFileFromAgentError(aerr AgentError) APIErrorInvalidTOMLFileDetails

func (*APIErrorInvalidTOMLFileDetails) Error added in v1.2.0

func (apierr *APIErrorInvalidTOMLFileDetails) Error() string

func (*APIErrorInvalidTOMLFileDetails) JSONResponse added in v1.2.0

func (apierr *APIErrorInvalidTOMLFileDetails) JSONResponse(w http.ResponseWriter)

type APIErrorTomlUnknownErrorDetails added in v1.2.0

type APIErrorTomlUnknownErrorDetails struct {
	Code    ErrorCode                    `json:"code"`
	Details ErrorTomlUnknownErrorDetails `json:"details"`
}

func APIErrorTomlUnknownErrorFromAgentError added in v1.2.0

func APIErrorTomlUnknownErrorFromAgentError(aerr AgentError, configPath string) APIErrorTomlUnknownErrorDetails

func (*APIErrorTomlUnknownErrorDetails) Error added in v1.2.0

func (apierr *APIErrorTomlUnknownErrorDetails) Error() string

func (*APIErrorTomlUnknownErrorDetails) JSONResponse added in v1.2.0

func (apierr *APIErrorTomlUnknownErrorDetails) JSONResponse(w http.ResponseWriter)

type APIErrorTomlValidationDetails added in v1.2.0

type APIErrorTomlValidationDetails struct {
	Code    ErrorCode                  `json:"code"`
	Details ErrorTomlValidationDetails `json:"details"`
}

func APIErrorTomlValidationFromAgentError added in v1.2.0

func APIErrorTomlValidationFromAgentError(aerr AgentError, configPath string) APIErrorTomlValidationDetails

func (*APIErrorTomlValidationDetails) Error added in v1.2.0

func (apierr *APIErrorTomlValidationDetails) Error() string

func (*APIErrorTomlValidationDetails) JSONResponse added in v1.2.0

func (apierr *APIErrorTomlValidationDetails) JSONResponse(w http.ResponseWriter)

type APIErrorUnknownTOMLKeyDetails added in v1.2.0

type APIErrorUnknownTOMLKeyDetails struct {
	Code    ErrorCode             `json:"code"`
	Details UnknownTOMLKeyDetails `json:"details"`
}

func APIErrorUnknownTOMLKeyFromAgentError added in v1.2.0

func APIErrorUnknownTOMLKeyFromAgentError(aerr AgentError) APIErrorUnknownTOMLKeyDetails

func (*APIErrorUnknownTOMLKeyDetails) Error added in v1.2.0

func (apierr *APIErrorUnknownTOMLKeyDetails) Error() string

func (*APIErrorUnknownTOMLKeyDetails) JSONResponse added in v1.2.0

func (apierr *APIErrorUnknownTOMLKeyDetails) JSONResponse(w http.ResponseWriter)

type AgentError

type AgentError struct {
	Code    ErrorCode `json:"code" toml:"code"`
	Err     error     `json:"-" toml:"-"`
	Message string    `json:"msg" toml:"message"`
	Op      Operation `json:"operation" toml:"operation"`
	Data    ErrorData `json:"data" toml:"data,omitempty"`
}

func AsAgentError

func AsAgentError(e error) *AgentError

func IsAgentError added in v1.2.0

func IsAgentError(err error) (*AgentError, bool)

Evaluate if a given error is an AgentError returning the error as AgentError type when it is and a bool flag of the comparison result.

func NewAgentError

func NewAgentError(code ErrorCode, err error, details any) *AgentError

func (*AgentError) Error

func (e *AgentError) Error() string

func (*AgentError) GetCode

func (e *AgentError) GetCode() ErrorCode

func (*AgentError) GetData

func (e *AgentError) GetData() ErrorData

func (*AgentError) GetOperation

func (e *AgentError) GetOperation() Operation

func (*AgentError) SetOperation

func (e *AgentError) SetOperation(op Operation)

type BundleID

type BundleID string

type ContentID

type ContentID string

type ContentName

type ContentName string

type ErrorCode

type ErrorCode string
const (
	ErrorResourceNotFound             ErrorCode = "resourceNotFound"
	ErrorInvalidTOML                  ErrorCode = "invalidTOML"
	ErrorUnknownTOMLKey               ErrorCode = "unknownTOMLKey"
	ErrorInvalidConfigFiles           ErrorCode = "invalidConfigFiles"
	ErrorCredentialServiceUnavailable ErrorCode = "credentialsServiceUnavailable"
	ErrorCertificateVerification      ErrorCode = "errorCertificateVerification"
	ErrorRenvLockPackagesReading      ErrorCode = "renvlockPackagesReadingError"
	ErrorRequirementsFileReading      ErrorCode = "requirementsFileReadingError"
	ErrorDeployedContentNotRunning    ErrorCode = "deployedContentNotRunning"
	ErrorUnknown                      ErrorCode = "unknown"
	ErrorTomlValidationError          ErrorCode = "tomlValidationError"
	ErrorTomlUnknownError             ErrorCode = "tomlUnknownError"
)

type ErrorData

type ErrorData map[string]any

type ErrorTomlUnknownErrorDetails added in v1.2.0

type ErrorTomlUnknownErrorDetails struct {
	Filename string `json:"filename"`
	Problem  string `json:"problem"`
}

ErrorTomlUnknownError

type ErrorTomlValidationDetails added in v1.2.0

type ErrorTomlValidationDetails struct {
	Filename        string `json:"filename"`
	Message         string `json:"message"`
	Key             string `json:"key"`
	Problem         string `json:"problem"`
	SchemaReference string `json:"schema-reference"`
}

ErrorTomlValidationError

type EventableError

type EventableError interface {
	error
	SetOperation(op Operation) // Caller who receives an error calls SetOperation to attach context
	GetOperation() Operation   // Retrieve Operation for serialization
	GetCode() ErrorCode        // Retrieve Code for serialization
	GetData() ErrorData        // Retrieve Data for serialization
}

func OperationError

func OperationError(op Operation, err error) EventableError

type GUID

type GUID string

type Int64Str

type Int64Str string

type InvalidTOMLFileDetails added in v1.2.0

type InvalidTOMLFileDetails struct {
	Filename string `json:"filename"`
	Line     int    `json:"line"`
	Column   int    `json:"column"`
}

type NullBool

type NullBool = Optional[bool]

type NullBundleID

type NullBundleID = Optional[BundleID]

type NullContentID

type NullContentID = Optional[ContentID]

type NullFloat64

type NullFloat64 = Optional[float64]

type NullGUID

type NullGUID = Optional[GUID]

type NullInt32

type NullInt32 = Optional[int32]

type NullInt64

type NullInt64 = Optional[int64]

type NullInt64Str

type NullInt64Str = Optional[Int64Str]

type NullString

type NullString = Optional[string]

type NullTime

type NullTime = Optional[Time]

type Operation

type Operation string

type Optional

type Optional[T any] struct {
	// contains filtered or unexported fields
}

func NewOptional

func NewOptional[T any](value T) Optional[T]

func (*Optional[T]) Get

func (opt *Optional[T]) Get() (T, bool)

func (Optional[T]) MarshalJSON

func (opt Optional[T]) MarshalJSON() ([]byte, error)

func (*Optional[T]) UnmarshalJSON

func (opt *Optional[T]) UnmarshalJSON(data []byte) error

func (*Optional[T]) Valid

func (opt *Optional[T]) Valid() bool

type PrincipalID

type PrincipalID string

type TaskID

type TaskID string

type Time

type Time = time.Time

type UnknownTOMLKeyDetails added in v1.2.0

type UnknownTOMLKeyDetails struct {
	Filename string `json:"filename"`
	Line     int    `json:"line"`
	Column   int    `json:"column"`
	Key      string `json:"key"`
}

type UserID

type UserID string

Jump to

Keyboard shortcuts

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