types

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 4 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 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 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"
	ErrorUnknown                      ErrorCode = "unknown"
)

type ErrorData

type ErrorData map[string]any

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 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 UserID

type UserID string

Jump to

Keyboard shortcuts

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