operations

package
v0.0.0-...-7768eb9 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequest = errors.New("invalid request")
	ErrNoResponse     = errors.New("no response")
)

Functions

This section is empty.

Types

type DeleteHandlers

Common operation types.

type DeleteOperation

Common operation implementations.

type HTTPHandlers

type HTTPHandlers[RequestType any, ResponseType any] struct {
	BuildRequest  func(context.Context, RequestType) (*http.Request, error)
	ParseResponse func(context.Context, RequestType, *common.JSONHTTPResponse) (ResponseType, error)
	ErrorHandler  func(*http.Response, []byte) error
}

HTTPHandlers contains operation-specific HTTP handlers for building and parsing HTTP requests and responses.

type HTTPOperation

type HTTPOperation[RequestType any, ResponseType any] struct {
	// contains filtered or unexported fields
}

HTTPOperation provides a generic implementation for HTTP-based operations like read, write, delete, etc.

func NewHTTPOperation

func NewHTTPOperation[RequestType any, ResponseType any](
	client common.AuthenticatedHTTPClient,
	handlers HTTPHandlers[RequestType, ResponseType],
) *HTTPOperation[RequestType, ResponseType]

func (*HTTPOperation[RequestType, ResponseType]) ExecuteRequest

func (op *HTTPOperation[RequestType, ResponseType]) ExecuteRequest(
	ctx context.Context,
	params RequestType,
) (ResponseType, error)

nolint:ireturn,cyclop

type ListObjectMetadataHandlers

type ListObjectMetadataHandlers = HTTPHandlers[[]string, *common.ListObjectMetadataResult]

Gets metadata for a list of objects in a single request.

type ListObjectMetadataOperation

type ListObjectMetadataOperation = HTTPOperation[[]string, *common.ListObjectMetadataResult]

Gets metadata for a list of objects in a single request.

type ReadHandlers

Common operation types.

type ReadOperation

type ReadOperation = HTTPOperation[common.ReadParams, *common.ReadResult]

Common operation implementations.

type SingleObjectMetadataHandlers

type SingleObjectMetadataHandlers = HTTPHandlers[string, *common.ObjectMetadata]

Gets metadata for a single object.

type SingleObjectMetadataOperation

type SingleObjectMetadataOperation = HTTPOperation[string, *common.ObjectMetadata]

Gets metadata for a single object.

type WriteHandlers

Common operation types.

type WriteOperation

Common operation implementations.

Jump to

Keyboard shortcuts

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