m3msg

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackType

type CallbackType int

CallbackType defines the type for the callback.

const (
	// OnSuccess will mark the call as success.
	OnSuccess CallbackType = iota
	// OnNonRetriableError will mark the call as errored but not retriable.
	OnNonRetriableError
	// OnRetriableError will mark the call as errored and should be retried.
	OnRetriableError
)

Supported CallbackTypes.

type Configuration

type Configuration struct {
	// Server configs the server.
	Server server.Configuration `yaml:"server"`

	// Handler configs the handler.
	Handler handlerConfiguration `yaml:"handler"`

	// Consumer configs the consumer.
	Consumer consumer.Configuration `yaml:"consumer"`
}

Configuration configs the m3msg server.

func (Configuration) NewServer

func (c Configuration) NewServer(
	writeFn WriteFn,
	iOpts instrument.Options,
) (server.Server, error)

NewServer creates a new server.

type MsgpackIteratorConfiguration

type MsgpackIteratorConfiguration struct {
	// Whether to ignore encoded data streams whose version is higher than the current known version.
	IgnoreHigherVersion *bool `yaml:"ignoreHigherVersion"`

	// Reader buffer size.
	ReaderBufferSize *int `yaml:"readerBufferSize"`
}

MsgpackIteratorConfiguration configs the msgpack iterator.

func (MsgpackIteratorConfiguration) NewOptions

NewOptions creates a new msgpack aggregated iterator options.

type Options

type Options struct {
	InstrumentOptions         instrument.Options
	WriteFn                   WriteFn
	AggregatedIteratorOptions msgpack.AggregatedIteratorOptions
}

Options for the ingest handler.

type RefCountedCallback

type RefCountedCallback struct {
	// contains filtered or unexported fields
}

RefCountedCallback wraps a message with a reference count, the message will be acked once the reference count decrements to zero.

func NewRefCountedCallback

func NewRefCountedCallback(msg consumer.Message) *RefCountedCallback

NewRefCountedCallback creates a RefCountedCallback.

func (*RefCountedCallback) Callback

func (r *RefCountedCallback) Callback(t CallbackType)

Callback performs the callback.

func (*RefCountedCallback) IncRef

func (r *RefCountedCallback) IncRef()

IncRef increments the ref count.

type WriteFn

type WriteFn func(
	ctx context.Context,
	id []byte,
	metricTime time.Time,
	value float64,
	sp policy.StoragePolicy,
	callback *RefCountedCallback,
)

WriteFn is the function that writes a metric.

Jump to

Keyboard shortcuts

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