internal

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckID

type AckID interface{}

AckID is the identifier of a message for purposes of acknowledgement.

type Message

type Message struct {
	// ID message identifier for recorded messages on the server.
	ID string

	// Body contains the content of the message.
	Body []byte

	// Metadata has key/value pairs describing the message.
	Metadata map[string]string
}

Message is data that moves around between client and server

func (*Message) ByteSize

func (m *Message) ByteSize() int

ByteSize estimates the size in bytes of the message for the purpose of restricting batch sizes.

type Queue

type Queue interface {
	Send(ctx context.Context, ms ...*Message) error
	Receive(ctx context.Context, count int) ([]*Message, error)

	// Close cleans up any resources used by the Publisher.
	Close() error
}

type Server

type Server interface {
	// ListenAndServe listens on the TCP network address addr and then
	// calls Serve with handler to handle requests on incoming connections.
	// The addr argument will be a non-empty string specifying "host:port".
	// The http.Handler will always be non-nil.
	// Drivers must block until serving is done (or
	// return an error if serving can't occur for some reason), serve
	// requests to the given http.Handler, and be interruptable by Shutdown.
	// Drivers should use the given address if they serve using TCP directly.
	ListenAndServe(addr string, h http.Handler) error

	// Shutdown gracefully shuts down the server without interrupting
	// any active connections. If the provided context expires before
	// the shutdown is complete, Shutdown returns the context's error,
	// otherwise it returns any error returned from closing the Server's
	// underlying Listener(s).
	Shutdown(ctx context.Context) error
}

Server dispatches requests to an http.Handler.

type Subscriber

type Subscriber interface {
	Handle(ctx context.Context, ms *Message) error

	// Close cleans up any resources used by the Subscriber.
	Close() error
}

type TLSServer

type TLSServer interface {
	// ListenAndServeTLS is similar to Server.ListenAndServe, but should
	// serve using TLS.
	// See http://go/godoc/net/http/#Server.ListenAndServeTLS.
	ListenAndServeTLS(addr, certFile, keyFile string, h http.Handler) error
}

TLSServer is an optional interface for Server drivers, that adds support for serving TLS.

Jump to

Keyboard shortcuts

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