headers

package
v0.0.0-...-e6c7ec5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderErrors        = "X-Errors"
	HeaderSizes         = "X-Sizes"
	HeaderStartTime     = "X-Start-Time"
	HeaderEndTime       = "X-End-Time"
	HeaderFileName      = "X-File-Name"
	HeaderWatchTopics   = "X-Topics"
	HeaderConsumerGroup = "X-Consumer-Group"
	HeaderID            = "X-Id"
	HeaderLimit         = "X-Limit"
	Accept              = "Accept"
	ContentType         = "Content-Type"
	LastModified        = "Last-Modified"
)

Headers using Canonical MIME structure

Variables

View Source
var (
	ErrTopicDoesNotExist   = errors.New(errTopicDoesNotExist)
	ErrTopicAlreadyExists  = errors.New(errTopicAlreadyExists)
	ErrInvalidHeaderSizes  = errors.New(errInvalidHeaderSizes)
	ErrConsumerLockFailed  = errors.New(errConsumerLockFailed)
	ErrInvalidMessageID    = errors.New(errInvalidMessageID)
	ErrInvalidMessageLimit = errors.New(errInvalidMessageLimit)
	ErrInvalidTopic        = errors.New(errInvalidTopic)
	ErrInvalidBodyMissing  = errors.New(errInvalidBodyMissing)
	ErrInvalidBodyJSON     = errors.New(errInvalidBodyJSON)
	ErrInvalidWebsocket    = errors.New(errInvalidWebsocket)
	ErrNoContent           = errors.New(errNoContent)
	ErrClosed              = errors.New(errClosed)
	ErrProxyFailed         = errors.New(errProxyFailed)
)

Errors returned by the Client/Server

Functions

func ReadErrors

func ReadErrors(header http.Header) error

ReadErrors reads any errors from the response header and returns as an error type

func ReadSizes

func ReadSizes(header http.Header) ([]int64, error)

ReadSizes reads the message sizes from the header

func SetError

func SetError(w http.ResponseWriter, errOriginal error)

SetError adds the error to the response header and body and sets the status code as needed

func SetSizes

func SetSizes(msgSizes []int64, h http.Header) http.Header

SetSizes sets the sizes of the messages in the header

Types

type ModifyRequest

type ModifyRequest struct {
	Truncate int64     `json:"truncate,omitempty"`
	Before   time.Time `json:"before,omitempty"`
}

ModifyRequest is the request structure required by the modify endpoints

type TopicInfo

type TopicInfo struct {
	MinOffset int64 `json:"minOffset"`
	MaxOffset int64 `json:"maxOffset"`
}

TopicInfo is the response structure returned by the modify endpoints

Jump to

Keyboard shortcuts

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