api

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	i_api.API
	// contains filtered or unexported fields
}

func New

func New(api i_api.API, protocol string) *API

func (*API) Process

func (a *API) Process(id string, submission *t_api.Request) (*t_api.Response, *Error)

func (*API) SearchPromises

func (a *API) SearchPromises(id string, state string, tags map[string]string, limit int, cursor string) (*t_api.SearchPromisesRequest, *Error)

func (*API) SearchSchedules

func (a *API) SearchSchedules(id string, tags map[string]string, limit int, cursor string) (*t_api.SearchSchedulesRequest, *Error)

func (*API) TaskProcessId

func (a *API) TaskProcessId(id string, counter int) string

func (*API) ValidateCron

func (a *API) ValidateCron(cron string) *Error

type Error

type Error struct {
	// Code is the internal code that indicates the type of error
	Code t_api.StatusCode `json:"code,omitempty"`

	// Message is the error message
	Message string `json:"message,omitempty"`

	// Details is a list of details about the error
	Details []*ErrorDetails `json:"details,omitempty"`
}

func RequestError

func RequestError(status t_api.StatusCode) *Error

func RequestValidationError

func RequestValidationError(err error) *Error

func ServerError

func ServerError(err error) *Error

func (*Error) Error

func (e *Error) Error() string

type ErrorDetails

type ErrorDetails struct {
	// Type is the specific error type
	Type string `json:"@type,omitempty"`

	// Message is a human readable description of the error
	Message string `json:"message,omitempty"`

	// Domain is the domain of the error
	Domain string `json:"domain,omitempty"`

	// Metadata is additional information about the error
	Metadata map[string]string `json:"metadata,omitempty"`
}

Directories

Path Synopsis
pb

Jump to

Keyboard shortcuts

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